# Retry failed accounts

Source: https://ampost.io/docs/api/posts-retry · Full reference: https://ampost.io/llms-full.txt

`POST /api/posts/{postId}/retry` · MCP tool `posts_retry` · scope `posts:write` · rate limit `publishPost` · success `200`

Publish again to the accounts that failed, or only to the given `accountIds` (from `platformPosts[].accountId`). Ampost already retries retryable failures (rate limits, timeouts, platform errors) by itself, up to 5 attempts with backoff; an account waiting for that shows `pending` with `nextAttemptAt`. Call this for an account that is `failed`, after fixing the cause. It starts `attempts` again from 0. A published account whose first comment failed (`platformPosts[].firstComment.status` failed) posts only the comment again, without publishing the post twice or counting it again. An account whose thread stopped at a failed item continues the thread from that item, without publishing the post or the earlier items again. To publish a draft or scheduled post, use posts_publish. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION unless the post is `partial` or `failed` (or only first comments failed).

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `accountIds` | body | string[] | no | Accounts to retry (`platformPosts[].accountId`). A published account whose `firstComment.status` is failed retries only the comment; an account whose thread stopped at a failed item continues the thread from that item (the post and earlier items are not published again); other accounts publish again. Default: every failed account and every failed first comment. |
| `Idempotency-Key` (MCP `idempotencyKey`) | header | string | no | Idempotency key (1-255 visible ASCII characters, for example a UUID). A retry with the same key and arguments within 24 hours returns the first result instead of running again. Send a new key for each new action. See Idempotency. |

Example request:

```json
{
  "accountIds": [
    "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30"
  ]
}
```

Example response. Facebook had failed with `AUTH_REVOKED`. After the account was reconnected, the retry published it; Instagram was already published and is not touched.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "published",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": null,
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": null,
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "17895695668004550",
      "publishedUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "108234567890123_901234567890125",
      "publishedUrl": "https://www.facebook.com/108234567890123/posts/901234567890125",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:41:12.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:41:12.000Z"
}
```
