Skip to main content
The whole of API v1 is described in one OpenAPI file:
The API reference on this site is made from the same file, so the two say the same thing. On any reference page, Download API spec in the menu at the top of the page downloads it.

What’s in the file

  • OpenAPI 3.0.3, with the server https://postsyncer.com/api/v1. The upload endpoint names its own server, the upload host (below).
  • Bearer authentication, bearerAuth: send your key as Authorization: Bearer YOUR_API_KEY.
  • Every endpoint, each with an operationId such as listPosts or createPost, and one tag for its group, such as Posts or Media.
  • x-permission on each endpoint: the key permission it needs, such as posts:read. An endpoint that can schedule or publish lists those permissions too.
  • Request and response examples, with made-up data, and a schema for each object.
One endpoint is on another host. POST /media/upload/file (uploadMediaFile) goes to https://upload.postsyncer.com/api/v1, with the same key, and the file names that host on the endpoint. Some tools ignore a server set on one endpoint and send every request to the main address: check the upload request’s address after you import.
Requests from Postman, Insomnia or a generated client act on your real account. Try them with a draft-only key: see Test safely.

Import into Postman

  1. In Postman, click Import.
  2. Paste https://docs.postsyncer.com/api-reference/openapi.json and choose to import it as a Postman Collection.
  3. Open the new collection’s Authorization tab, choose Bearer Token, and put in your key. Store it in a variable or a vault secret rather than in the collection, so it isn’t shared with it.
  4. Check the upload request’s address. If it isn’t https://upload.postsyncer.com/api/v1/media/upload/file, change it to that.
Postman makes a request for each endpoint, with the examples from the file. To pick up new endpoints later, import the file again.

Import into Insomnia

  1. In Insomnia, choose Import.
  2. Paste the URL, or pick the file if you downloaded it.
  3. Set Bearer authentication with your key on the requests, and check the upload request’s address, as in Postman.

Generate a client

Any OpenAPI 3.0 generator reads the file. This example makes a TypeScript client with OpenAPI Generator, which needs Java:
The generator makes one class for each tag (PostsApi, MediaApi, WorkspacesApi…) and names each method after its operationId. List your workspaces:
If the generated uploadMediaFile calls the main address, your generator ignored the endpoint’s server. Then make a second Configuration with basePath: "https://upload.postsyncer.com/api/v1" and call uploadMediaFile through a MediaApi made with it. Generate the client again when the API changes. The changelog says what changed, and versioning says what we add without notice: new fields, endpoints and values. Write your code so a field or value it doesn’t know doesn’t break it.

API reference

Every endpoint, with a playground to try it.

CLI

Send the same requests from a terminal.