Posts
Create posts
Creates up to 50 posts. Every post is checked against its platform first. If any post is invalid, nothing is saved.
If you can’t publish in your team, your posts wait for approval instead of being scheduled.
POST
/
posts
Create posts
curl --request POST \
--url https://api.postploy.com/public/v1/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"posts": [
{
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"scheduledAt": "2030-01-15T09:00:00Z",
"timezone": "Europe/London"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
posts: [
{
socialAccountId: '5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d',
text: 'Our spring blend is here. Bright, citrusy and roasted this week.',
scheduledAt: '2030-01-15T09:00:00Z',
timezone: 'Europe/London'
}
]
})
};
fetch('https://api.postploy.com/public/v1/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.postploy.com/public/v1/posts"
payload = { "posts": [
{
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"scheduledAt": "2030-01-15T09:00:00Z",
"timezone": "Europe/London"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"id": "3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9",
"status": "scheduled",
"statusGroup": "scheduled",
"blockedReason": null,
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"platform": "linkedin",
"title": null,
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"thread": null,
"scheduledAt": "2030-01-15T09:00:00.000Z",
"timezone": "Europe/London",
"acceptedAt": null,
"publishedAt": null,
"deletedAt": null,
"link": null,
"failureReason": null,
"failureKind": null,
"sentBack": null,
"review": null,
"attempts": 0,
"mediaIds": [],
"media": [],
"platformFields": null,
"conversationId": null,
"seriesId": null,
"createdAt": "2030-01-10T12:00:00.000Z",
"actions": {
"edit": true,
"approve": false,
"reject": false,
"retry": false,
"delete": true
}
}
]
}{
"statusCode": 400,
"message": "Scheduled date and time must be in the future",
"errors": [
{
"message": "Scheduled date and time must be in the future",
"path": [
"posts",
0,
"scheduledAt"
],
"cause": "custom"
}
],
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/posts"
}{
"statusCode": 401,
"message": "Invalid API key",
"errors": null,
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/accounts"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}Authorizations
Body
application/json
⌘I
Create posts
curl --request POST \
--url https://api.postploy.com/public/v1/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"posts": [
{
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"scheduledAt": "2030-01-15T09:00:00Z",
"timezone": "Europe/London"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
posts: [
{
socialAccountId: '5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d',
text: 'Our spring blend is here. Bright, citrusy and roasted this week.',
scheduledAt: '2030-01-15T09:00:00Z',
timezone: 'Europe/London'
}
]
})
};
fetch('https://api.postploy.com/public/v1/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.postploy.com/public/v1/posts"
payload = { "posts": [
{
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"scheduledAt": "2030-01-15T09:00:00Z",
"timezone": "Europe/London"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"id": "3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9",
"status": "scheduled",
"statusGroup": "scheduled",
"blockedReason": null,
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"platform": "linkedin",
"title": null,
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"thread": null,
"scheduledAt": "2030-01-15T09:00:00.000Z",
"timezone": "Europe/London",
"acceptedAt": null,
"publishedAt": null,
"deletedAt": null,
"link": null,
"failureReason": null,
"failureKind": null,
"sentBack": null,
"review": null,
"attempts": 0,
"mediaIds": [],
"media": [],
"platformFields": null,
"conversationId": null,
"seriesId": null,
"createdAt": "2030-01-10T12:00:00.000Z",
"actions": {
"edit": true,
"approve": false,
"reject": false,
"retry": false,
"delete": true
}
}
]
}{
"statusCode": 400,
"message": "Scheduled date and time must be in the future",
"errors": [
{
"message": "Scheduled date and time must be in the future",
"path": [
"posts",
0,
"scheduledAt"
],
"cause": "custom"
}
],
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/posts"
}{
"statusCode": 401,
"message": "Invalid API key",
"errors": null,
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/accounts"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}