# Change a publication

`PATCH /v1/publications/{id}`

Scope: `docs:write`.

## Request

```bash
curl -X PATCH "https://api.lydie.co/v1/publications/01JCQ3V5MZ8G4ZK2X7T9R6N1PB" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Path parameters

- `id` (ULID, required)

## Body

- `includeSubpages` (boolean, optional)
- `filter` (object, optional, nullable): Publish only documents whose property equals this (lists: contains it).
  - `property` (string, required): (1–128 chars)
  - `equals` (any, required)
- `config` (object, optional)
- `autoPublish` (boolean, optional)

## Response

- `publication` (Publication, required)
  - `id` (ULID, required)
  - `workspaceId` (string, required): (1–64 chars)
  - `connectionId` (ULID, required)
  - `connector` (string, required)
  - `documentId` (ULID, required)
  - `includeSubpages` (boolean, required)
  - `filter` (object, required, nullable): Publish only documents whose property equals this (lists: contains it).
    - `property` (string, required): (1–128 chars)
    - `equals` (any, required)
  - `config` (object, required)
  - `autoPublish` (boolean, required)
  - `lastRunAt` (timestamp, required, nullable)
  - `items` (PublicationItem[], required)
    - `id` (ULID, required)
    - `documentId` (ULID, required)
    - `state` (string, required): One of: `draft`, `scheduled`, `publishing`, `published`, `updated_pending`, `failed`, `unpublished`, `diverged`.
    - `externalId` (string, required, nullable)
    - `externalUrl` (string, required, nullable)
    - `lastPublishedAt` (timestamp, required, nullable)
    - `lastError` (object, required, nullable)
    - `divergence` (object, required, nullable): For diverged items: reason, base/ours/theirs (destination format), conflicts, marked text and the pull request.
    - `updatedAt` (timestamp, required)
  - `createdBy` (string, required, nullable)
  - `updatedBy` (string, required, nullable)
  - `createdAt` (timestamp, required)
  - `updatedAt` (timestamp, required)

```json
{
  "publication": {
    "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
    "workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
    "connectionId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
    "connector": "string",
    "documentId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
    "includeSubpages": false,
    "filter": null,
    "config": {},
    "autoPublish": false,
    "lastRunAt": null,
    "items": [
      {
        "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
        "documentId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
        "state": "draft",
        "externalId": null,
        "externalUrl": null,
        "lastPublishedAt": null,
        "lastError": null,
        "divergence": null,
        "updatedAt": "2026-11-12T09:30:00.000Z"
      }
    ],
    "createdBy": null,
    "updatedBy": null,
    "createdAt": "2026-11-12T09:30:00.000Z",
    "updatedAt": "2026-11-12T09:30:00.000Z"
  }
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
