Update alignment prompt
Changes an alignment prompt’s text or category. Only the fields you send change. Neither field carries quota weight — for markets or active state, which do, use Update alignment prompt markets instead.
Requires the write:alignment scope, and the workspace must be enabled for API writes.
PATCH /v1/brands/{brand_id}/alignment/prompts/{prompt_id}Authorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Idempotency-Key | string | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
prompt_id | uuid | required | From List alignment prompts |
Query parameters
None.
Body
application/json. At least one field is required.
| Field | Type | Required | Description |
|---|---|---|---|
prompt_text | string, 1–500 chars | optional | The question to check |
category_id | uuid | null | optional | From List alignment categories. null to uncategorise. Must be a category on the same brand |
Request
cURL
curl --request PATCH \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/prompts/b4e91f2a-6c8d-4a17-9d35-2f7b81e4c9a6' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: 7e2b91c0-4a3d-4f65-8b19-0c7d2e9f5a41' \
--header 'Content-Type: application/json' \
--data '{"prompt_text":"Does the brand offer a free trial for teams?","category_id":"9d1f3a52-6b8e-4c07-a9d4-2e8b41f5c9a3"}'Response
200
{
"data": {
"prompt": {
"id": "b4e91f2a-6c8d-4a17-9d35-2f7b81e4c9a6",
"brand_id": "242546de-4cee-4a7d-952e-f6aa60c63ef8",
"category_id": "9d1f3a52-6b8e-4c07-a9d4-2e8b41f5c9a3",
"prompt_text": "Does the brand offer a free trial for teams?",
"is_active": true,
"country_codes": ["US"]
}
},
"request_id": "req_7d21b0af59c34e18b6ac"
}Response fields
The prompt after the change, in the same shape List alignment prompts returns its rows, so you can put it straight into a cache.
| Field | Type | Description |
|---|---|---|
data.prompt.id | uuid | required |
data.prompt.brand_id | uuid | required |
data.prompt.category_id | uuid | null | required |
data.prompt.prompt_text | string | required |
data.prompt.is_active | boolean | required. Returned for confirmation; not editable here |
data.prompt.country_codes | string[] | required. Returned for confirmation; not editable here |
request_id | string | required |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Unknown field, a body with neither field, or a category_id not on this brand |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 403 | insufficient_scope | The key does not carry write:alignment |
| 403 | plan_required | This workspace is not enabled for API writes |
| 404 | not_found | The prompt does not exist or belongs to another brand |
| 429 | rate_limited | Over 60 requests per minute |
Notes
This never spends or frees quota. prompt_text and category_id carry no slot weight. To
change markets or activate/deactivate a prompt — both of which do affect the allowance — use
Update alignment prompt markets instead. That
split mirrors the app exactly: the two fields here go through a plain update, markets and active
state go through the quota-checked path.
country_codes and is_active are read-only here. They come back in the response for
confirmation, unchanged, so a caller can refresh a local cache without a second read.
Nothing re-runs. Editing text or category does not trigger a check. The change is reflected on the next daily alignment run, or an explicit Run alignment check call.
category_id: null uncategorises the prompt. Omit the field to leave the category unchanged;
send null explicitly to clear it.
Idempotency-Key is required. See Idempotency.