PostMantis
API Reference

API Overview

Public API for posting, scheduling, uploads, and delivery inspection.

The PostMantis public API lives under /api/v1. It automates what you do over and over: look up connected social accounts, upload media, create or schedule posts, and check what happened.

API-key management and OAuth connect flows are dashboard-only. They are setup ceremonies, not automation — you do them once in the browser, then automate everything else with a Bearer key.

Single source of truth

Every endpoint, parameter, and error on the following pages is generated from the same OpenAPI spec the server ships. Read the raw spec at /api/v1/openapi-docs, or use it to generate an SDK for any language.

Authentication

Authorization: Bearer <api-key>

Keys are created in the dashboard. A key carries a scope: read (list/get only) or write (create/update/cancel/disconnect/upload). Key scope can also be limited to specific providers or profiles.

Core flow

  1. List profiles with GET /api/v1/profiles — collect the ids you will post to.
  2. Upload media (optional): POST /api/v1/uploadsPUT bytes to uploadUrlPOST /api/v1/uploads/complete → keep the returned artifactId.
  3. Create a post with POST /api/v1/posts. Omit post.scheduledAt to publish now; send a future ISO-8601 datetime to schedule.
  4. Read state with GET /api/v1/posts/{postId} to see per-provider delivery outcomes.
  5. Cancel a future scheduled post with POST /api/v1/posts/{postId}/cancel.

Create is async acceptance: you get a 201 with the post id immediately, then poll GET /api/v1/posts/{postId} for the final delivery result.

One envelope rule

Every response carries the primary resource(s) under a data field. Single resources: { data: Post }. Lists: { data: Post[], pagination }pagination is a sibling of data, never nested. Same rule for profiles, uploads, and logs.

Post states

StateMeaning
pendingAccepted. Worker has not settled the post yet.
scheduledWaiting for a future scheduledAt to fire.
settledAll deliveries resolved (published or failed).
canceledA future delivery was stopped before it ran.

Each delivery also has its own status: pending, published, failed, or canceled. Read them on the post's deliveries array.

Endpoints at a glance

Every endpoint below gets a full reference page (request/response shapes, examples, errors) generated from the OpenAPI spec. This table is the map.

Profiles

MethodPathOperation
GET/api/v1/profilesList connected profiles
GET/api/v1/profiles/{id}Get a single profile
POST/api/v1/profiles/{id}/disconnectPermanently disconnect a profile

Posts

MethodPathOperation
GET/api/v1/postsList posts (filter, paginate)
POST/api/v1/postsCreate a publish-now or scheduled post
GET/api/v1/posts/{postId}Get a post with delivery outcomes
PATCH/api/v1/posts/{postId}Update a future scheduled post
POST/api/v1/posts/{postId}/cancelCancel a scheduled post and its deliveries

POST /api/v1/posts accepts application/json (with artifactId media references from /uploads) or multipart/form-data for direct file attachment. For multipart, send one payload text field holding JSON plus one File part per media item, referencing each file inside media[] by fileField: "<partName>". The server uploads the bytes and replaces the reference with a real artifactId.

Uploads

MethodPathOperation
POST/api/v1/uploadsRequest a presigned URL and a reserved artifactId
POST/api/v1/uploads/completeVerify the upload and promote it to a usable artifact

Two-phase flow keeps the API key off the bytes path. Max file size: 150 MB.

Publishing Logs

MethodPathOperation
GET/api/v1/publish/logsList delivery events for audit

Read-only event stream: pending, published, failed, canceled per delivery.

Errors

Errors use RFC 7807 Problem Details. Each operation page documents the status codes it can return. Common ones:

StatusCodeWhen
401unauthorizedMissing or invalid API key
403forbiddenKey lacks permission for this operation
404notFoundResource not found or outside key scope
409conflictResource state prevents operation
429rateLimitedToo many requests — back off and retry

What is intentionally not here

  • API key management (/api/v1/api-keys*) — dashboard session only.
  • Provider OAuth connect — dashboard session only.
  • Webhooks — not yet an automation surface.

If you need either of the first two, do them in the dashboard once, then automate with a key.