Skip to Content
APIEndpointsUpdate alignment prompt

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

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
prompt_iduuidrequiredFrom List alignment prompts

Query parameters

None.

Body

application/json. At least one field is required.

FieldTypeRequiredDescription
prompt_textstring, 1–500 charsoptionalThe question to check
category_iduuid | nulloptionalFrom List alignment categories. null to uncategorise. Must be a category on the same brand

Request

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

{ "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.

FieldTypeDescription
data.prompt.iduuidrequired
data.prompt.brand_iduuidrequired
data.prompt.category_iduuid | nullrequired
data.prompt.prompt_textstringrequired
data.prompt.is_activebooleanrequired. Returned for confirmation; not editable here
data.prompt.country_codesstring[]required. Returned for confirmation; not editable here
request_idstringrequired

Errors

StatusCodeWhen
400invalid_requestUnknown field, a body with neither field, or a category_id not on this brand
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
403insufficient_scopeThe key does not carry write:alignment
403plan_requiredThis workspace is not enabled for API writes
404not_foundThe prompt does not exist or belongs to another brand
429rate_limitedOver 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.

Last updated on