PostMantis
API ReferencePosts

Create a post

Creates a publish-now post when `post.scheduledAt` is omitted, or a scheduled post when `post.scheduledAt` is a future ISO-8601 datetime. Accepts JSON or multipart/form-data (for direct file uploads). Posts must have a body, media, or both. Use `/uploads` first if you want server-verified artifacts.

POST
/api/v1/posts

Creates a publish-now post when post.scheduledAt is omitted, or a scheduled post when post.scheduledAt is a future ISO-8601 datetime. Accepts JSON or multipart/form-data (for direct file uploads). Posts must have a body, media, or both. Use /uploads first if you want server-verified artifacts.

Authorization

BearerAuth
AuthorizationBearer <token>

PostMantis API key from the dashboard. Include as Authorization: Bearer <key>.

In: header

Request Body

Post creation payload

TypeScript Definitions

Use the request body type in TypeScript.

post*
profiles*array<>
Items1 <= items
media?array<>
Items1 <= items <= 20
providerOptions?

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://loading/api/v1/posts" \  -H "Content-Type: application/json" \  -d '{    "post": {      "body": "Ship small. Learn fast."    },    "profiles": [      "4339a6bc-9cd3-455e-8f91-df8bc63f12d7"    ]  }'
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "pending",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "media": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "artifactId": "706a3f1e-c357-4634-b1bf-20c221b5bb4e",        "artifactStatus": "reserved",        "contentType": "string",        "url": "http://example.com",        "alt": "string"      }    ],    "deliveries": [      {        "provider": "x",        "profileName": "string",        "status": "pending",        "providerOptions": {          "property1": null,          "property2": null        },        "profileId": "faebe71b-2bf8-4bdb-9b67-258e4d6aa00a",        "scheduledAt": "2019-08-24T14:15:22Z",        "publishedAt": "2019-08-24T14:15:22Z",        "failedAt": "2019-08-24T14:15:22Z",        "providerPostId": "string",        "url": "http://example.com",        "errorMessage": "string"      }    ],    "body": "string",    "scheduledAt": "2019-08-24T14:15:22Z",    "canceledAt": "2019-08-24T14:15:22Z"  }}
{  "type": "https://postmantis.com/problems/invalid-request",  "title": "Invalid request",  "status": 400,  "detail": "The request payload failed validation.",  "code": "invalidRequest"}
{  "type": "https://postmantis.com/problems/unauthorized",  "title": "Unauthorized",  "status": 401,  "detail": "Authentication required.",  "code": "unauthorized"}
{  "type": "https://postmantis.com/problems/forbidden",  "title": "Forbidden",  "status": 403,  "detail": "The authenticated API key is not allowed to perform this action.",  "code": "forbidden"}
{  "type": "https://postmantis.com/problems/unsupported-media-type",  "title": "Unsupported media type",  "status": 415,  "detail": "Unsupported content type. Use application/json or multipart/form-data.",  "code": "unsupportedMediaType"}
{  "type": "https://postmantis.com/problems/rate-limited",  "title": "Too many requests",  "status": 429,  "detail": "Too many requests.",  "code": "rateLimited"}