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
| 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 |
prompt_id | uuid | required | From List prompts |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
dry_run | boolean | false | Report 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
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
200
{
"data": {
"id": "7c2f5a91-3b8e-4d06-9a44-1e7b30c9f852",
"executions_orphaned": 84,
"dry_run": false
},
"request_id": "req_5c1e93f8a2074b6dbf30"
}Response fields
| Field | Type | Description |
|---|---|---|
data.id | uuid | required |
data.executions_orphaned | integer | required. Answer records kept, but no longer linked to a prompt |
data.dry_run | boolean | required |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A parameter is unknown or malformed. The message names it |
| 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 |
| 404 | not_found | The brand does not exist, or this key is not allowed to reach it. The two are deliberately indistinguishable |
| 429 | rate_limited | Over 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.