Skip to Content
APIEndpointsCreate alignment category fact

Create alignment category fact

Creates a fact — a verified statement about the brand that future Brand Alignment runs grade AI-stated claims against, e.g. “Ships to 12 EU countries”. Scope it to a category with category_id, or omit category_id for a brand-wide fact that applies to claims in every category. Matches the “Add fact” action on the Alignment Prompts page, and the claim sheet’s “Add to brand facts” shortcut when category_id is omitted.

Get category ids from List alignment categories.

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

POST /v1/brands/{brand_id}/alignment/category-facts

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Query parameters

None.

Any parameter you pass returns 400 invalid_request naming the offending key.

Body

application/json

FieldTypeRequiredDescription
category_iduuid | nulloptionalScope the fact to this category, from List alignment categories. Omit or send null for a brand-wide fact
fact_textstring, 1–1000 charsrequiredThe verified statement. Cannot be empty
sort_orderintegeroptionalPosition within its scope. Defaults to appended after the last fact in the same category (or the brand-wide group)

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/category-facts' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: <unique-per-attempt>' \ --header 'Content-Type: application/json' \ --data '{"category_id":"b19f3c02-8e41-4b6a-9c17-5d2a781fe346","fact_text":"Enterprise plans include SSO via SAML and OAuth 2.0 at no extra cost."}'

Response

{ "data": { "fact": { "id": "e4a1c8f0-6b39-4d72-8a95-1f0c3e7b4d62", "category_id": "b19f3c02-8e41-4b6a-9c17-5d2a781fe346", "fact_text": "Enterprise plans include SSO via SAML and OAuth 2.0 at no extra cost.", "sort_order": 2, "created_at": "2026-08-30T09:16:47.118Z", "updated_at": "2026-08-30T09:16:47.118Z" } }, "request_id": "req_7d21b0af59c34e18b6ac" }

Response fields

FieldTypeDescription
data.fact.iduuidrequired. Use it as fact_id with Update / Delete alignment category facts
data.fact.category_iduuid | nullrequired. null means brand-wide
data.fact.fact_textstringrequired
data.fact.sort_orderintegerrequired
data.fact.created_attimestamptzrequired
data.fact.updated_attimestamptzrequired
request_idstringrequired. Also returned as the x-request-id header

Errors

StatusCodeWhen
400invalid_requestUnknown field, fact_text empty or over 1000 characters, or sort_order not an integer
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 exist for this brand
429rate_limitedOver 60 requests per minute

Notes

category_id is set once. Update alignment category fact cannot move a fact to a different category afterwards — delete it and create a new one in the category you want instead.

Omit category_id for a brand-wide fact. It is checked against claims in every category, not just one — the same effect as the claim sheet’s “Add to brand facts” shortcut in the app.

sort_order defaults to appended last. Leave it unset and the fact is placed after every existing fact in the same scope (its category, or the brand-wide group); pass a value to insert it somewhere specific.

Idempotency-Key is required. Reuse it when retrying an attempt and the original response is replayed rather than a second fact being created. See Idempotency.

Last updated on