Approvals
Send a post back
Sends a post that’s waiting for approval back to drafts, with an optional reason and note for the person who wrote it. They appear on the post as sentBack.
POST
/
posts
/
{id}
/
reject
Send a post back
curl --request POST \
--url https://api.postploy.com/public/v1/posts/{id}/reject \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"reason": "Off-brand",
"note": "We don't use exclamation marks in headlines."
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Off-brand', note: 'We don\'t use exclamation marks in headlines.'})
};
fetch('https://api.postploy.com/public/v1/posts/{id}/reject', 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/{id}/reject"
payload = {
"reason": "Off-brand",
"note": "We don't use exclamation marks in headlines."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"statusGroup": "draft",
"blockedReason": "account_disconnected",
"socialAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform": "linkedin",
"title": "<string>",
"text": "<string>",
"thread": [
"<string>"
],
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"acceptedAt": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"link": "<string>",
"failureReason": "<string>",
"failureKind": "transient",
"sentBack": {
"reason": "<string>",
"note": "<string>",
"by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "member"
},
"at": "2023-11-07T05:31:56Z"
},
"review": {
"reviewer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sentAt": "2023-11-07T05:31:56Z"
},
"attempts": 123,
"mediaIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"media": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "image",
"fileName": "<string>",
"url": "<string>",
"thumbnailUrl": "<string>",
"mimeType": "<string>",
"duration": 123,
"altText": "<string>"
}
],
"platformFields": {
"linkedin": {
"visibility": "PUBLIC",
"firstComment": "<string>",
"link": "<string>"
},
"twitter": {
"replyRule": "everyone",
"retweetConfig": {
"value": 2,
"frequency": "hour"
}
},
"instagram": {
"postType": "post",
"reelGrid": "reel_only",
"firstComment": "<string>",
"collaborators": [
"<string>"
]
},
"tiktok": {
"visibility": "public",
"discloseContent": true,
"allowMusic": true,
"promotion": [
"brand"
],
"allowUsersTo": [
"comment"
]
},
"youtube": {
"visibility": "public",
"forKids": true
}
},
"conversationId": "<string>",
"seriesId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"actions": {
"edit": true,
"approve": true,
"reject": true,
"review": true,
"retry": true,
"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": 409,
"message": "This post is being published right now",
"errors": null,
"timestamp": "2030-01-15T09:00:01.000Z",
"route": "/public/v1/posts/3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9"
}{
"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
Send a post back
curl --request POST \
--url https://api.postploy.com/public/v1/posts/{id}/reject \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"reason": "Off-brand",
"note": "We don't use exclamation marks in headlines."
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Off-brand', note: 'We don\'t use exclamation marks in headlines.'})
};
fetch('https://api.postploy.com/public/v1/posts/{id}/reject', 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/{id}/reject"
payload = {
"reason": "Off-brand",
"note": "We don't use exclamation marks in headlines."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"statusGroup": "draft",
"blockedReason": "account_disconnected",
"socialAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform": "linkedin",
"title": "<string>",
"text": "<string>",
"thread": [
"<string>"
],
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"acceptedAt": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"link": "<string>",
"failureReason": "<string>",
"failureKind": "transient",
"sentBack": {
"reason": "<string>",
"note": "<string>",
"by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "member"
},
"at": "2023-11-07T05:31:56Z"
},
"review": {
"reviewer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sentAt": "2023-11-07T05:31:56Z"
},
"attempts": 123,
"mediaIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"media": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "image",
"fileName": "<string>",
"url": "<string>",
"thumbnailUrl": "<string>",
"mimeType": "<string>",
"duration": 123,
"altText": "<string>"
}
],
"platformFields": {
"linkedin": {
"visibility": "PUBLIC",
"firstComment": "<string>",
"link": "<string>"
},
"twitter": {
"replyRule": "everyone",
"retweetConfig": {
"value": 2,
"frequency": "hour"
}
},
"instagram": {
"postType": "post",
"reelGrid": "reel_only",
"firstComment": "<string>",
"collaborators": [
"<string>"
]
},
"tiktok": {
"visibility": "public",
"discloseContent": true,
"allowMusic": true,
"promotion": [
"brand"
],
"allowUsersTo": [
"comment"
]
},
"youtube": {
"visibility": "public",
"forKids": true
}
},
"conversationId": "<string>",
"seriesId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"actions": {
"edit": true,
"approve": true,
"reject": true,
"review": true,
"retry": true,
"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": 409,
"message": "This post is being published right now",
"errors": null,
"timestamp": "2030-01-15T09:00:01.000Z",
"route": "/public/v1/posts/3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}