API Reference
Unsubscribes
Manage global and list-level unsubscribes so addresses are excluded from sends.
The unsubscribe list records addresses that should not receive email. A record with no list_id is a global unsubscribe; a record with a list_id suppresses the address only for that mailing list. Sendry checks this list before sending.
List unsubscribes
GET /v1/unsubscribes
Requires read_only scope. Results are ordered by created_at, newest first.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Results per page (1-100). |
cursor | string | Pagination cursor from the previous response's next_cursor. | |
email | string | Filter by email address. | |
list_id | string | Filter by mailing list ID. |
Response
{
"data": [
{
"id": "unsub_abc123",
"email": "user@example.com",
"list_id": "newsletter",
"reason": "manual",
"created_at": "2025-03-12T09:00:00Z"
}
],
"has_more": false,
"next_cursor": null
}
Add to unsubscribe list
POST /v1/unsubscribes
Requires sending_access scope. Inserting an address that is already unsubscribed is a no-op.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address to unsubscribe. |
list_id | string | No | Mailing list identifier for a list-level unsubscribe. Null means global. |
reason | string | No | Reason for unsubscribing. Defaults to manual. |
Example request
{
"email": "user@example.com",
"list_id": "newsletter",
"reason": "no longer interested"
}
Response
{
"id": "unsub_abc123",
"email": "user@example.com",
"list_id": "newsletter",
"reason": "no longer interested",
"created_at": "2025-03-12T09:00:00Z"
}
Batch add to unsubscribe list
POST /v1/unsubscribes/batch
Requires sending_access scope. Accepts up to 1,000 addresses at a time.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
emails | string[] | Yes | Email addresses to unsubscribe (1-1000 items). |
list_id | string | No | Mailing list identifier applied to every address. |
reason | string | No | Reason applied to every address. Defaults to manual. |
Example request
{
"emails": ["user@example.com", "other@example.com"],
"list_id": "newsletter",
"reason": "batch import"
}
Response
{
"inserted": 2
}
Get unsubscribe record
GET /v1/unsubscribes/:id
Requires read_only scope.
Response
{
"id": "unsub_abc123",
"email": "user@example.com",
"list_id": "newsletter",
"reason": "manual",
"created_at": "2025-03-12T09:00:00Z"
}
Remove from unsubscribe list
DELETE /v1/unsubscribes/:id
Requires sending_access scope. Removing a record lets future sends reach the address again.
Response
{
"deleted": true
}