API reference
OpenAPI spec generated from the routes, an interactive reference of every operation, and how to import the contract into Postman, Insomnia or a client generator.
The reference is generated on every deploy from the routes themselves: the body, query and parameter schemas are the ones the API uses to validate. What is there is what the API accepts. Summaries and descriptions in the reference are written in Portuguese.
- Interactive reference: api.postmatic.dev/docs, every operation with parameters, responses per status and request examples in several languages.
- OpenAPI 3 spec: api.postmatic.dev/openapi.json.
- Index for agents: postmatic.dev/llms.txt.
Every operation
| Operation | Description | Auth |
|---|---|---|
GET /v1/health/auth | Verifies the credential and returns the project. | key or Bearer |
GET /v1/connect/:platform | Authorization URL to connect an account. | key or Bearer |
GET /v1/connect/integrations | Lists connected accounts. | key or Bearer |
DELETE /v1/connect/integrations/:id | Disconnects an account. | key or Bearer |
GET /v1/integrations/:id/health | Connection health of one account. | key or Bearer |
POST /v1/profiles | Creates a profile. | key or Bearer |
GET /v1/profiles | Lists profiles. | key or Bearer |
DELETE /v1/profiles/:id | Removes a profile. | key or Bearer |
POST /v1/posts | Creates a post, now or scheduled. | key or Bearer |
GET /v1/posts | Lists posts. | key or Bearer |
GET /v1/posts/:id | Reads a post. | key or Bearer |
PATCH /v1/posts/:id | Reschedules a post. | key or Bearer |
DELETE /v1/posts/:id | Cancels a scheduled post. | key or Bearer |
POST /v1/media | Uploads an image. | key or Bearer |
GET /v1/me | User, organization and projects. | Bearer |
PATCH /v1/organizations/:id | Renames the organization. | Bearer |
DELETE /v1/me | Deletes the account. | Bearer |
GET /v1/projects/:id/api-keys | Lists API keys. | Bearer |
POST /v1/projects/:id/api-keys | Creates an API key. | Bearer |
DELETE /v1/projects/:id/api-keys/:keyId | Revokes a key. | Bearer |
GET /v1/connect/instagram/callback | OAuth return; called by Meta. | public |
POST /v1/meta/deauthorize | Deauthorization callback; called by Meta. | public |
POST /v1/meta/data-deletion | Data deletion callback; called by Meta. | public |
GET /v1/meta/data-deletion/:code | Status of a deletion request. | public |
GET /healthz | Liveness. | public |
Importing the contract
Postman and Insomnia: import from the URL https://api.uat.postmatic.dev/openapi.json. Configure the authentication variable as the x-access-key header.
Generating a client: any generator that reads OpenAPI 3 works. With openapi-generator:
npx @openapitools/openapi-generator-cli generate \
-i https://api.uat.postmatic.dev/openapi.json \
-g typescript-fetch \
-o ./postmatic-clientValidating requests in tests: the spec works as a contract for tools such as Prism (@stoplight/prism-cli), which spin up a mock of the API from it:
npx @stoplight/prism-cli mock https://api.uat.postmatic.dev/openapi.jsonWhat the reference does not cover
The reference describes the contract of each operation. Behaviour across operations (the lifecycle of a post, when to reconnect an account, how to retry safely) lives in the guides: Posts, Accounts and profiles, Errors.