Delete a case of a decision corpus
DELETE /v1/agents/{agent_id}/decision-corpora/{corpus_id}/cases/{case_id}
| Property | Value |
|---|---|
| Operation | delete_decision_case |
| Group | Decision corpora |
| Scope | agents:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited decision_case.delete (mutation) |
| Released in | 1.58.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Deletes the case at the corpus revision If-Match names and raises the corpus's version and revision (1.58.0); earlier runs keep their results.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the agents:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X DELETE "$VOCAL_API/v1/agents/agt_.../decision-corpora/dcp_.../cases/dcs_..." \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H 'If-Match: "1"'const response = await fetch(`${process.env.VOCAL_API}/v1/agents/agt_.../decision-corpora/dcp_.../cases/dcs_...`, {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'If-Match': '"1"',
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.delete(
f"{os.environ['VOCAL_API']}/v1/agents/agt_.../decision-corpora/dcp_.../cases/dcs_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"If-Match": '"1"',
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | AgentId | yes | The id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
corpus_id | path | DecisionCorpusId | yes | The id of a decision corpus: dcp_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
case_id | path | DecisionCaseId | yes | The id of one case of a decision corpus: dcs_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
if-match | header | string | yes | The revision the change was made against, quoted as the ETag returns it, or * to overwrite. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | DecisionCaseDeletion | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | decision_corpus_archived |
412 | application/json | ErrorEnvelope | revision_mismatch |
428 | application/json | ErrorEnvelope | precondition_required |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is DecisionCaseDeletion.
| Field | Type | Required | Description |
|---|---|---|---|
corpus_version | integer | yes | The corpus's version after the deletion. |
deleted_at | Timestamp | yes | |
id | DecisionCaseId | yes | |
object | "decision_case_deletion" | yes |