Deactivate prompts
Deactivates one or more prompts. A deactivated prompt stops running, frees its active-prompt slots and keeps all of its history. Activate it with Activate prompts. This is the same deactivate as the Prompts page in the app.
Requires the write:prompts scope.
POST /v1/brands/{brand_id}/prompts/deactivateAuthorization
| 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 deactivate whole prompts |
Request
cURL
curl --request POST \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/prompts/deactivate' \
--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": {
"deactivated_prompt_ids": ["7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852"],
"unchanged_prompt_ids": []
},
"request_id": "req_5c1e93f8a2074b6dbf30"
}Response fields
| Field | Type | Description |
|---|---|---|
data.deactivated_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 |
| 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
Validation is all-or-nothing. An id that is missing or belongs to another brand refuses the entire call and names every offender. Nothing is deactivated unless every id checks out.
Deactivating never fails on your plan allowance. It only frees slots, so it works even when the workspace is over its limit.
History stays. Answers collected while the prompt was active still count in every report for the days they were collected.
Last updated on