Archive a decision corpus
DELETE /v1/agents/{agent_id}/decision-corpora/{corpus_id}
| Property | Value |
|---|---|
| Operation | archive_decision_corpus |
| Group | Decision corpora |
| Scope | agents:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited decision_corpus.archive (mutation) |
| Released in | 1.58.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Archives the corpus (1.58.0): its cases and runs stay readable, and a later write or run answers 409 decision_corpus_archived; archiving it again answers it as it stands.
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_..." \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H 'If-Match: "1"'const response = await fetch(`${process.env.VOCAL_API}/v1/agents/agt_.../decision-corpora/dcp_...`, {
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_...",
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. |
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 | DecisionCorpus | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
412 | application/json | ErrorEnvelope | revision_mismatch |
422 | application/json | ErrorEnvelope | validation_failed |
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 DecisionCorpus.
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | AgentId | yes | |
archived_at | Timestamp or null | yes | |
case_count | integer | yes | |
created_at | Timestamp | yes | |
description | string or null | yes | |
id | DecisionCorpusId | yes | |
name | string | yes | |
object | "decision_corpus" | yes | |
question_set | QuestionSetKey | yes | |
revision | integer | yes | The ETag; required in If-Match. |
updated_at | Timestamp | yes | |
version | integer | yes | Rises by one with each case added or deleted; a run records the version it read. |