Language:

/webhook

POST

Create Webhook

To create a webhook on a given instance, the user must have the following permissions on the instance:

  • Admin
  • Owner
  • Developer

Body params:

field namerequiredtypedescription
scopedResourceyesstringScoped Resource refers to the service in which to listen in on webhooks.
parentResourceZUIDnostringRefers to a specific parent resource's ZUID.
resourceyesstringRefers to the ZUID or the name of a resource.
eventActionyesnumberThe action on the resource which will trigger the webhook.
methodyesstringThe HTTP request method that is made by the webhook.
URLyesstringDestination URL for the webhook to send payload to.
contentTypeyesstringThe value used to set the HTTP header Content-type for the webhook request
authorizationnostringThe Bearer token value used to set the HTTP header Auhorization.
bodyyesJSONThe payload body being sent to the destination URL.

Possible values for scopedResource are:

  • an instance ZUID
  • accounts

parentResourceZUID

If scopedResource is an instance ZUID, possible values for parentResourceZUID are:

  • content model ZUID

If scopedResource is accounts, possible values for parentResourceZUID are:

  • instance ZUID

resource

If scopedResource is an instance ZUID, possible values for resource are:

  • models
  • items
  • publishings
  • fields
  • headtags
  • views
  • stylesheets
  • scripts
  • redirects
  • langs
  • leads
    or its corresponding ZUIDs

If scopedResource is accounts, possible values for resource are:

  • instances
  • users
  • invites
  • roles
  • granulars
  • domains
    or its corresponding ZUIDs

Possible Values for eventAction

  • Create: 1
  • Update: 2
  • Delete: 3
  • Publish: 4
  • Unpublish: 5
  • UndoDelete: 6

Note: After a successful item publishing, if the item's unpublishAt (Go Offline) value was not set to "never", meaning it has a date value in the future, both eventAction 4 and 5 will be triggered at the same time.

Possible Values for method

  • POST
  • GET

Possible Values for contentType

  • application/json
  • application/x-www-form-urlencoded
Please sign in to view your instance’s unique identifier

URL Endpoint

https://accounts.api.zesty.io/v1/webhooks
Please sign in to view your token

Authentication Header

Bearer YOUR_APP_SID 

Request Body

{
	"scopedResource": "{{instance_zuid}}",
	"parentResourceZUID": "{{content_model_zuid}}",
	"resource": "items",
	"eventAction": 1,
	"method": "GET",
	"URL": "{{webhook_url}}",
	"contentType": "application/json",
	"body": {
        "text":" this is the body"
    }
}
GET

Retrieve Webhook

Please sign in to view your instance’s unique identifier

URL Endpoint

https://accounts.api.zesty.io/v1/webhooks/{{webhook_zuid}}
Please sign in to view your token

Authentication Header

Bearer YOUR_APP_SID 
GET

Retreive Webhooks for an Instance

Get multiple webhooks for a given instance. To retrieve webhooks, user must have the following permissions for the given instance:

  • Admin
  • Owner
  • Developer
Please sign in to view your instance’s unique identifier

URL Endpoint

https://accounts.api.zesty.io/v1/instances/8-xxxxxxxxx/webhooks/
Please sign in to view your token

Authentication Header

Bearer YOUR_APP_SID 
DELETE

Delete Webhook

Deletes a single webhook. To delete a webhook for a given instance, the user must have the following permissions on the instance:

  • Admin
  • Owner
  • Developer
Please sign in to view your instance’s unique identifier

URL Endpoint

https://accounts.api.zesty.io/v1/webhooks/{{webhook_zuid}}
Please sign in to view your token

Authentication Header

Bearer YOUR_APP_SID 

;