API reference
Re-publish only the failed targets of a post, now or at a scheduled time.
https://api.betterpost.dev/v1/posts/{id}/retryFailed targets are reset and published again with their stored content; published targets are untouched. The retried targets are charged again (and refunded again if they fail). See Retry a post.
| Name | Description |
|---|---|
id | The post id. It must have at least one failed target. |
Optional. Omit it (or send {}) to retry now.
| Field | Type | Required | Description |
|---|---|---|---|
scheduledFor | string | No | Retry at this future time instead of now. |
timezone | string | No | IANA time zone for a scheduledFor without an offset. Default UTC. |
curl -s -X POST https://api.betterpost.dev/v1/posts/post_8f3k2m9q1x7v4n6b0c5d2a1z/retry \
-H "x-access-key: $BETTERPOST_API_KEY"202 Accepted
{
"success": true,
"status": "published",
"postId": "post_8f3k2m9q1x7v4n6b0c5d2a1z",
"platforms": [
{
"platform": "twitter",
"accountId": "acc_2x9c4v7b1n8m3k5j0h6g2f4d",
"success": true,
"platformPostUrl": "https://betterpost.dev/sandbox/p/twitter/sbx_1849203756184930275"
},
{
"platform": "linkedin",
"accountId": "acc_5l1n7k3j9h2g8f4d6s0a1q3w",
"success": true,
"platformPostUrl": "https://betterpost.dev/sandbox/p/linkedin/sbx_3307518824610937752"
}
]
}The result covers every target. With scheduledFor, status is scheduled and a post.scheduled webhook is
sent.
| Status | Code | When |
|---|---|---|
202 | The retry was accepted (see status). | |
400 | no_failed_targets | The post has no failed targets. |
400 | invalid_timezone, invalid_scheduled_for, scheduled_in_past | Bad scheduledFor or timezone. |
401 | unauthorized | Missing or unknown API key. |
402 | insufficient_credits | Not enough credits for the retried targets. Nothing changed. |
404 | not_found | No such post in this project. |
409 | post_publishing | The post is still pending or publishing. |
429 | rate_limited | More than 120 requests per minute. |