Public API
⚠️

Warning: This Feature is currently in Beta and is in active-development. It does not provide all of the Postiz Features currently.

For NodeJS / N8N users

You can use the Postiz NodeJS SDK to interact with the Postiz Public API.

For a custom n8n node check Postiz n8n custom node

Public API allows you to work with Postiz in headless mode

To use the Public API, go to Postiz settings and copy the API Key.
With each request you need to pass the API Key in the header Authorization: {apiKey}.
If you are using the hosted version of Postiz the URL will be https://api.postiz.com/public/v1.
If you are self-hosting Postiz the URL will be https://{NEXT_PUBLIC_BACKEND_URL}/public/v1.

There is a limit of 30 requests per hour.
It does not mean you can post only 30 posts per hour, it means you can make 30
requests to the API per hour. If you plan ahead, you can have a lot more every hour.


NOTE: The UI representation is a channel, but on the API it is called integration. So when you see integration in the API, it means a channel.


Here are the following API endpoints you can use:

Get all added channels

GET https://api.postiz.com/public/v1/integrations

Response:

[
  {
    "id": "asdfasf2342dsaxfcsf",
    "name": "Nevo David",
    "identifier": "facebook",
    "picture": "https://upload.postiz.com/picture.png",
    "disabled": false,
    "profile": "nevo_david",
    "customer": {
      "id": "asdfasf2342dsaxfcsfsadfsadf",
      "name": "My Customer"
    }
  }
]


Upload a new file (from-data)

POST https://api.postiz.com/public/v1/upload

Payload: file - File

Response:

{
  "id": "e639003b-f727-4a1e-87bd-74a2c48ae41e",
  "name": "vXJYn8EzSB.png",
  "path": "https://uploads.gitroom.com/vXJYn8EzSB.png",
  "organizationId": "85460a39-6329-4cf4-a252-187ce89a3480",
  "createdAt": "2024-12-14T08:18:54.274Z",
  "updatedAt": "2024-12-14T08:18:54.274Z"
}


Post list

GET https://api.postiz.com/public/v1/posts?startDate=2024-12-14T08:18:54.274Z&endDate=2024-12-14T08:18:54.274Z&customer=optionalCustomerId

Query Parameters:

PropertyTypeRequiredDescription
startDatestringYesUTC date in ISO format
endDatestringYesUTC date in ISO format
customerstringNoCustomer ID

Response:

{
  "posts": [
    {
      "id": "cm4gklk8o00008copo77fa0f8",
      "content": "blabla",
      "publishDate": "2024-12-09T05:06:00.000Z",
      "releaseURL": "https://twitter.com/nevodavid/status/1865986385708204316",
      "state": "QUEUE|PUBLISHED|ERROR|DRAFT",
      "integration": {
        "id": "cm4ean69r0003w8w1cdomox9n",
        "providerIdentifier": "x",
        "name": "Nevo David",
        "picture": "https://uploads.gitroom.com/5g9mEIVCAq.jpeg"
      }
    }
  ]
}


Create / update a post

POST https://api.postiz.com/public/v1/posts

Payload:

{
  "type": "draft|schedule|now",
  "date": "2024-12-14T08:18:54.274Z",
  "posts": [
    {
      "integration": {
        "id": "asdfsad23rwdfasfsddc" // your channel id
      },
      "value": [
        {
          "content": "This is my cool post",
          "id": "Only if you want to edit an existing post",
          "image": [
            {
              "id": "string",
              "path": "string"
            }
          ]
        }
      ],
      "group": "uniqueId for all the posts in the same group",
      "settings": {
        "[key]": "check each channel DTOs in the files, or wait for the error on a new request"
      }
    }
  ]
}

Response:

[{ "postId": "POST_ID", "integration": "INTEGRATION_ID" }]

For self-hosting, you can access the modal code generator at: http://localhost:5000/modal/dark/all

Request

PropertyTypeRequiredDescription
typedraft | schedule | nowYesType of post creation
orderstringNoOrder of posts
shortLinkbooleanYesWhether to use short link
internumberNoInterval
datestring (Date)YesDate of post
tagsTags[]YesArray of tags
postsPost[]Yes (if type !== ‘draft’)Array of posts

Posts

PropertyTypeRequiredDescription
integrationIntegrationYesIntegration details
valuePostContent[]YesArray of post content
groupstringNoGroup name
settingsAllProvidersSettingsNoSettings for providers

Post Value

PropertyTypeRequiredDescription
contentstringYesPost content
idstringNoPost ID
imageMediaDto[]NoArray of media

Integration

PropertyTypeRequiredDescription
idstringYesIntegration ID

Tags

PropertyTypeRequiredDescription
valuestringYesTag value
labelstringYesTag label


Delete a post

DELETE https://api.postiz.com/public/v1/posts/:id

Response:

{
  "id": "e639003b-f727-4a1e-87bd-74a2c48ae41e"
}

NEW! (Generate videos with AI)

Request:

POST https://api.postiz.com/public/v1/generate-video

Response:

[
  {
    "id": "string",
    "path": "URL of the generated video"
  }
]

Payload (Slides of images)

{
  "type": "image-text-slides",
  "output": "vertical|horizontal",
  "customParams": {
    "voice": "elevenlabs voice id",
    "prompt": "description of the video"
  }
}

Get voices

POST https://api.postiz.com/public/v1/video/function

Payload

{
  "functionName": "loadVoices",
  "identifier": "image-text-slides"
}

Response

{
  "voices": [
    {
      "id": "string",
      "name": "string"
    }
  ]
}

Payload (VEO3 fast video) - Subscribed users after trial

{
  "type": "veo3",
  "output": "vertical|horizontal",
  "customParams": {
    "prompt": "",
    // images - optional (Maximum 3 images)
    "images": [{ "id": "string", "path": "string" }]
  }
}