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/activateAuthorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Idempotency-Key | string | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
Body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
prompt_ids | uuid[], 1-500 | required | From List prompts |
country_codes | string[], 1-20 | optional | Only 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
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
| Field | Type | Description |
|---|---|---|
data.activated_prompt_ids | uuid[] | required. The prompts this call changed |
data.unchanged_prompt_ids | uuid[] | required. Prompts that were already in that state |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | prompt_ids is empty, over 500 entries, or contains an id not found for this brand |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 403 | insufficient_scope | The key does not carry write:prompts |
| 403 | plan_required | This workspace is not enabled for API writes |
| 403 | quota_exceeded | Activating would exceed your active-prompt allowance. Nothing is activated |
| 404 | not_found | The brand does not exist, or this key is not allowed to reach it |
| 429 | rate_limited | Over 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