Skip to main content
POST
/
v1
/
subscriptions
Create a subscription
curl --request POST \
  --url https://external.pleo.io/v1/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json;charset=UTF-8' \
  --data '
{
  "endpointUrl": "https://example.com/webhook",
  "eventTypes": [
    "v1.export-job.created"
  ],
  "customHeaders": {
    "user": "pass"
  },
  "endpointAuth": {
    "credentials": {
      "password": "password",
      "token": "token",
      "username": "username"
    },
    "type": "NONE"
  },
  "status": "ACTIVE"
}
'
{
  "data": {
    "createdAt": "2022-01-01T00:00:00Z",
    "endpointUrl": "https://example.com/webhook",
    "eventTypes": "v1.export-job.created",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "ACTIVE",
    "updatedAt": "2022-01-10T00:00:00Z",
    "customHeaders": {
      "user": "pass"
    },
    "deletedAt": "2022-01-01T00:00:00Z",
    "deletedBy": "urn:pleo:organisation:12345678-1234-1234-1234-123456789012",
    "endpointAuth": {
      "credentials": {
        "password": "password",
        "token": "token",
        "username": "username"
      },
      "type": "NONE"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json;charset=UTF-8

Create Subscription request

endpointUrl
string
required

The URL where the events should be sent

Example:

"https://example.com/webhook"

eventTypes
string[]
required

Name of the event types you wish to subscribe to. Possible values can be found in the EventType enum.

Name of the event types you wish to subscribe to. Possible values can be found in the EventType enum.

Example:
["v1.export-job.created"]
customHeaders
object

Key values as headers to be sent to the webhooks vendor

Example:
{ "user": "pass" }
endpointAuth
object

Authentication details for the endpoint

status
enum<string>
default:ACTIVE

Status of subscription

Available options:
INACTIVE,
ACTIVE
Example:

"ACTIVE"

Response

A subscription for webhook notification is successfully created.

data
object
required