> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwairy.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk update prompts

> Apply one operation to up to 20 prompts, such as archive, restore, frequency, topic or tags, preview it with dryRun, and inspect each result.

Applies the requested operation to each accessible prompt and returns a per-item
outcome. This endpoint uses idempotency instead of per-prompt ETags. Use
[Update a prompt](https://docs.qwairy.co/developers/endpoints/prompts/update.md) when you need a
conditional update against one known version.

Requires an active Business, Agency Business or Enterprise plan. Use an API token with write access enabled. See [Writing data](https://docs.qwairy.co/developers/writing-data.md) for
idempotency, conditional requests and error handling.

**Authorization** `string` *required*

Bearer token for your team.

**Idempotency-Key** `string` *required*

Unique key for this operation. Completed responses replay for 24 hours.

**brandId** `string` *required*

Workspace identifier. The workspace must belong to the token's team.

**operation** `string` *required*

`archive`, `restore`, `frequency`, `topic` or `tags`.

**promptIds** `string[]` *required*

Between 1 and 20 prompt UUIDs. Duplicate IDs are processed once.

**frequency** `string | null`

Required for `frequency`: `NONE`, `DAILY`, `WEEKLY`, `MONTHLY`, or `null` to
inherit the workspace schedule.

**keywordId** `string | null`

Required for `topic`: a topic UUID in the workspace, or `null` to detach.

**tagIds** `string[]`

Required for `tags`: the complete replacement list, at most 50 tag UUIDs. Send
`[]` to remove all tags except the system tag of each prompt, if any. In a
workspace created from v1.21, Qwairy sets the `Branded` or `Non-branded` system
tag from each prompt text. The id of either system tag in this list is ignored,
and the tag each prompt already carries is kept.

**dryRun** `boolean` (default: false)

Validate the request and return the per-item results without changing
anything.

## Response

Returns `200` with `operation`, `updated` and `results`. Inspect every
result even when the HTTP request succeeds:

| Item status | Meaning |
| - | - |
| `updated` | The prompt changed |
| `unchanged` | The requested state already applied |
| `not_found` | The prompt is absent or outside this workspace and team |

`updated` counts only items whose status is `updated`.
Archiving keeps answers and history.

## Synthetic request and response

```bash theme={null}
curl -X POST "https://www.qwairy.co/api/v1/brands/$BRAND_ID/prompts/bulk" \
  -H "Authorization: Bearer $QWAIRY_API_TOKEN" \
  -H "Idempotency-Key: archive-prompt-batch-001" \
  -H "Content-Type: application/json" \
  -d '{"operation":"archive","promptIds":["33333333-0000-4000-8000-000000000000","44444444-0000-4000-8000-000000000000"]}'
```

```json theme={null}
{
  "operation": "archive",
  "updated": 1,
  "results": [
    { "promptId": "33333333-0000-4000-8000-000000000000", "status": "updated" },
    {
      "promptId": "44444444-0000-4000-8000-000000000000",
      "status": "unchanged"
    }
  ]
}
```

## Errors

Invalid operations or payloads return `400 INVALID_REQUEST`. An inaccessible
workspace, topic or tag returns `404 RESOURCE_NOT_FOUND`.
Missing prompt IDs are reported per item instead.

See [Error codes](https://docs.qwairy.co/developers/errors.md) for authentication, plan, idempotency
and server errors. On `429`, honor `Retry-After`; writes can return
`503 SERVICE_UNAVAILABLE` if the write limiter is unavailable.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.