Skip to Content
APIEndpointsList alignment categories

List alignment categories

The brand’s alignment categories — how alignment prompts and claims are grouped, for example “Pricing” or “Support”. Prompts and claims with no category are not represented here; to see them elsewhere, filter for category_id absent rather than looking for an “Uncategorised” row.

Get id from here for the category_id filters on Get alignment, List alignment claims and List alignment prompts.

Requires the read:alignment scope. Managing categories needs write:alignment.

GET /v1/brands/{brand_id}/alignment/categories

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Query parameters

ParameterTypeRequiredDescription
limitintegeroptionalRows per page, 1 to 100. Defaults to 20.
cursorstringoptionalOpaque cursor from the previous response. Treat it as a token, never construct one.

Request

curl --request GET \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/categories?limit=50' \ --header 'Authorization: Bearer <api-key>'

Response

{ "data": [ { "id": "8f3d2c1b-6a94-4e57-9c02-1b7f4d3a8e65", "name": "Pricing", "slug": "pricing", "description": "Claims about cost, plans and billing.", "sort_order": 0, "is_system": false, "active_prompt_count": 6 }, { "id": "2e9a5c17-4f8b-4d31-9a02-6c3f7e1b9d40", "name": "Support", "slug": "support", "description": null, "sort_order": 1, "is_system": true, "active_prompt_count": 3 } ], "pagination": { "limit": 50, "has_more": false, "next_cursor": null }, "request_id": "req_2f7b90c14ae8471da3cd" }

Response fields

FieldTypeDescription
data[].iduuidrequired. Use it as the category_id filter elsewhere, or with Update / Delete alignment category
data[].namestringrequired
data[].slugstringrequired. Derived from the name, unique per brand
data[].descriptionstring | nullrequired
data[].sort_orderintegerrequired. Display order in the app
data[].is_systembooleanrequired. true for a small set of categories seeded automatically; always false for one you create through this API
data[].active_prompt_countintegerrequired. Active alignment prompts currently assigned to this category
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestA parameter is unknown or malformed. The message names it
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 read:alignment
404not_foundThe brand does not exist, or this key is not allowed to reach it
429rate_limitedOver 300 requests per minute

Notes

No category filters here. Unlike most list endpoints, there is nothing to narrow this one by besides pagination — a brand’s category list is small and bounded, so you get all of it.

Uncategorised prompts and claims are invisible to this endpoint. There is no “Uncategorised” row with id: null. On the endpoints that accept a category_id filter, simply omit it to include everything, categorised or not.

active_prompt_count only counts active prompts. A category with prompts that were later deactivated, or with no prompts at all, can legitimately show 0 while still existing.

Last updated on