Skip to content

Endpoints

The endpoints are available under two base urls:

  • https://{your_lime_app_url}/{your_lime_app}/api/v1/subscription/
  • https://{your_lime_app_url}/{your_lime_app}/api/v2/subscription/

Both versions expose the same endpoints and operate on the same subscriptions. The only difference is the signature version given to a subscription created through them: version 1 signs the body, version 2 signs the delivery id, the delivery timestamp and the body. See securing webhooks.

Responses from both versions include signature_version. It is not read from request bodies and cannot be changed with an update. A server without the version 2 API answers 404 on /api/v2/subscription/.

List available subscriptions

GET: /subscription/available/

List current subscriptions

GET: /subscription/

Create a subscription

POST: /subscription/

Request body:

{
    "events" : ["company.new"],
    "target_url" : "https://example.org/hook/123" 
}

Optionally a secret can be added. The secret is used to sign the deliveries of a webhook.

{
    "events" : ["company.new"],
    "target_url" : "https://example.org/hook/123",
    "secret": "SuperSecret123"
}

A subscription created through /api/v1/subscription/ gets signature_version v1, one created through /api/v2/subscription/ gets v2.

Updates a subscription

PUT: /subscription/:id

Request body:

{
    "events" : ["company.new"],
    "target_url" : "https://example.org/hook/123" 
}

id and signature_version cannot be changed. To change the signature version, delete the subscription and create it again through the other API version.

Shows a subscription

GET: /subscription/:id

Response body:

{
    "id" : 1,
    "events" : ["company.new"],
    "target_url" : "https://example.org/hook/123",
    "enabled": true,
    "signature_version": "v2"
}

Deletes a subscription

DELETE: /subscription/:id