MailLandDocs

Webhooks

Register webhook endpoints, test them and inspect their deliveries.

/v1/webhooks

GET/v1/webhooks

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Response Body

application/json

curl -X GET "https://example.com/v1/webhooks"
[  {    "id": "string",    "name": null,    "webhookUrl": "string",    "products": [      "string"    ],    "events": [      "string"    ],    "includeFutureEvents": true,    "scope": "string",    "domainIds": [      "string"    ],    "isActive": true,    "createdAt": "2019-08-24T14:15:22Z",    "lastTriggeredAt": null,    "lastSuccessAt": null,    "lastFailureAt": null,    "successCount": 0,    "failureCount": 0,    "consecutiveFailures": 0,    "secretKeyPrefix": null,    "pausedAt": null,    "pausedReason": null,    "pauseThreshold": 0,    "approvedTlsPort": null,    "type": null  }]
POST/v1/webhooks

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/webhooks" \  -H "Content-Type: application/json" \  -d '{    "webhookUrl": "string"  }'
{  "webhook": {    "id": "string",    "name": null,    "webhookUrl": "string",    "products": [      "string"    ],    "events": [      "string"    ],    "includeFutureEvents": true,    "scope": "string",    "domainIds": [      "string"    ],    "isActive": true,    "createdAt": "2019-08-24T14:15:22Z",    "lastTriggeredAt": null,    "lastSuccessAt": null,    "lastFailureAt": null,    "successCount": 0,    "failureCount": 0,    "consecutiveFailures": 0,    "secretKeyPrefix": null,    "pausedAt": null,    "pausedReason": null,    "pauseThreshold": 0,    "approvedTlsPort": null,    "type": null  },  "secret": "string"}

/v1/webhooks/{id}

GET/v1/webhooks/{id}

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/v1/webhooks/string"
{  "recentLogs": [    {      "publicId": "string",      "eventType": "string",      "messageId": null,      "statusCode": 0,      "responseTimeMs": 0,      "success": true,      "errorMessage": null,      "createdAt": "2019-08-24T14:15:22Z",      "attemptNumber": 0    }  ],  "id": "string",  "name": null,  "webhookUrl": "string",  "products": [    "string"  ],  "events": [    "string"  ],  "includeFutureEvents": true,  "scope": "string",  "domainIds": [    "string"  ],  "isActive": true,  "createdAt": "2019-08-24T14:15:22Z",  "lastTriggeredAt": null,  "lastSuccessAt": null,  "lastFailureAt": null,  "successCount": 0,  "failureCount": 0,  "consecutiveFailures": 0,  "secretKeyPrefix": null,  "pausedAt": null,  "pausedReason": null,  "pauseThreshold": 0,  "approvedTlsPort": null,  "type": null}

/v1/webhooks/{id}

PUT/v1/webhooks/{id}

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://example.com/v1/webhooks/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": null,  "webhookUrl": "string",  "products": [    "string"  ],  "events": [    "string"  ],  "includeFutureEvents": true,  "scope": "string",  "domainIds": [    "string"  ],  "isActive": true,  "createdAt": "2019-08-24T14:15:22Z",  "lastTriggeredAt": null,  "lastSuccessAt": null,  "lastFailureAt": null,  "successCount": 0,  "failureCount": 0,  "consecutiveFailures": 0,  "secretKeyPrefix": null,  "pausedAt": null,  "pausedReason": null,  "pauseThreshold": 0,  "approvedTlsPort": null,  "type": null}

/v1/webhooks/{id}

DELETE/v1/webhooks/{id}

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Response Body

curl -X DELETE "https://example.com/v1/webhooks/string"
Empty
POST/v1/webhooks/{id}/regenerate-secret

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/webhooks/string/regenerate-secret"
{  "secretKey": "string"}
POST/v1/webhooks/{id}/resume

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/webhooks/string/resume"
{  "id": "string",  "name": null,  "webhookUrl": "string",  "products": [    "string"  ],  "events": [    "string"  ],  "includeFutureEvents": true,  "scope": "string",  "domainIds": [    "string"  ],  "isActive": true,  "createdAt": "2019-08-24T14:15:22Z",  "lastTriggeredAt": null,  "lastSuccessAt": null,  "lastFailureAt": null,  "successCount": 0,  "failureCount": 0,  "consecutiveFailures": 0,  "secretKeyPrefix": null,  "pausedAt": null,  "pausedReason": null,  "pauseThreshold": 0,  "approvedTlsPort": null,  "type": null}
GET/v1/webhooks/{id}/usage

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/webhooks/string/usage"
{  "webhookId": "string",  "webhookName": null,  "affectedRoutes": [    {      "id": "string",      "name": "string",      "pattern": "string",      "domainName": "string",      "actions": [        "string"      ],      "willBeDisabled": true    }  ],  "routesCount": 0,  "routesToDisable": 0}
POST/v1/webhooks/{id}/test

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/webhooks/string/test"
{  "success": true,  "statusCode": 0,  "statusText": null,  "durationMs": 0,  "responseBody": null,  "errorMessage": null,  "errorType": null,  "headersSent": null,  "wouldReceiveRealEvents": true,  "liveEvents": [    "string"  ],  "dormantEvents": {    "property1": "string",    "property2": "string"  },  "subscriptionWarning": null}
GET/v1/webhooks/{id}/deliveries

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string

Query Parameters

limit?|
Match^-?(?:0|[1-9]\d*)$
Formatint32
Default20
cursor?string
status?string
eventType?string
from?string
Formatdate-time
to?string
Formatdate-time

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/webhooks/string/deliveries"
{  "items": [    {      "publicId": "string",      "eventType": "string",      "messageId": null,      "statusCode": 0,      "responseTimeMs": 0,      "success": true,      "errorMessage": null,      "createdAt": "2019-08-24T14:15:22Z",      "attemptNumber": 0    }  ],  "nextCursor": null,  "hasMore": true}
POST/v1/webhooks/{id}/deliveries/{deliveryId}/retry

Authorization

ApiKey
X-API-Key<token>

Your API key, created in the dashboard under API keys. Production sending keys start with ml_pet_ (transactional) or ml_pem_ (marketing); sandbox keys with ml_set_ or ml_sem_.

In: header

Path Parameters

id*string
deliveryId*string

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/webhooks/string/deliveries/string/retry"
{  "message": "string"}