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
| 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 |
category_id | uuid | required | From List alignment categories |
Body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
name | string, 1-100 chars | required | Its derived slug must be unique in the brand |
Request
cURL
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
200
{
"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.
| Field | Type | Description |
|---|---|---|
data.category.id | uuid | required |
data.category.name | string | required |
data.category.slug | string | required. Re-derived from the new name |
data.category.description | string | null | required. Unchanged — not editable here |
data.category.sort_order | integer | required |
data.category.is_system | boolean | required |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Unknown field, missing name, or name empty / over 100 characters |
| 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 brand does not exist, this key is not allowed to reach it, or category_id does not belong to this brand |
| 409 | conflict | Another category in this brand already has that name |
| 429 | rate_limited | Over 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.