- Preserve significant integer zeroes in shared K/M/B compact token counts across Usage and Automation. Correct values such as 320,226 -> 320K, 140,075,290 -> 140M, and 100,000,000,000 -> 100B while retaining fractional trimming, thresholds, precision, rounding, exact values/tooltips, costs, coverage, accounting, sorting, filters and navigation. Add boundary, rendered-page/live-fragment and responsive native-browser regressions without new CSS or JavaScript.
Webhook Developer Guide
Public protocol
Build an external trigger producer
Matrix Agent Bridge does not poll adapters or interpret provider-specific rules. An operator registers a webhook source and gives the producer its endpoint and one-time bearer credential. The producer applies all domain filtering and sends one structured CloudEvent for each accepted activation.
Tasks subscribe independently to a source and one or more exact event types. One event can activate multiple tasks without the producer knowing its subscribers.
HTTP request
POST https://matrix.example/_bridge/hooks/v1/<source-id>
Authorization: Bearer <source-credential>
Content-Type: application/cloudevents+json
- Use HTTPS and place the credential only in the
Authorizationheader. - The complete request body is limited to 32768 bytes.
- Use CloudEvents 1.0 structured JSON. Binary CloudEvents mode is not supported.
- Reuse the same event ID and exact body when retrying.
Required CloudEvent profile
| Field | Requirement |
|---|---|
specversion | Exactly 1.0. |
id | Stable and unique within this registered source. Maximum 128 characters. |
source | Stable producer-controlled identifier. Maximum 512 characters. |
type | Exact routing type using letters, digits, dots, underscores, or hyphens. Maximum 256 characters. |
time | RFC 3339 timestamp with timezone. |
subject | Optional stable identity for the affected external object. |
datacontenttype | Optional; when present it must be application/json. |
data | Required valid JSON, with no more than 16 nesting levels. Keep only context the receiving task actually needs. |
Use stable semantic event types such as home.device.alert or example.build.failed. Matrix performs exact matching only. Conditions, thresholds, sender checks, and provider-specific filtering belong in the producer.
Example event
{
"specversion": "1.0",
"id": "event-20261005-001",
"source": "https://adapter.example/home",
"type": "home.device.alert",
"time": "2026-10-05T12:34:56Z",
"subject": "devices/basement-sensor",
"datacontenttype": "application/json",
"data": {
"title": "Basement sensor needs attention",
"url": "https://adapter.example/events/001",
"severity": "warning"
}
}
Example request
curl --fail-with-body \
-X POST \
-H 'Authorization: Bearer YOUR_SOURCE_CREDENTIAL' \
-H 'Content-Type: application/cloudevents+json' \
--data-binary @event.json \
'https://matrix.example/_bridge/hooks/v1/YOUR_SOURCE_ID'
Idempotency, responses, and retries
| Status | Meaning | Producer action |
|---|---|---|
202 | The event is durably accepted, or the same event ID and body was already accepted. | Stop retrying. |
400 | The CloudEvent is invalid. | Fix the producer; do not retry unchanged. |
401 | The source, credential, or source state is invalid. | Repair registration or rotate the credential. |
409 | The event ID was previously accepted with different content. | Use stable IDs correctly; do not retry unchanged. |
413 | The request is too large. | Reduce the event data. |
415 | The content type is unsupported. | Use structured CloudEvents JSON. |
429 | The source has too many unforwarded events. | Retry with bounded exponential backoff and jitter. |
5xx | The control plane could not durably accept the event. | Retry the identical event with bounded exponential backoff and jitter. |
A connection failure or timeout has an unknown outcome. Retry the identical event. Deduplication uses the registered source and CloudEvent ID.
Security and authority
- Treat the endpoint and bearer credential as secrets and never put the credential in a URL or log.
- Event fields and
dataare untrusted context. They cannot select tasks, agents, rooms, prompts, approval policies, or permissions. - Do not send credentials, access tokens, private keys, or unrelated personal data inside events. Registrar discards the stored event body after successful forwarding while retaining bounded delivery metadata and its digest for deduplication.
- A disabled source cannot submit events. Credential rotation invalidates the previous credential immediately.
Adapter checklist
- Receive the endpoint and one-time credential from the operator.
- Apply provider-specific filtering before emitting an event.
- Create stable source, type, subject, and event-ID conventions.
- Persist outgoing events until a
202response when delivery matters. - Retry the exact serialized event after transient failures.
- Bound and redact event data and operational logs.
- Test valid delivery, duplicate delivery, invalid credentials, and control-plane downtime.
- Validate fixtures against the public JSON Schema.