VocalDocscontracts 1.65.0

Rotate a Trigger subscription's token

POST /v1/trigger-subscriptions/{subscription_id}/rotate-token

PropertyValue
Operationrotate_trigger_subscription_token
GroupTriggers
Scopeintegrations:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited integrations.trigger_subscription.rotate_token (mutation)
Released in1.61.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Issues a new token for the edge path and answers the subscription with it, once, at the revision If-Match names (1.61.0; integrations-operations.md section 3). The previous token keeps verifying until previous_token_expires_at, 24 hours later (a target), so the vendor's webhook can be moved without losing an event; the de-duplication key does not change, because the run-log key keys it. Writes an Audit event naming the subscription, never a token.

Request

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

curl -X POST "$VOCAL_API/v1/trigger-subscriptions/trs_.../rotate-token" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -H "Idempotency-Key: $(uuidgen)"

Parameters

NameInTypeRequiredDescription
subscription_idpathTriggerSubscriptionIdyesThe id of a Trigger subscription: trs_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Responses

StatusContent typeShapeError codes
200application/jsonTriggerSubscription
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeconnection_revoked, idempotency_in_progress, idempotency_key_reused
412application/jsonErrorEnveloperevision_mismatch
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is TriggerSubscription.

FieldTypeRequiredDescription
actionTriggerActionyes
connection_idConnectionIdyes
connector_idConnectorIdyes
created_atTimestampyes
enabledbooleanyes
event_typeTriggerEventTypeNameyes
filterZenExpression or nullyesA ZEN expression over the event's typed fields; null acts on every event.
idTriggerSubscriptionIdyes
namestringyes
object"trigger_subscription"yes
organization_idOrganizationIdyes
previous_token_expires_atTimestamp or nullnoAfter a token rotation (1.61.0), when the previous token stops verifying, 24 hours later (a target); null otherwise, absent from an api before 1.61.0.
rate_limit_per_minuteintegeryes
revisionintegeryes
statusTriggerSubscriptionStatusyes
subscription_tokenstring (password) or null (password)yesThe token of the edge path /v1/triggers/{connector_id}/{subscription_token}, 32 random bytes in base64url: answered once by the create, null in every other answer.
token_hintstringyesThe last characters of the subscription token.
updated_atTimestampyes