Skip to Content
APIEndpointsDelete alignment categories

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/categories

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
category_idsuuid[], 1-200requiredFrom List alignment categories
delete_promptsbooleanoptionalAlso delete every prompt in these categories. Default false — prompts become uncategorised instead

Request

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

{ "data": { "deleted_category_ids": ["8f3d2c1b-6a94-4e57-9c02-1b7f4d3a8e65"], "deleted_prompts": false }, "request_id": "req_5c1e93f8a2074b6dbf30" }

Response fields

FieldTypeDescription
data.deleted_category_idsuuid[]required. Same set as category_ids, once every id has been verified to belong to this brand
data.deleted_promptsbooleanrequired. Echoes the delete_prompts you sent (false if omitted)
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestcategory_ids is empty, over 200 entries, or contains an id not found for 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 brand does not exist, or this key is not allowed to reach it
429rate_limitedOver 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.

Last updated on