Skip to Content
APIEndpointsCreate alignment prompt

Create alignment prompt

Adds a question to run for brand alignment checks. Matches “Add Prompts → Single Prompt” on the Alignment Prompts page. Defaults to the US market when no country_codes are given, and consumes one alignment-prompt slot per market.

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

POST /v1/brands/{brand_id}/alignment/prompts

This spends quota, but does not run immediately. Unlike Create prompt, creating an alignment prompt does not trigger a run. It is picked up by the next daily alignment check (04:00 UTC), or you can trigger one yourself with Run alignment check. The slot is consumed the moment this call succeeds either way.

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
prompt_textstring, 1–500 charsrequiredThe question to check
category_iduuid | nulloptionalFrom List alignment categories. Leave unset for uncategorised
country_codesstring[], up to 20optionalMarkets to check this prompt in. Defaults to ["US"]. Each one consumes a slot

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/prompts' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: a3f5e921-c0aa-47b1-90d2-6b8e4c07a9d4' \ --header 'Content-Type: application/json' \ --data '{"prompt_text":"Does the brand offer a free trial?","category_id":"9d1f3a52-6b8e-4c07-a9d4-2e8b41f5c9a3","country_codes":["US","SE"]}'

Response

{ "data": { "prompt": { "id": "a17c9e42-6b3d-4f18-9a05-2d7e84c1b9f6", "brand_id": "242546de-4cee-4a7d-952e-f6aa60c63ef8", "category_id": "9d1f3a52-6b8e-4c07-a9d4-2e8b41f5c9a3", "prompt_text": "Does the brand offer a free trial?", "is_active": true, "country_codes": ["US", "SE"] } }, "request_id": "req_3a71be29c44d85b6ce0f" }

Response fields

FieldTypeDescription
data.prompt.iduuidrequired. Use it with List alignment prompts
data.prompt.brand_iduuidrequired
data.prompt.category_iduuid | nullrequired
data.prompt.prompt_textstringrequired
data.prompt.is_activebooleanrequired. Always true on creation
data.prompt.country_codesstring[]required. The markets actually used, after defaulting
request_idstringrequired. Also returned as the x-request-id header

Errors

StatusCodeWhen
400invalid_requestUnknown field, missing or over-long prompt_text, a bad country code, over 20 country_codes, or a category_id not on 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
403quota_exceededThe request would exceed your alignment-prompt allowance. Nothing is created
404not_foundThe brand does not exist, or this key is not allowed to reach it
429rate_limitedOver 60 requests per minute
503service_unavailableYour allowance could not be checked. Nothing is created. Retry shortly

Notes

Quota is per market, not per prompt, and it is a separate allowance from regular prompts. This endpoint spends alignment_prompts slots, not active_prompts — the two plan limits are tracked independently, so having room on one says nothing about the other. A prompt targeting three countries takes three slots, checked as one call before anything is written.

An empty country_codes array is not the same as omitting the field, but has the same effect. [] is accepted, not rejected, and the brand still defaults to ["US"]. Omit the field entirely if you mean the default.

Nothing runs until the next check. Creating the prompt reserves its slot immediately, but the question is only asked on the next daily alignment run (04:00 UTC) or an explicit Run alignment check call. Reading it back right away shows no claims yet — that is expected.

Duplicate text is not rejected. Unlike Create prompt, there is no uniqueness check on prompt_text here — the same question can exist twice for a brand.

If the allowance cannot be checked, nothing is created. A 503 here means the check itself was unavailable and we refused rather than guessing. Retry; it is transient.

Idempotency-Key is required. Reuse it when retrying and the original response is replayed rather than a second prompt being created and a second slot spent. See Idempotency.

Last updated on