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

NameDescription
Zeplin-Webhook-IdA unique ID assigned to your webhook.
Zeplin-Delivery-IdA unique ID assigned to the webhook payload, this doesn’t change when Zeplin retries a webhook.
Zeplin-Delivery-TimestampA UNIX timestamp that denotes the time when Zeplin sent the payload
Zeplin-Attempt-NumberThe number of delivery attempts made for the payload to this webhook.
Zeplin-SignatureA signature created using the secret configure for this webhook.
Zeplin-Versionv1.0 (Zeplin API version)
User-AgentZeplin-Webhooks
Content-Typeapplication/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:

NameTypeDescription
eventStringType of the event (e.g., "project.screen.version", etc.)
actionStringAction of the event (e.g., "created", "update", etc.)
timestampNumberA UNIX timestamp that denotes the time when the change happened
resourceObjectThe 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.idString"5ed05ecf3356a7967b21f12b"
resouce.typeStringType of object, which is one of the API models (e.g. "ScreenVersion").
resource.dataObject (optional)JSON object whose type is specified in resource.type.
contextObject (optional)Additional objects which are related to the main object.

The content of this object varies between event types.
(e.g., { project: { ... }, screen: { ... } })
actorObjectContains 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": { ... }
  }
}

What’s Next