VocalDocscontracts 1.65.0

Create a decision corpus of a question set

POST /v1/agents/{agent_id}/decision-corpora

PropertyValue
Operationcreate_decision_corpus
GroupDecision corpora
Scopeagents:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited decision_corpus.create (mutation)
Released in1.58.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Creates an empty corpus of one question set of the Agent draft's decision at version 1 (1.58.0); a set the draft does not declare is decision_question_set_unknown.

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 POST "$VOCAL_API/v1/agents/agt_.../decision-corpora" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "question_set": "routing", "name": "<name>" }'

Parameters

NameInTypeRequiredDescription
agent_idpathAgentIdyesThe id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: DecisionCorpusCreateRequest.

FieldTypeRequiredDescription
descriptionstringno
namestringyes
question_setQuestionSetKeyyesA question set of the Agent draft's decision (decision_question_set_unknown).

Responses

StatusContent typeShapeError codes
201application/jsonDecisionCorpus
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 201 answer

The shape is DecisionCorpus.

FieldTypeRequiredDescription
agent_idAgentIdyes
archived_atTimestamp or nullyes
case_countintegeryes
created_atTimestampyes
descriptionstring or nullyes
idDecisionCorpusIdyes
namestringyes
object"decision_corpus"yes
question_setQuestionSetKeyyes
revisionintegeryesThe ETag; required in If-Match.
updated_atTimestampyes
versionintegeryesRises by one with each case added or deleted; a run records the version it read.