Update a Trigger subscription
PATCH /v1/trigger-subscriptions/{subscription_id}
| Property | Value |
|---|---|
| Operation | update_trigger_subscription |
| Group | Triggers |
| Scope | integrations:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited integrations.trigger_subscription.update (mutation) |
| Released in | 1.60.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Changes the subscription at the revision If-Match names, checked as a create is; the change applies to the next event (1.60.0).
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 PATCH "$VOCAL_API/v1/trigger-subscriptions/trs_..." \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H 'If-Match: "1"' \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/trigger-subscriptions/trs_...`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'If-Match': '"1"',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import requests
response = requests.patch(
f"{os.environ['VOCAL_API']}/v1/trigger-subscriptions/trs_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"If-Match": '"1"',
},
json={},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
subscription_id | path | TriggerSubscriptionId | yes | The id of a Trigger subscription: trs_ 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. |
Request body
Content type application/json, required: TriggerSubscriptionUpdateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
action | TriggerActionInput | no | |
enabled | boolean | no | |
filter | ZenExpression or null | no | |
name | string | no | |
rate_limit_per_minute | integer | no |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | TriggerSubscription | |
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 | connection_revoked |
412 | application/json | ErrorEnvelope | revision_mismatch |
422 | application/json | ErrorEnvelope | validation_failed, capability_not_available |
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 TriggerSubscription.
| Field | Type | Required | Description |
|---|---|---|---|
action | TriggerAction | yes | |
connection_id | ConnectionId | yes | |
connector_id | ConnectorId | yes | |
created_at | Timestamp | yes | |
enabled | boolean | yes | |
event_type | TriggerEventTypeName | yes | |
filter | ZenExpression or null | yes | A ZEN expression over the event's typed fields; null acts on every event. |
id | TriggerSubscriptionId | yes | |
name | string | yes | |
object | "trigger_subscription" | yes | |
organization_id | OrganizationId | yes | |
previous_token_expires_at | Timestamp or null | no | After 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_minute | integer | yes | |
revision | integer | yes | |
status | TriggerSubscriptionStatus | yes | |
subscription_token | string (password) or null (password) | yes | The 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_hint | string | yes | The last characters of the subscription token. |
updated_at | Timestamp | yes |