Skip to Content
APIEndpointsRename alignment category

Rename alignment category

Renames an alignment category. The slug is re-derived from the new name.

This is a rename only — description is not editable here. The app itself does not offer editing a category’s description after creation, so this endpoint does not either.

Requires the write:alignment scope, and the workspace must be enabled for API writes.

PATCH /v1/brands/{brand_id}/alignment/categories/{category_id}

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
category_iduuidrequiredFrom List alignment categories

Body

application/json

FieldTypeRequiredDescription
namestring, 1-100 charsrequiredIts derived slug must be unique in the brand

Request

curl --request PATCH \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/categories/8f3d2c1b-6a94-4e57-9c02-1b7f4d3a8e65' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \ --header 'Content-Type: application/json' \ --data '{"name": "Pricing and billing"}'

Response

{ "data": { "category": { "id": "8f3d2c1b-6a94-4e57-9c02-1b7f4d3a8e65", "name": "Pricing and billing", "slug": "pricing-and-billing", "description": "Claims about cost, plans and billing.", "sort_order": 0, "is_system": false } }, "request_id": "req_7d21b0af59c34e18b6ac" }

Response fields

The category after the change, in a shape close to what List alignment categories returns — but see Notes.

FieldTypeDescription
data.category.iduuidrequired
data.category.namestringrequired
data.category.slugstringrequired. Re-derived from the new name
data.category.descriptionstring | nullrequired. Unchanged — not editable here
data.category.sort_orderintegerrequired
data.category.is_systembooleanrequired
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestUnknown field, missing name, or name empty / over 100 characters
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 brand does not exist, this key is not allowed to reach it, or category_id does not belong to this brand
409conflictAnother category in this brand already has that name
429rate_limitedOver 60 requests per minute

Notes

active_prompt_count is not returned here. Unlike Create alignment category and List alignment categories, the response object has no active_prompt_count field — a rename does not change which prompts are assigned, so re-fetch List alignment categories if you need the current count.

description cannot be changed here. It is set only at creation time with Create alignment category and is returned unchanged.

Renaming does not move prompts or claims. Everything already assigned to this category stays assigned to it — only name and the derived slug change.

Idempotency-Key is required. See Idempotency.

Last updated on