Delete alignment categories
Deletes one or more alignment categories. By default their prompts survive and become
uncategorised, matching “Delete” without the checkbox in the app; pass delete_prompts: true to
also delete every prompt in those categories, matching the dialog’s “Also delete all prompts”
checkbox.
delete_prompts applies to the whole batch — there is no per-category choice in one call.
Bulk-shaped only. There is no single-category delete endpoint; send one id for the single-row case.
Requires the write:alignment scope, and the workspace must be enabled for API writes.
DELETE /v1/brands/{brand_id}/alignment/categoriesAuthorization
| 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 |
Body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
category_ids | uuid[], 1-200 | required | From List alignment categories |
delete_prompts | boolean | optional | Also delete every prompt in these categories. Default false — prompts become uncategorised instead |
Request
cURL
curl --request DELETE \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/categories' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \
--header 'Content-Type: application/json' \
--data '{"category_ids": ["8f3d2c1b-6a94-4e57-9c02-1b7f4d3a8e65"], "delete_prompts": false}'Response
200
{
"data": {
"deleted_category_ids": ["8f3d2c1b-6a94-4e57-9c02-1b7f4d3a8e65"],
"deleted_prompts": false
},
"request_id": "req_5c1e93f8a2074b6dbf30"
}Response fields
| Field | Type | Description |
|---|---|---|
data.deleted_category_ids | uuid[] | required. Same set as category_ids, once every id has been verified to belong to this brand |
data.deleted_prompts | boolean | required. Echoes the delete_prompts you sent (false if omitted) |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | category_ids is empty, over 200 entries, or contains an id not found for 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 brand does not exist, or this key is not allowed to reach it |
| 429 | rate_limited | Over 60 requests per minute |
Notes
Validation is all-or-nothing. An id that is missing or belongs to another brand refuses the entire call and names every offender — nothing is deleted unless every id checks out.
delete_prompts: false (the default) does not touch prompts. They survive and become
uncategorised — their category_id is set to null, they stay active, and they keep running.
This does not change your active-prompt quota usage.
delete_prompts: true deletes the categories’ prompts first, then the categories, matching the
app’s own two-step exactly. This is permanent: their execution history is detached, not deleted,
the same as Delete alignment prompts.
One flag for the whole batch. If you need delete_prompts: true for some categories and
false for others, split the call into two requests.
Idempotency-Key is required. Reuse it when retrying an attempt and the original response is
replayed rather than a second delete being attempted. See Idempotency.