postmatic

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.

Every operation

OperationDescriptionAuth
GET /v1/health/authVerifies the credential and returns the project.key or Bearer
GET /v1/connect/:platformAuthorization URL to connect an account.key or Bearer
GET /v1/connect/integrationsLists connected accounts.key or Bearer
DELETE /v1/connect/integrations/:idDisconnects an account.key or Bearer
GET /v1/integrations/:id/healthConnection health of one account.key or Bearer
POST /v1/profilesCreates a profile.key or Bearer
GET /v1/profilesLists profiles.key or Bearer
DELETE /v1/profiles/:idRemoves a profile.key or Bearer
POST /v1/postsCreates a post, now or scheduled.key or Bearer
GET /v1/postsLists posts.key or Bearer
GET /v1/posts/:idReads a post.key or Bearer
PATCH /v1/posts/:idReschedules a post.key or Bearer
DELETE /v1/posts/:idCancels a scheduled post.key or Bearer
POST /v1/mediaUploads an image.key or Bearer
GET /v1/meUser, organization and projects.Bearer
PATCH /v1/organizations/:idRenames the organization.Bearer
DELETE /v1/meDeletes the account.Bearer
GET /v1/projects/:id/api-keysLists API keys.Bearer
POST /v1/projects/:id/api-keysCreates an API key.Bearer
DELETE /v1/projects/:id/api-keys/:keyIdRevokes a key.Bearer
GET /v1/connect/instagram/callbackOAuth return; called by Meta.public
POST /v1/meta/deauthorizeDeauthorization callback; called by Meta.public
POST /v1/meta/data-deletionData deletion callback; called by Meta.public
GET /v1/meta/data-deletion/:codeStatus of a deletion request.public
GET /healthzLiveness.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:

TypeScript client
npx @openapitools/openapi-generator-cli generate \
  -i https://api.uat.postmatic.dev/openapi.json \
  -g typescript-fetch \
  -o ./postmatic-client

Validating 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:

Local mock
npx @stoplight/prism-cli mock https://api.uat.postmatic.dev/openapi.json

What 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.

API reference — Postmatic Documentation