# Change a scheduled post

> Change the caption or time of a post that hasn't gone out. For use once the person has agreed the change.

```http
PATCH https://yapfactory.com/api/v1/posts/{postId}
```

|   |   |
| --- | --- |
| Who can use it | Brands |
| Tier | `write`: Changes your own things only. Nobody else is told. |
| Scope | `posts:write`, or `write` |
| Idempotency-Key | Optional, and recommended |
| Rate limit | Writes: 20 a minute |
| MCP tool | [`update_post`](https://yapfactory.com/developers/tools.md#update_post) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `postId` | path | `uuid` | yes | The post's id. |
| `caption` | body | `string` | no | The new caption. Up to 2200 characters. |
| `publishAt` | body | `datetime` | no | The new time, ISO 8601 with a time zone, 10 minutes to 60 days ahead. |

## Example request

```bash
curl -X PATCH "https://yapfactory.com/api/v1/posts/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f" \
  -H "Authorization: Bearer $YAP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "publishAt": "2026-12-11T18:00:00Z"
  }'
```

## Response

`200` with the result in `data`: the same object the MCP tool returns.

```json
{
  "data": {
    "id": "92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55",
    "status": "scheduled",
    "publishAt": "2026-12-11T18:00:00.000Z",
    "caption": "Fell asleep before the alarm app even loaded."
  }
}
```

An example: fields that don't apply are `null`, and new fields can be added at any time, so ignore ones you don't know. Every response carries `Request-Id` and the `RateLimit-*` headers.

## Errors

| Code | Status | When |
| --- | --- | --- |
| `invalid_request` | 400 | A field failed validation (see `meta.issues`), or an unknown query parameter. |
| `unauthorized` | 401 | No token, or it's wrong, expired, revoked or from the other environment. |
| `insufficient_scope` | 403 | The token doesn't have `posts:write` (or `write`). |
| `forbidden` | 403 | Only for brands, or the account can't do this yet (email not confirmed, paused). |
| `not_found` | 404 | No such post, or it isn't yours. |
| `conflict` | 409 | Its current state doesn't allow this. `message` says why, in words you can show. |
| `idempotency_conflict` | 409 | The same `Idempotency-Key` came with a different body. |
| `rate_limited` | 429 | Over the limit. Wait for `Retry-After` seconds. |
| `internal` | 500 | Our fault. Retry later, and send us the `requestId` if it keeps happening. |

Every error has the same shape. See [Errors](https://yapfactory.com/developers/errors.md) for what to do about each one.

---

HTML version: https://yapfactory.com/developers/api/update_post
