Skip to Content
APIEndpointsDeactivate prompts

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/deactivate

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 deactivate whole prompts

Request

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

FieldTypeDescription
data.deactivated_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
404not_foundThe brand does not exist, or this key is not allowed to reach it
429rate_limitedOver 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