Skip to Content
APIEndpointsActivate prompts

Activate prompts

Activates one or more deactivated prompts. Each one uses an active-prompt slot per market again, and activated prompts run again today.

Requires the write:prompts scope.

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

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
prompt_idsuuid[], 1-500requiredFrom List prompts
country_codesstring[], 1-20optionalOnly these markets of the prompts. A prompt tracked in DE, SE and US is one prompt with three markets, one slot each. Omit to activate (every market comes back) whole prompts

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/prompts/activate' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: 5b0e77d2-13a9-4f6a-8ce1-9a3f5e21c0aa' \ --header 'Content-Type: application/json' \ --data '{"prompt_ids": ["7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852"]}'

Response

{ "data": { "activated_prompt_ids": ["7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852"], "unchanged_prompt_ids": [] }, "request_id": "req_5c1e93f8a2074b6dbf30" }

Response fields

FieldTypeDescription
data.activated_prompt_idsuuid[]required. The prompts this call changed
data.unchanged_prompt_idsuuid[]required. Prompts that were already in that state
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestprompt_ids is empty, over 500 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:prompts
403plan_requiredThis workspace is not enabled for API writes
403quota_exceededActivating would exceed your active-prompt allowance. Nothing is activated
404not_foundThe brand does not exist, or this key is not allowed to reach it
429rate_limitedOver 60 requests per minute

Notes

The allowance is checked for the whole request. If activating every deactivated prompt in the call would not fit, none of them is activated. Deactivate or delete other prompts first, or activate fewer.

Validation is all-or-nothing. An id that is missing or belongs to another brand refuses the entire call and names every offender.

Last updated on