Base URL https://mailclanker.com/api/v1. Send Authorization: Bearer pk_live_… with a key from API keys. Keys have scopes: read, write and send.
JSON in and out. Errors are {"error": {"code", "message"}}. Lists take ?limit=…&cursor=… and return {data, next_cursor}. Each key may make 60 requests a minute (429 with Retry-After).
Machine-readable: OpenAPI 3.1 (openapi.json).
curl https://mailclanker.com/api/v1/newsletters \
-H "Authorization: Bearer pk_live_…"
Subscribers
get/api/v1/newsletters/{id}/subscribersscope: read
List subscribers
Newest first. Filters: status, tag, email (exact).
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
| status | "pending" | "active" | "unsubscribed" | "bounced" | "complained" | |
| tag | string | |
| email | string (max 254 chars) | |
| limit | integer (1–100) | Default: 50. |
| cursor | string (max 300 chars) | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/newsletters/{id}/subscribersscope: write
Add a subscriber
Idempotent: 200 with the existing subscriber, 201 when created. Double opt-in follows the newsletter unless double_opt_in is given; skipping it needs the send scope and consent: {source, timestamp} (400 consent_required). Suppressed addresses are 409 suppressed.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body
| Field | Type | Notes |
|---|
| email * | string | |
| first_name | string | null | |
| last_name | string | null | |
| tags | string[] | |
| custom_fields | object | |
| double_opt_in | boolean | |
| consent | object | |
Responses
200 201 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
get/api/v1/subscribers/{id}scope: read
Get a subscriber
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
patch/api/v1/subscribers/{id}scope: write
Update a subscriber
tags replaces the tags; custom_fields is merged (a null value removes a key).
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body
| Field | Type | Notes |
|---|
| first_name | string | null | |
| last_name | string | null | |
| tags | string[] | |
| custom_fields | object | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
delete/api/v1/subscribers/{id}scope: write
Delete a subscriber (GDPR)
Hard delete. A hashed suppression is kept so the address isn't re-added by accident.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/subscribers/{id}/unsubscribescope: write
Unsubscribe a subscriber
Idempotent. Adds a newsletter-level suppression.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
Segments
get/api/v1/newsletters/{id}/segmentsscope: read
List segments
Newest first.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
| limit | integer (1–100) | Default: 50. |
| cursor | string (max 300 chars) | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/newsletters/{id}/segmentsscope: write
Create a segment
rules is {all: [...]} or {any: [...]} with 1–50 conditions {field, op, value}: tag has/not_has; created_at, confirmed_at, last_opened_at, last_clicked_at before/after (ISO date) or within_days/not_within_days (1–3650) or exists/not_exists; email, first_name, last_name text operators; status, source eq/neq; custom.<field>.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body
| Field | Type | Notes |
|---|
| name * | string (max 100 chars) | |
| rules * | object | |
Responses
201 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
get/api/v1/segments/{id}scope: read
Get a segment
Includes subscriber_count: active, non-suppressed subscribers it matches now.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
patch/api/v1/segments/{id}scope: write
Update a segment
Rename it or replace its rules. Changing the rules while a scheduled send (or one waiting for approval) uses it is 409 segment_in_use.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body
| Field | Type | Notes |
|---|
| name | string (max 100 chars) | |
| rules | object | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
delete/api/v1/segments/{id}scope: write
Delete a segment
Drafts and past sends that used it go back to all active subscribers. Refused with 409 segment_in_use while a scheduled send (or one waiting for approval) uses it.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
Posts
get/api/v1/newsletters/{id}/postsscope: read
List posts
Newest first, without content. Filter by status.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "cancelled" | "failed" | |
| limit | integer (1–100) | Default: 50. |
| cursor | string (max 300 chars) | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/newsletters/{id}/postsscope: write
Create a draft
Content as content_markdown (with ::button[Label](url) and ::embed[Title](url "thumbnail") blocks) or content_json (TipTap JSON), not both.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body
| Field | Type | Notes |
|---|
| title * | string | |
| slug | string | |
| subject * | string | |
| preview_text | string | |
| content_markdown | string | |
| content_json | any | |
| segment_id | string (uuid) | null | |
| publish_to_web | boolean | |
Responses
201 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
get/api/v1/posts/{id}scope: read
Get a post
Includes content (JSON and Markdown), the latest pre-send check and stats totals.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
patch/api/v1/posts/{id}scope: write
Update a draft
Drafts only (409 not_draft). Optional revision refuses the update if the post changed since (409 revision_conflict). Any edit cancels an open send approval request.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body
| Field | Type | Notes |
|---|
| title | string | |
| slug | string | |
| subject | string | |
| preview_text | string | |
| content_markdown | string | |
| content_json | any | |
| segment_id | string (uuid) | null | |
| publish_to_web | boolean | |
| revision | integer | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/posts/{id}/precheckscope: write
Run the pre-send check
Rules plus, when AI is configured, an AI check (20 credits). Unchanged content returns the stored result without charging again.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
402 Not enough credits (insufficient_credits)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
503 A dependency isn't configured or available
post/api/v1/posts/{id}/testscope: write
Send a test email
Workspace members' addresses only. Max 5 per request, 50 per workspace per day.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body
| Field | Type | Notes |
|---|
| emails * | string[] | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
502 The email provider failed (provider_error)
post/api/v1/posts/{id}/schedulescope: send
Schedule or send now
Omit send_at (or the body) to send now. Reserves one credit per recipient. Posts written via MCP need a human approval first (403 approval_required).
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Request body (optional)
| Field | Type | Notes |
|---|
| send_at | string (date-time) | null | |
Responses
200 400 Invalid input (validation_error, invalid_json, …)
401 Missing, invalid or revoked API key (unauthorized)
402 Not enough credits (insufficient_credits)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/posts/{id}/pausescope: send
Pause a send
Scheduled or sending → paused.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/posts/{id}/resumescope: send
Resume a send
Paused → scheduled/sending. Safety pauses can only be resumed by the owner in the dashboard.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/posts/{id}/cancelscope: send
Cancel a send
Scheduled, sending or paused → cancelled; unsent messages are skipped and unused credits refunded.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
409 Conflict with the current state (see error.code)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
get/api/v1/posts/{id}/statsscope: read
Get post stats
Totals, rates and clicks per link. Opens are approximate.
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/posts/{id}/publishscope: write
Publish to the web archive
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After
post/api/v1/posts/{id}/unpublishscope: write
Remove from the web archive
Parameters
| Field | Type | Notes |
|---|
| id (path) * | string (uuid) | |
Responses
200 401 Missing, invalid or revoked API key (unauthorized)
403 Missing scope (insufficient_scope), account status or approval required
404 Not found in this workspace (not_found)
429 Rate limited (60 requests/minute per key, or a daily quota); see Retry-After