Webhook
Last updated: June 22, 2026
A Webhook is a setting that sends an HTTP request to a pre-specified external URL when something happens in a Space (for example, a Content is created or published). You use it for integrating external systems or for automation. For instance, you can configure it to call your internal notification server, or to call an external API, every time a product Content is published.
A Webhook does not stop at sending a request. It can also be configured with WriteBack, which takes the response and writes it back into Content or Media. This is how you build an asynchronous job flow that absorbs the result of an external API into the data inside your Space. A Webhook is a sub-resource of Space in CMA, and its path is based on /spaces/{spaceId}/webhooks.
Resource structure
The following is the single-read response for the Webhook "Product change notification". Along with sys (system properties), it has setting fields such as the delivery target, the subscribed events, and the trigger conditions.
{
"sys": {
"id": "3trmXRM3RqbgSnifyg7PWhk01Examp",
"type": "Webhook",
"space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
"createdBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
"createdAt": "2026-06-18T11:30:00.000Z",
"updatedBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
"updatedAt": "2026-06-18T11:30:00.000Z",
"version": 1
},
"name": "Product change notification",
"filters": [
{ "doc": "sys.contentType.sys.id", "op": "EQ", "value": "3trmXRM3RqbgSnifyg7PAmlxvX4fGY" }
],
"headers": [
{ "key": "X-Source", "value": "weegloo", "secret": false }
],
"httpBasicUsername": "dailywear",
"topics": ["Content.Create", "Content.Publish"],
"transformation": { "method": "POST", "contentType": "application/json", "includeBody": true },
"url": "https://api.dailywear.example/webhooks/products",
"activate": true
}Key properties:
sys.id: The unique identifier of the Webhook. It goes into{webhookId}in the single-read, update, and delete paths.url: The external target URL to call when an event occurs.topics: An array that defines which events to subscribe to. The format is explained in topics below.filters: The conditions that actually trigger the Webhook among the subscribed events. Explained in filters below.transformation: A setting that changes the shape of the outgoing request (method, body, and so on). Explained in transformation below.writeBacks: An array of jobs that take the external response and write it back into Content or Media. It is not present in the example above. Explained in writeBacks below.
System properties (sys)
Every Webhook carries its common system properties in the sys object. space, createdBy, and updatedBy come in the Refer shape ({ "sys": { "id", "type": "Refer", "targetType" } }).
| Property | Type | Description |
|---|---|---|
id | string | The unique identifier of the resource. |
type | string | The kind of resource. For a Webhook it is always "Webhook". |
space | Refer<Space> | The Space this Webhook belongs to. |
createdBy | Refer<User> | The user who created it. |
createdAt | string (date-time) | The creation time. |
updatedBy | Refer<User> | The user who last updated it. |
updatedAt | string (date-time) | The last update time. |
version | integer (≥1) | The resource version. It goes up by 1 on every update. |
A Webhook is a settings resource, so it has no concept of publishing. Unlike Content or Content Type, it has no publishing-state properties such as publish, archive, or status, only a version for change tracking. Turning it on and off is not controlled by publishing but by the body field activate.
Body properties
The body of a Webhook (the setting values you send on create and update, and that come back in the response) is made up of the following fields.
| Field | Type | Required | Description |
|---|---|---|---|
name | string (1-64) | ✅ | The Webhook name. |
url | string (url) | ✅ | The external target URL to call when an event occurs. |
activate | boolean | ✅ | Whether it is on. If false, no request is sent even when an event occurs. |
topics | string[] | ✅ | The array of events to subscribe to. See topics below. |
filters | Filter[] | ✅ | The array of trigger conditions. If empty, every subscribed event triggers. See filters below. |
headers | WebhookHeader[] (0-30) | ✅ | The array of HTTP headers to send with the request. |
httpBasicUsername | string (1-32) | The HTTP Basic authentication username. | |
httpBasicPassword | string (1-32) | The HTTP Basic authentication password. It is write-only. It does not appear in the response. | |
transformation | Transformation | ✅ | Customizes the outgoing request. See transformation below. |
writeBacks | WriteBack[] | The array of write jobs to perform after receiving the response. See writeBacks below. |
Each item in headers is made up of key (required), value (required), and secret (optional, boolean). A header whose secret is true has its value masked in the response. Put values that must not be exposed, such as API keys, in secret: true headers.
topics
Each item in topics has the format {resource}.{action}. For example: Content.Create, Content.Publish, Media.Create.
The action is one of the following, or *, which means all actions of the resource (for example, Content.*).
| Action | Meaning |
|---|---|
All | All actions. |
Create | Creation. |
Read | Reading. |
Edit | Editing. |
Save | Saving (update). The update event is Save. It is not Update. |
Delete | Deletion. |
Publish | Publishing. |
Unpublish | Unpublishing. |
Archive | Archiving. |
Unarchive | Unarchiving. |
filters
filters is an array that narrows down which of the subscribed topics actually trigger the Webhook. Each filter has the following shape.
{ "doc": "sys.contentType.sys.id", "op": "EQ", "value": "3trmXRM3RqbgSnifyg7PAmlxvX4fGY" }doc: The field path to compare. It is one ofsys.id,sys.contentType.sys.id,sys.createdBy.sys.id, orsys.updatedBy.sys.id.op: The comparison operator. It is one ofEQ,NE,IN,NOT_IN,REGEX, orNOT_REGEX.value: The comparison value. Give a string forEQ,NE,REGEX,NOT_REGEX, and an array of strings forIN,NOT_IN.
If you set several filters, all of them must be satisfied to trigger (AND). If you leave filters empty, every event of the subscribed topics triggers.
transformation
transformation changes the shape of the outgoing HTTP request. If you do not specify it, the entire resource payload goes out as-is with the default POST.
| Key | Type | Description |
|---|---|---|
method | string | The HTTP method. One of GET, POST, PUT, DELETE, PATCH. |
contentType | string | The Content-Type of the request body. |
body | object | An object that composes the body to send using JSON Pointer templates. |
includeBody | boolean | Whether to also send the body of the triggering resource. |
writeBacks
writeBacks is an ordered array of jobs that take the external response received by the Webhook and write it back into Content or Media. They run in order only when the external API responds with 2xx. Each item has exactly one of $content (WriteBackContent) or $media (WriteBackMedia).
The keys of WriteBackContent ($content):
| Key | Type | Description |
|---|---|---|
action | string | One of Create, Update, Delete, Publish, Unpublish, Archive, Unarchive. |
contentType | Refer<ContentType> | The Content Type to create on Create. You only need to give sys.id. |
target | string | A JSON Pointer template (for example, { /response/id }) that points to the sys.id of the target Content for Update, Delete, and so on. It must be wrapped in { }; if it is not wrapped, it is treated as a literal. If omitted, the resource that triggered the Webhook is the target. |
locale | string | The locale to write values into on Create and Update. A locale code or a pointer template. If omitted, the Space default locale. |
fields | object | On Create and Update, a map of target field key to source expression. The key is the apiName of the target Content field. |
publish | boolean | Whether to publish after Create or Update. Defaults to true. |
unpublish | boolean | Whether to unpublish before deletion on Delete. Defaults to true. |
The keys of WriteBackMedia ($media):
| Key | Type | Description |
|---|---|---|
action | string | One of Create, Delete, Publish, Unpublish, Archive, Unarchive. |
source | string | The pointer template for the value to bring into Media on Create (for example, { /response/data/0/url }). It must be wrapped in { }. |
encoding | string | How source is interpreted on Create. One of Url, Base64, Binary. |
locale | string | The locale to write the file, title, and description into on Create. If omitted, the Space default locale. |
title | string | The Media title on Create (a source expression or a literal). |
description | string | The Media description on Create. |
target | string | A pointer template that points to the sys.id of the target Media for Delete and so on. If omitted, the triggering resource is the target. |
publish | boolean | Whether to publish after processing completes on Create. Defaults to true. |
unpublish | boolean | Whether to unpublish before deletion on Delete. Defaults to true. |
The following is a writeBacks example that extracts values from the external response JSON and creates one Content.
"writeBacks": [
{
"$content": {
"action": "Create",
"contentType": { "sys": { "id": "3trmXRM3RqbgSnifyg7PAmlxvX4fGY" } },
"locale": "en-US",
"fields": {
"productName": "{ /response/title }",
"price": "{ /response/price }"
},
"publish": true,
"unpublish": true
}
}
]{ /response/... } is a JSON Pointer template that extracts a value from the response JSON received by the Webhook. The keys of fields (productName, price) are the apiName of the target Content fields. The example above fills the response's title into the Content's productName and price into price, then creates and publishes the Content.
API
The base URL for all endpoints below is https://cma.weegloo.com/v1, and the Authorization header needs a Bearer token that authenticates against CMA. Update (PUT) and partial update (PATCH) must also send the X-Weegloo-Version header (the current resource's sys.version) for optimistic concurrency control.
