Update an event filter
PATCH /v1/event-filters/{filter_id}
| Property | Value |
|---|---|
| Operation | update_event_filter |
| Group | Events |
| Scope | webhooks:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited webhooks.event_filter.update (mutation) |
| Released in | 1.52.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Replaces the named fields at the revision If-Match names (1.52.0); the next event the relay matches reads the new values, and an open stream connection keeps the values it read when it opened. Every issue is a detail of 422 validation_failed (EventFilterIssueCode): event_filter_empty when every selecting field is empty and event_filter_value_repeated for a value named twice.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the webhooks:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X PATCH "$VOCAL_API/v1/event-filters/evf_..." \
-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/event-filters/evf_...`, {
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/event-filters/evf_...",
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 |
|---|---|---|---|---|
filter_id | path | EventFilterId | yes | The id of an event filter: evf_ 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: EventFilterUpdateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
agent_ids | array of AgentId | no | Events whose Call, or Agent version, belongs to one of these Agents. |
environments | array of Environment | no | The environments to match; empty matches both, as livemode stays in the envelope. |
name | string | no | |
phone_number_ids | array of PhoneNumberId | no | Events of Calls on one of these Phone numbers. |
tags | array of CallTag | no | Events of Calls carrying any of these tags, which a pre-call hook sets. |
trace_types | array of TraceEventType | no | The trace types a call.trace.ready keeps; empty keeps every one. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | EventFilter | |
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 EventFilter.
| Field | Type | Required | Description |
|---|---|---|---|
agent_ids | array of AgentId | yes | Events whose Call, or Agent version, belongs to one of these Agents. |
created_at | Timestamp | yes | |
environments | array of Environment | yes | The environments to match; empty matches both, as livemode stays in the envelope. |
id | EventFilterId | yes | |
name | string | yes | |
object | "event_filter" | yes | |
phone_number_ids | array of PhoneNumberId | yes | Events of Calls on one of these Phone numbers. |
revision | integer | yes | Counts writes; returned as the ETag and required in If-Match. |
tags | array of CallTag | yes | Events of Calls carrying any of these tags, which a pre-call hook sets. |
trace_types | array of TraceEventType | yes | The trace types a call.trace.ready keeps; empty keeps every one. |
updated_at | Timestamp | yes |