Skip to Content
APIEndpointsDelete prompt

Delete prompt

Not available yet. Write endpoints are documented ahead of implementation so the contract can be reviewed. No API key can call them today: every key is minted read-only, and a workspace must hold the write entitlement before one can be issued that is not.

Deletes a prompt. This mirrors the app, where removing a single prompt is a one-step action.

There is no soft delete, no archive and no pause, so this is the only way to stop a prompt running, and it takes the per-prompt analytics with it. Call dry_run=true first if the prompt has history worth knowing about.

Requires the write:prompts scope.

DELETE /v1/brands/{brand_id}/prompts/{prompt_id}

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
prompt_iduuidrequiredFrom List prompts

Query parameters

ParameterTypeDefaultDescription
dry_runbooleanfalseReport what would be removed without removing it

Any parameter not listed here returns 400 invalid_request naming the offending key, rather than being ignored silently.

Request

curl --request DELETE \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/prompts/7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: <unique-per-attempt>' \

Response

{ "data": { "id": "7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852", "executions_orphaned": 84, "dry_run": false }, "request_id": "req_5c1e93f8a2074b6dbf30" }

Response fields

FieldTypeDescription
data.iduuidrequired
data.executions_orphanedintegerrequired. Answer records kept, but no longer linked to a prompt
data.dry_runbooleanrequired
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestA parameter is unknown or malformed. The message names it
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
404not_foundThe brand does not exist, or this key is not allowed to reach it. The two are deliberately indistinguishable
429rate_limitedOver 300 requests per minute. See the Retry-After header

Notes

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.

The underlying answer records survive but are detached, which is why executions_orphaned is returned: it tells you how much measured history just lost its label. Those rows still count toward brand-level totals; they simply no longer roll up under a prompt.

Last updated on