TokenLab

Text

Delete Response

Deletes a stored response. It does not cancel generation.

DELETE
/v1/responses/{id}

Overview

Deletes a stored response by ID. After deletion, the ID can no longer be retrieved or used as previous_response_id.

This is deletion, not cancellation: it does not stop a response that is still running. You can delete only responses created in your own account. An unknown ID, an ID from another account, and an ID that you already deleted all return 404.

Example

Request

cURL
curl -X DELETE "https://api.tokenlab.sh/v1/responses/resp_abc123" \
  -H "Authorization: Bearer sk-your-api-key"

Response example

Response

200 OK
{
  "id": "resp_abc123",
  "object": "response.deleted",
  "deleted": true
}
deletedboolean
true when the response was deleted. Check this field: the value of object can differ by model.

Errors

StatusCodeMeaning
404response_not_foundThe ID is unknown, belongs to another account, or was already deleted.
502upstream_delete_failedTokenLab could not delete the response at the service that produced it. The response is still stored. Retry later.
503upstream_delete_recovery_pendingThe deletion is being reconciled. Do not send it again right away.
503response_state_unavailableThe response state is temporarily unavailable. Retry later.

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Path Parameters

id*string

Response id returned by POST /v1/responses.

Response

application/json

application/json

application/json

application/json