Skip to Content
APIEndpointsAdd alignment suggestion

Add alignment suggestion

Stages one hand-written alignment prompt into an existing generation run, so it sits alongside the AI-generated suggestions in that batch and is decided through the same accept, reject and edit endpoints. The run must already exist — start one with Generate alignment suggestions first.

Provide category_id to target an existing category, or category_name to propose a brand-new one — it is only materialized into a real category if the suggestion is later accepted. Provide neither to leave it uncategorised. Never provide both.

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

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

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
request_iduuidrequiredThe generation batch to add into, from Generate alignment suggestions
suggested_promptstring, 1-500 charsrequired
country_codesstring[], 1-20requiredMarkets for the prompt
category_iduuidoptionalAn existing category, from List alignment categories. Mutually exclusive with category_name
category_namestring, up to 100 charsoptionalPropose a brand-new category. Mutually exclusive with category_id
category_slugstring, up to 100 charsoptionalOnly used alongside category_name; derived from it if omitted

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/alignment/suggestions' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \ --header 'Content-Type: application/json' \ --data '{"request_id": "7f3ab21c-9e4d-4b8a-8f1a-2c9d6e4b7a30", "suggested_prompt": "Does this brand publish a signed sustainability report?", "country_codes": ["US"], "category_name": "Sustainability claims"}'

Response

{ "data": { "suggestion": { "id": "e4a2c8f0-6b1d-4a9e-9c3f-1d8b5a2e7f60", "brand_id": "242546de-4cee-4a7d-952e-f6aa60c63ef8", "workspace_id": "6b2e0a94-7c1f-4b3d-9e8a-1a2c9d6e4b70", "request_id": "7f3ab21c-9e4d-4b8a-8f1a-2c9d6e4b7a30", "suggested_prompt": "Does this brand publish a signed sustainability report?", "language": "en", "country_codes": ["US"], "proposed_category_name": "Sustainability claims", "proposed_category_slug": "sustainability-claims", "proposed_category_description": null, "category_id": null, "agent_reasoning": null, "status": "proposed", "promoted_to_prompt_id": null, "rejected_reason": null, "created_at": "2026-08-30T09:20:11.402Z" } }, "request_id": "req_7d21b0af59c34e18b6ac" }

Response fields

FieldTypeDescription
data.suggestion.iduuidrequired. Use it with Accept / Reject / Edit alignment suggestions
data.suggestion.brand_iduuidrequired
data.suggestion.workspace_iduuidrequired
data.suggestion.request_iduuidrequired. The generation batch this was added into
data.suggestion.suggested_promptstringrequired
data.suggestion.languagestringrequired. Inherited from the run, else the brand’s prompt language, else en — not settable on this endpoint
data.suggestion.country_codesstring[]required
data.suggestion.proposed_category_namestring | nullEchoes category_name when given
data.suggestion.proposed_category_slugstring | nullThe slug the new category will get if accepted
data.suggestion.proposed_category_descriptionstring | null
data.suggestion.category_iduuid | nullEchoes category_id when given
data.suggestion.agent_reasoningstring | nullAlways null here — reasoning is only set for AI-generated suggestions
data.suggestion.statusstringrequired. Always proposed
data.suggestion.promoted_to_prompt_iduuid | nullAlways null here
data.suggestion.rejected_reasonstring | nullAlways null here
data.suggestion.created_attimestamptzrequired
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestUnknown field, a missing required field, both category_id and category_name provided, category_id not found for this brand, category_name did not resolve to a valid slug, or this run already holds the maximum number of suggestions
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 request_id does not exist for this brand
409conflictsuggested_prompt already exists in this generation run, or this brand already tracks an active alignment prompt with that text
429rate_limitedOver 60 requests per minute

Notes

category_id and category_name are mutually exclusive. Sending both refuses the call. Sending neither leaves the suggestion uncategorised.

A proposed category is not created yet. category_name only stages a proposal — Accept alignment suggestions is what resolves it to an existing category with the same slug or creates a new one, the first time a suggestion using that slug is accepted. An abandoned run never leaves an orphan category behind.

category_slug only matters with category_name. It is ignored if category_id is set, and derived from category_name if omitted.

Duplicate detection runs against both the run and live prompts. 409 conflict fires if suggested_prompt normalizes to the same text as another non-rejected suggestion already in this run, or as an existing active alignment prompt on this brand.

Last updated on