Receiving Webhook Events
When a webhook event that you've subscribed to occurs, Zeplin sends a POST request to your webhook endpoint with the details of the event.
Event payload
The payload of the POST request contains special headers and a JSON body for the event details.
Payload headers
Name | Description |
---|---|
Zeplin-Webhook-Id | A unique ID assigned to your webhook. |
Zeplin-Delivery-Id | A unique ID assigned to the webhook payload, this doesn’t change when Zeplin retries a webhook. |
Zeplin-Delivery-Timestamp | A UNIX timestamp that denotes the time when Zeplin sent the payload |
Zeplin-Attempt-Number | The number of delivery attempts made for the payload to this webhook. |
Zeplin-Signature | A signature created using the secret configure for this webhook. |
Zeplin-Version | v1.0 (Zeplin API version) |
User-Agent | Zeplin-Webhooks |
Content-Type | application/json |
Payload body
The body of a webhook payload is a JSON object that describes the event and the resource(s) it's related. The JSON object contains fields in the following table:
Name | Type | Description |
---|---|---|
event | String | Type of the event (e.g., "project.screen.version" , etc.) |
action | String | Action of the event (e.g., "created" , "update" , etc.) |
timestamp | Number | A UNIX timestamp that denotes the time when the change happened |
resource | Object | The main object that this event is related. It contains the ID of the object along with its type and content. The content of this object varies between event types. |
resource.id | String | "5ed05ecf3356a7967b21f12b" |
resouce.type | String | Type of object, which is one of the API models (e.g. "ScreenVersion" ). |
resource.data | Object (optional) | JSON object whose type is specified in resource.type . |
context | Object (optional) | Additional objects which are related to the main object. The content of this object varies between event types. (e.g., { project: { ... }, screen: { ... } } ) |
actor | Object | Contains the user object who’s made change triggering this event.{ user: { … } } |
Example request payload
POST /zeplin HTTP/1.1
Host: hookie.mistake.io
Zeplin-Webhook-Id: 5ed06014edbbf246dd7dbe0e
Zeplin-Delivery-Id: 490e4ba675f843d5a10e0baacdb8
Zeplin-Delivery-Timestamp: 1590714485
Zeplin-Attempt-Number: 1
Zeplin-Signature: 66b1132a0173910b01ee3a15ef4e69583bbf2f7f1e4462c99efbe1b9ab5bf808
Zeplin-Version: v1.0
User-Agent: Zeplin-Webhooks
Content-Type: application/json
Content-Length: 3416
{
"event": "project.screen.version",
"action": "created",
"timestamp": 1590624000
"resource": {
"id": "5ed0610239707fea3f06903f",
"type": "VersionSummary",
"data": { ... }
},
"context": {
"project": { ... },
"screen": { ... }
}
"actor" : {
"user": { ... }
}
}
Updated over 4 years ago