LettermintLettermint
  • Knowledge base
  • Community
  • Changelog
  • Support
  • Documentation
  • Sending API
  • Team API
Information
Generic
    Ping the APIget
Team
    Get team detailsgetUpdate team settingsputGet team usage statisticsgetGet team membersget
Domain
    List all domains for the teamgetCreate a new domainpostGet domain detailsgetDelete a domaindeleteVerify all DNS records for a domainpostVerify a specific DNS recordpostUpdate projects associated with a domainput
Project
    List all projects for the teamgetCreate a new projectpostGet project detailsgetUpdate project settingsputDelete a projectdeleteRotate project API tokenpostUpdate project membersputAdd a member to the projectpostRemove a member from the projectdeleteList routes for a projectgetCreate a new routepostGet route detailsgetUpdate route settingsputDelete a routedeleteVerify inbound domain for a routepost
Webhook
    List all webhooks for the teamgetCreate a new webhookpostGet webhook detailsgetUpdate webhook settingsputDelete a webhookdeleteTest a webhook by sending a sample payloadpostRegenerate webhook secretpostGet webhook deliveriesgetGet a specific webhook deliveryget
Message
    List messages for the teamgetGet message detailsgetGet message eventsgetGet message sourcegetGet message HTML contentgetGet message plain text contentget
Suppression
    List all suppressions for the teamgetAdd email(s) to suppression listpostRemove email from suppression listdelete
Stats
    Get message statisticsget
Schemas
Lettermint Team API
Lettermint Team API

Webhook


List all webhooks for the team

GET
https://api.lettermint.co/v1
/webhooks

Returns a paginated list of webhooks with filtering options.

List all webhooks for the team › query Parameters

sort
​string

Available sorts are name, url, created_at. You can sort by multiple options by separating them with a comma. To sort in descending order, use - sign in front of the sort, for example: -name.

Default: -created_at
filter[enabled]
​boolean

Filter by enabled status

filter[event]
​WebhookEvent · enum

Filter by specific event type

Enum values:
message.created
message.sent
message.delivered
message.hard_bounced
message.soft_bounced
message.spam_complaint
message.failed
message.suppressed
filter[route_id]
​string

Filter by route ID

filter[search]
​string

Search by webhook name or URL

List all webhooks for the team › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

List all webhooks for the team › Responses

200

Paginated set of WebhookListData

​WebhookListData[] · required
path
​string | null · required

Base path for paginator generated URLs.

per_page
​integer · min: 0 · required

Number of items shown per page.

next_cursor
​string | null · required

The "cursor" that points to the next set of items.

next_page_url
​string | null · uri · required
prev_cursor
​string | null · required

The "cursor" that points to the previous set of items.

prev_page_url
​string | null · uri · required
GET/webhooks
curl --request GET \ --url https://api.lettermint.co/v1/webhooks \ --header 'Authorization: <string>'
Example Responses
{ "data": [ { "id": "id", "route_id": "route_id", "name": "name", "url": "url", "events": [ "message.created" ], "enabled": true, "last_called_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ], "path": "path", "per_page": 0, "next_cursor": "next_cursor", "next_page_url": "https://www.example.com/path/to/resource", "prev_cursor": "prev_cursor", "prev_page_url": "https://www.example.com/path/to/resource" }
json
application/json

Create a new webhook

POST
https://api.lettermint.co/v1
/webhooks

Creates a webhook for a specific route and generates a secret for signature verification.

Create a new webhook › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Create a new webhook › Request Body

StoreWebhookData
route_id
​string · required
name
​string · maxLength: 255 · required
url
​string · uri · maxLength: 500 · required
events
​WebhookEvent[] · minItems: 1 · required
Enum values:
message.created
message.sent
message.delivered
message.hard_bounced
message.soft_bounced
message.spam_complaint
message.failed
message.suppressed
enabled
​boolean | null
Default: true
include_machine_events
​boolean | null
Default: false

Create a new webhook › Responses

​WebhookData · required
message
​string · const · required
Const value: Webhook created successfully. Please save the secret as it will not be shown again.
POST/webhooks
curl --request POST \ --url https://api.lettermint.co/v1/webhooks \ --header 'Authorization: <string>' \ --header 'Content-Type: application/json' \ --data ' { "route_id": "route_id", "name": "name", "url": "https://www.example.com/path/to/resource", "enabled": true, "include_machine_events": false, "events": [ "message.created" ] } '
Example Request Body
{ "route_id": "route_id", "name": "name", "url": "https://www.example.com/path/to/resource", "enabled": true, "include_machine_events": false, "events": [ "message.created" ] }
json
Example Responses
{ "data": { "id": "id", "route_id": "route_id", "name": "name", "url": "url", "events": [ "string" ], "enabled": true, "include_machine_events": true, "secret": "secret", "last_called_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }, "message": "Webhook created successfully. Please save the secret as it will not be shown again." }
json
application/json

Get webhook details

GET
https://api.lettermint.co/v1
/webhooks/{webhookId}

Returns full webhook information including recent deliveries.

Get webhook details › path Parameters

webhookId
​string · required

Get webhook details › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Get webhook details › Responses

200

WebhookData

WebhookData
id
​string · required
route_id
​string · required
name
​string · required
url
​string · required
events
​string[] · minItems: 1 · required
enabled
​boolean · required
include_machine_events
​boolean · required
last_called_at
​string | null · date-time · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
secret
​string
GET/webhooks/{webhookId}
curl --request GET \ --url https://api.lettermint.co/v1/webhooks/:webhookId \ --header 'Authorization: <string>'
Example Responses
{ "id": "id", "route_id": "route_id", "name": "name", "url": "url", "events": [ "string" ], "enabled": true, "include_machine_events": true, "secret": "secret", "last_called_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Update webhook settings

PUT
https://api.lettermint.co/v1
/webhooks/{webhookId}

Updates webhook configuration. Events, URL, name, and enabled status can be modified.

Update webhook settings › path Parameters

webhookId
​string · required

Update webhook settings › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Update webhook settings › Request Body

UpdateWebhookData
name
​string · maxLength: 255
url
​string · uri · maxLength: 500
enabled
​boolean
include_machine_events
​boolean
events
​WebhookEvent[] · minItems: 1
Enum values:
message.created
message.sent
message.delivered
message.hard_bounced
message.soft_bounced
message.spam_complaint
message.failed
message.suppressed

Update webhook settings › Responses

​WebhookData · required
message
​string · const · required
Const value: Webhook updated successfully.
PUT/webhooks/{webhookId}
curl --request PUT \ --url https://api.lettermint.co/v1/webhooks/:webhookId \ --header 'Authorization: <string>' \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "url": "https://www.example.com/path/to/resource", "enabled": true, "include_machine_events": true, "events": [ "message.created" ] } '
Example Request Body
{ "name": "name", "url": "https://www.example.com/path/to/resource", "enabled": true, "include_machine_events": true, "events": [ "message.created" ] }
json
Example Responses
{ "data": { "id": "id", "route_id": "route_id", "name": "name", "url": "url", "events": [ "string" ], "enabled": true, "include_machine_events": true, "secret": "secret", "last_called_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }, "message": "Webhook updated successfully." }
json
application/json

Delete a webhook

DELETE
https://api.lettermint.co/v1
/webhooks/{webhookId}

Permanently removes a webhook and all associated delivery records.

Delete a webhook › path Parameters

webhookId
​string · required

Delete a webhook › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Delete a webhook › Responses

200
message
​string · const · required
Const value: Webhook deleted successfully.
DELETE/webhooks/{webhookId}
curl --request DELETE \ --url https://api.lettermint.co/v1/webhooks/:webhookId \ --header 'Authorization: <string>'
Example Responses
{ "message": "Webhook deleted successfully." }
json
application/json

Test a webhook by sending a sample payload

POST
https://api.lettermint.co/v1
/webhooks/{webhookId}/test

Dispatches a test webhook delivery to verify the endpoint is working correctly.

Test a webhook by sending a sample payload › path Parameters

webhookId
​string · required

Test a webhook by sending a sample payload › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Test a webhook by sending a sample payload › Responses

200
message
​string · const · required
Const value: Test webhook dispatched successfully. Check the deliveries endpoint for results.
delivery_id
​string · required
POST/webhooks/{webhookId}/test
curl --request POST \ --url https://api.lettermint.co/v1/webhooks/:webhookId/test \ --header 'Authorization: <string>'
Example Responses
{ "message": "Test webhook dispatched successfully. Check the deliveries endpoint for results.", "delivery_id": "delivery_id" }
json
application/json

Regenerate webhook secret

POST
https://api.lettermint.co/v1
/webhooks/{webhookId}/regenerate-secret

Generates a new secret for webhook signature verification. The old secret will be invalidated.

Regenerate webhook secret › path Parameters

webhookId
​string · required

Regenerate webhook secret › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Regenerate webhook secret › Responses

200
​WebhookData · required
message
​string · const · required
Const value: Webhook secret regenerated successfully. Please update your integration.
POST/webhooks/{webhookId}/regenerate-secret
curl --request POST \ --url https://api.lettermint.co/v1/webhooks/:webhookId/regenerate-secret \ --header 'Authorization: <string>'
Example Responses
{ "data": { "id": "id", "route_id": "route_id", "name": "name", "url": "url", "events": [ "string" ], "enabled": true, "include_machine_events": true, "secret": "secret", "last_called_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }, "message": "Webhook secret regenerated successfully. Please update your integration." }
json
application/json

Get webhook deliveries

GET
https://api.lettermint.co/v1
/webhooks/{webhookId}/deliveries

Returns a paginated list of delivery attempts for a specific webhook.

Get webhook deliveries › path Parameters

webhookId
​string · required

Get webhook deliveries › query Parameters

sort
​string

Available sorts are created_at, attempt_number. You can sort by multiple options by separating them with a comma. To sort in descending order, use - sign in front of the sort, for example: -created_at.

Default: -created_at
filter[status]
​WebhookDeliveryStatus · enum

Filter by delivery status

Enum values:
pending
success
failed
client_error
server_error
timeout
filter[event_type]
​string

Filter by event type

filter[from_date]
​string

Filter deliveries from this date (Y-m-d format)

filter[to_date]
​string

Filter deliveries to this date (Y-m-d format)

Get webhook deliveries › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Get webhook deliveries › Responses

200

Paginated set of WebhookDeliveryListData

​WebhookDeliveryListData[] · required
path
​string | null · required

Base path for paginator generated URLs.

per_page
​integer · min: 0 · required

Number of items shown per page.

next_cursor
​string | null · required

The "cursor" that points to the next set of items.

next_page_url
​string | null · uri · required
prev_cursor
​string | null · required

The "cursor" that points to the previous set of items.

prev_page_url
​string | null · uri · required
GET/webhooks/{webhookId}/deliveries
curl --request GET \ --url https://api.lettermint.co/v1/webhooks/:webhookId/deliveries \ --header 'Authorization: <string>'
Example Responses
{ "data": [ { "id": "id", "webhook_id": "webhook_id", "event_type": "message.created", "status": "pending", "attempt_number": 0, "http_status_code": 0, "duration_ms": 0, "delivered_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z" } ], "path": "path", "per_page": 0, "next_cursor": "next_cursor", "next_page_url": "https://www.example.com/path/to/resource", "prev_cursor": "prev_cursor", "prev_page_url": "https://www.example.com/path/to/resource" }
json
application/json

Get a specific webhook delivery

GET
https://api.lettermint.co/v1
/webhooks/{webhookId}/deliveries/{deliveryId}

Returns full details of a single delivery attempt including payload and response data.

Get a specific webhook delivery › path Parameters

webhookId
​string · required
deliveryId
​string · required

Get a specific webhook delivery › Headers

Authorization
​string · required

Bearer token. Format: Bearer {team_token}

Get a specific webhook delivery › Responses

200

WebhookDeliveryData

WebhookDeliveryData
id
​string · required
webhook_id
​string · required
event_type
​WebhookEvent · enum · required
Enum values:
message.created
message.sent
message.delivered
message.hard_bounced
message.soft_bounced
message.spam_complaint
message.failed
message.suppressed
status
​WebhookDeliveryStatus · enum · required
Enum values:
pending
success
failed
client_error
server_error
timeout
attempt_number
​integer · required
http_status_code
​integer | null · required
duration_ms
​integer | null · required
payload
​string[] · minItems: 1 · required
response_body
​string | null · required
response_headers
​array | null · required
error_message
​string | null · required
delivered_at
​string | null · date-time · required
timestamp
​string · date-time · required
GET/webhooks/{webhookId}/deliveries/{deliveryId}
curl --request GET \ --url https://api.lettermint.co/v1/webhooks/:webhookId/deliveries/:deliveryId \ --header 'Authorization: <string>'
Example Responses
{ "id": "id", "webhook_id": "webhook_id", "event_type": "message.created", "status": "pending", "attempt_number": 0, "http_status_code": 0, "duration_ms": 0, "payload": [ "string" ], "response_body": "response_body", "response_headers": [ "string" ], "error_message": "error_message", "delivered_at": "2024-08-25T15:00:00Z", "timestamp": "2024-08-25T15:00:00Z" }
json
application/json

ProjectMessage