Skip to Content
APIEndpointsDelete prompts

Delete prompts

Deletes one or more prompts. This mirrors the app exactly: there is no dedicated delete RPC, just a plain delete against the table, and no dry-run preview — the app itself does not offer one either.

There is no soft delete, no archive and no pause, so this is the only way to stop a prompt running.

Bulk-shaped only. There is no single-prompt delete endpoint; send one id for the single-row case.

Requires the write:prompts scope.

DELETE /v1/brands/{brand_id}/prompts

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body

application/json

FieldTypeRequiredDescription
prompt_idsuuid[], 1-200requiredFrom List prompts

Request

curl --request DELETE \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/prompts' \ --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": { "deleted_prompt_ids": ["7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852"] }, "request_id": "req_5c1e93f8a2074b6dbf30" }

Response fields

FieldTypeDescription
data.deleted_prompt_idsuuid[]required. Same set as prompt_ids, once every id has been verified to belong to this brand
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestprompt_ids is empty, over 200 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 deleted unless every id checks out.

Deletion is permanent, and there is no lighter alternative. The app asks for typed confirmation before a bulk delete of 25 prompts or more, precisely because the history goes with them. Over HTTP there is no typing step, so a script deleting in a loop has no friction at all. Build your own check before looping.

Execution history is detached, not deleted. The underlying answer records survive — they simply no longer roll up under a prompt. They still count toward brand-level totals.

Tags and other prompt-scoped rows are cleaned up automatically. Tag assignments and per-prompt analytics referencing a deleted prompt are removed by the database itself; nothing to do on your side.

Last updated on