Posts
Check posts
Checks up to 50 posts against their platforms’ rules without saving anything. Give each post a socialAccountId, or just a platform while you’re still planning.
POST
/
posts
/
validate
Check posts
curl --request POST \
--url https://api.postploy.com/public/v1/posts/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"posts": [
{
"platform": "twitter",
"text": "Our spring blend is here. Bright, citrusy and roasted this week."
},
{
"platform": "instagram",
"text": "Spring, in a cup."
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
posts: [
{
platform: 'twitter',
text: 'Our spring blend is here. Bright, citrusy and roasted this week.'
},
{platform: 'instagram', text: 'Spring, in a cup.'}
]
})
};
fetch('https://api.postploy.com/public/v1/posts/validate', 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/validate"
payload = { "posts": [
{
"platform": "twitter",
"text": "Our spring blend is here. Bright, citrusy and roasted this week."
},
{
"platform": "instagram",
"text": "Spring, in a cup."
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"socialAccountId": null,
"platform": "twitter",
"valid": true,
"errors": [],
"warnings": []
},
{
"socialAccountId": null,
"platform": "instagram",
"valid": false,
"errors": [
{
"field": "mediaIds",
"message": "Instagram posts need at least one image or video"
}
],
"warnings": []
}
]
}{
"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
Check posts
curl --request POST \
--url https://api.postploy.com/public/v1/posts/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"posts": [
{
"platform": "twitter",
"text": "Our spring blend is here. Bright, citrusy and roasted this week."
},
{
"platform": "instagram",
"text": "Spring, in a cup."
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
posts: [
{
platform: 'twitter',
text: 'Our spring blend is here. Bright, citrusy and roasted this week.'
},
{platform: 'instagram', text: 'Spring, in a cup.'}
]
})
};
fetch('https://api.postploy.com/public/v1/posts/validate', 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/validate"
payload = { "posts": [
{
"platform": "twitter",
"text": "Our spring blend is here. Bright, citrusy and roasted this week."
},
{
"platform": "instagram",
"text": "Spring, in a cup."
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"socialAccountId": null,
"platform": "twitter",
"valid": true,
"errors": [],
"warnings": []
},
{
"socialAccountId": null,
"platform": "instagram",
"valid": false,
"errors": [
{
"field": "mediaIds",
"message": "Instagram posts need at least one image or video"
}
],
"warnings": []
}
]
}{
"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>"
}