# Tag prompts

Update the AI prompt behind one tag.

Update the AI prompt behind one tag.

## Update tag prompt

`PUT /v1/config/prompts/tags/{tag_id}/`

Required scope: `config:write`

### Parameters

| Name | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `tag_id` | path | integer | Yes |  |
| `Idempotency-Key` | header | string (uuid) | Yes | UUID4 identifying one intended write. Reuse it only when retrying that same write. |

### Request body

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `prompt` | string | Yes | max length 10000 |

### Response (200)

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `kind` | string | No | read-only |
| `prompt` | string | No | read-only |
| `prompt_hash` | string | No | read-only |

### Responses

- `200` Success
- `400` The request is invalid.
- `401` Authentication is missing, invalid, or revoked.
- `403` The authenticated identity lacks the required scope or capability.
- `404` The resource is unavailable or not visible to this organization.
- `409` The write conflicts with current state or an identical request is still running.
- `422` The write contains fields outside its closed input schema.
- `429` The request-rate budget is exhausted.

```bash
curl -X PUT "https://api.themochi.app/v1/config/prompts/tags/<tag_id>/" \
  -H "Authorization: Bearer $MOCHI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"string"}'
```

