OptimoCMSDocs

Webhooks

Webhook subscriptions and deliveries

GET
/v1/sites/{siteId}/webhooks

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/webhooks"
{
  "data": [
    {
      "id": "string",
      "url": "http://example.com",
      "events": [
        "page.created"
      ],
      "secret": "string",
      "active": true,
      "createdBy": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "failCount": 0,
      "lastDeliveredAt": "2019-08-24T14:15:22Z"
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
POST
/v1/sites/{siteId}/webhooks

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/sites/string/webhooks" \  -H "Content-Type: application/json" \  -d '{    "url": "http://example.com",    "events": [      "page.created"    ]  }'
{
  "data": {
    "id": "string",
    "url": "http://example.com",
    "events": [
      "page.created"
    ],
    "secret": "string",
    "active": true,
    "createdBy": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "failCount": 0,
    "lastDeliveredAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/webhooks/{webhookId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
webhookId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/webhooks/string"
{
  "data": {
    "id": "string",
    "url": "http://example.com",
    "events": [
      "page.created"
    ],
    "secret": "string",
    "active": true,
    "createdBy": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "failCount": 0,
    "lastDeliveredAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
PATCH
/v1/sites/{siteId}/webhooks/{webhookId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
webhookId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/sites/string/webhooks/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "data": {
    "id": "string",
    "url": "http://example.com",
    "events": [
      "page.created"
    ],
    "secret": "string",
    "active": true,
    "createdBy": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "failCount": 0,
    "lastDeliveredAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
DELETE
/v1/sites/{siteId}/webhooks/{webhookId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
webhookId*string

Response Body

application/json

curl -X DELETE "https://example.com/v1/sites/string/webhooks/string"
{
  "data": {
    "id": "string",
    "deleted": true
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
POST
/v1/sites/{siteId}/webhooks/{webhookId}/replay

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
webhookId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/sites/string/webhooks/string/replay" \  -H "Content-Type: application/json" \  -d '{    "since": "2019-08-24T14:15:22Z"  }'
{
  "data": {
    "webhookId": "string",
    "replayed": 0,
    "eventIds": [
      "string"
    ]
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/webhooks/{webhookId}/deliveries

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
webhookId*string

Query Parameters

limit?integer
Default25
Rangevalue <= 100
cursor?string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/webhooks/string/deliveries"
{
  "data": [
    {
      "id": "string",
      "eventId": "string",
      "webhookId": "string",
      "event": "string",
      "url": "string",
      "attempt": 0,
      "statusCode": 0,
      "success": true,
      "error": "string",
      "durationMs": 0,
      "deliveredAt": "2019-08-24T14:15:22Z"
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  },
  "pagination": {
    "total": 0,
    "limit": 0,
    "nextCursor": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}