VocalDocscontracts 1.65.0

Request a reveal grant

POST /v1/reveal-grants

PropertyValue
Operationcreate_reveal_grant
GroupCapture windows and reveal grants
Scopereveal_grants:write
Route classcontrol
IdempotencyIdempotency-Key required: a retry with the same key replays the first answer
AuditAudited reveal_grant.request (mutation)
Released in1.57.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Requests a time-boxed right to read named content classes of named Calls, or of one Agent's Calls in a window (1.57.0). Under the Compliance profile's reveal_approval: none the grant is active at once and emits content.reveal_granted; under required it is pending until another owner or auditor approves it. A class the requester's role is denied is refused with validation_failed and the issue class_not_revealable; a Call of another Organization is not found; a grant for vocal_support by a Member who is not an owner is forbidden with the detail owner_required.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the reveal_grants:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/reveal-grants" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "classes": [
      "transcripts"
    ],
    "reason": "<reason>"
  }'

Parameters

NameInTypeRequiredDescription
idempotency-keyheaderstringyesA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: RevealGrantCreateRequest.

FieldTypeRequiredDescription
agent_idAgentIdnoOne Agent's Calls, with window_from and window_to; instead of call_ids.
call_idsarray of CallIdnoUp to 20 Calls (a target), each once.
classesarray of ContentLogClassyesThe content classes the grant reveals, each once.
duration_minutesintegernoHow long the grant stays active once active: 60 minutes when absent, at most 240 (targets).
granteeRevealGranteeno
reasonstringyesWhy the content is needed, for the access review: free text that can quote a caller, stored as a content pair and scrubbed at retention_days.
window_fromRequestTimestampnoThe start of the window of the Agent scope: Calls created at or after it.
window_toRequestTimestampnoThe end of the window: Calls created before it; at most 24 hours (a target) after window_from.

Responses

StatusContent typeShapeError codes
201application/jsonRevealGrant
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 RevealGrant.

FieldTypeRequiredDescription
agent_idAgentId or nullyes
approval_requiredbooleanyesTrue when the profile required a second approver at the request.
call_idsarray or nullyesThe named Calls; null for an Agent scope.
classesarray of ContentLogClassyes
created_atTimestampyes
decided_atTimestamp or nullyes
decided_byMemberId or nullyesThe approver or decliner; null under reveal_approval: none.
duration_minutesintegeryes
expires_atTimestamp or nullyesWhen an active grant ends; for a pending grant, when the request lapses.
granteeRevealGranteeyes
idRevealGrantIdyes
object"reveal_grant"yes
reasonstring or nullnoWhy the content is needed, for the access review: free text that can quote a caller, stored as a content pair and scrubbed at retention_days. Answered only by GET /v1/reveal-grants/{reveal_grant_id}, an audited content read; null once scrubbed.
requested_byMemberIdyes
revoked_atTimestamp or nullyes
revoked_byMemberId or nullyes
starts_atTimestamp or nullyesWhen the grant became active; null until then.
statusRevealGrantStatusyes
window_fromTimestamp or nullyes
window_toTimestamp or nullyes