SmakeSmake API Docs
EndpointsWebhooks

Create a webhook

POST
/webhooks

Creates a webhook endpoint that listens to one or more of the available events.

Warning: You can create up to 10 webhooks per event.

Attributes

FieldTypeDescriptionRequired
urlstringThe URL to listen for incoming POST notification containing event information.yes
tokenstringA token to secure your url.
versionstringThe version in which the information should be transformed to. Default: current api version
descriptionjsonA json object of localized description.
statestringState of the endpoint (see below). Default: inactive
eventsarrayAn array of Event Objects (see below).yes

States

nameDefault
inactiveyes
active

Event Object

FieldTypeDescriptionRequired
namestringThe internal nameyes
AuthorizationbearerAuth

Authorization

bearerAuth
AuthorizationBearer <token>

API token as bearer token — you receive a test and a live token, there is no switch between them. See Setup → Authentication and Setup → Test mode.

In: header

Header Parameters

Accept*"application/json"

The API only responds with JSON — this header is mandatory on every request (see Setup → Headers).

Default"application/json"

Value in

  • "application/json"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Attributes for creating a webhook — see Create a webhook.

Response Body

application/json

application/json

application/json

Request example
curl -X POST "https://example.com/webhooks" \  -H "Accept: application/json" \  -H "Content-Type: application/json" \  -d '{    "url": "https://requestb.in/1hd29kc1",    "token": "my-secret-token",    "description": {      "en": "This is a description"    },    "state": "active",    "events": [      {        "name": "order.completed"      }    ]  }'
{  "id": 2,  "description": {    "en": "This is a description"  },  "version": "2022-02-01",  "state": "active",  "url": "https://requestb.in/1hd29kc1",  "events": [    {      "id": 3,      "name": "order.completed"    }  ],  "created_at": "2022-02-01T00:00:00+00:00",  "updated_at": "2022-02-01T00:00:00+00:00"}