API reference

Base URL: https://api.sendfern.com. Authenticate with Authorization: Bearer sk_live_... (or sk_test_...). JSON in and out; lists return {data, has_more, next}, newest first. Machine-readable: /v1/openapi.json.

Emails

post/v1/emails

Send an email

Parameters
Idempotency-KeyheaderSame key + same body within 24 h replays the first response.
Body (SendEmail)
from *string
to *string or string[]One address or a list. 'Name <a@b.com>' allowed.
ccstring or string[]One address or a list. 'Name <a@b.com>' allowed.
bccstring or string[]One address or a list. 'Name <a@b.com>' allowed.
reply_tostring or string[]One address or a list. 'Name <a@b.com>' allowed.
subjectstringRequired unless template_id is used. No CR/LF.
htmlstring
textstring
headersobjectCustom headers; envelope headers are refused.
tagsobjectUp to 10.
attachmentsobject[]7 MB decoded in total.
scheduled_atstring (date-time)Up to 30 days ahead.
template_idstring
variablesobject
Returns 201 with Email.
get/v1/emails

List emails, newest first

Parameters
limitqueryinteger
statusquerystring
toquerystring
tagquerystring
broadcast_idquerystring
created_afterquerystring
created_beforequerystring
qquerystring
Returns 200 with object.
post/v1/emails/batch

Send up to 100 emails (all-or-nothing validation)

Parameters
Idempotency-KeyheaderSame key + same body within 24 h replays the first response.
Body (SendEmail[])

SendEmail[]

Returns 201 with object.
get/v1/emails/{id}

An email with its html, text and events

Parameters
id *pathstring
Returns 200 with Email.
post/v1/emails/{id}/cancel

Cancel a scheduled email

Parameters
id *pathstring
Returns 200 with Email.
post/v1/emails/{id}/resend

Send a copy now (not for broadcast emails)

Parameters
id *pathstring
Returns 201 with Email.
get/v1/stats

Counts and rates by day (up to 90 days)

Parameters
fromquerystring
toquerystring
intervalquerystring
broadcast_idquerystring
tagquerystring
Returns 200 with Stats.
get/v1/usage

Live emails this month against the quota

Returns 200 with Usage.

Templates

get/v1/templates

List templates

Parameters
limitqueryinteger
Returns 200 with object.
post/v1/templates

Create a template

Body (Template)
idstring
namestring
subjectstring
htmlstring
textstring
variablesstring[]
created_atstring (date-time)
updated_atstring (date-time)
Returns 201 with Template.
get/v1/templates/{id}

A template

Parameters
id *pathstring
Returns 200 with Template.
put/v1/templates/{id}

Replace a template

Parameters
id *pathstring
Body (Template)
idstring
namestring
subjectstring
htmlstring
textstring
variablesstring[]
created_atstring (date-time)
updated_atstring (date-time)
Returns 200 with Template.
patch/v1/templates/{id}

Change a template

Parameters
id *pathstring
Body (Template)
idstring
namestring
subjectstring
htmlstring
textstring
variablesstring[]
created_atstring (date-time)
updated_atstring (date-time)
Returns 200 with Template.
delete/v1/templates/{id}

Delete a template

Parameters
id *pathstring
Returns 204.
post/v1/templates/{id}/render

Render with variables (missing ones stay as written)

Parameters
id *pathstring
Body (object)
variablesobject
Returns 200 with object.

Domains

get/v1/domains

List domains

Parameters
limitqueryinteger
Returns 200 with object.
post/v1/domains

Add a domain; returns its DNS records

Body (object)
name *string
Returns 201 with Domain.
get/v1/domains/{id}

A domain

Parameters
id *pathstring
Returns 200 with Domain.
patch/v1/domains/{id}

Open/click tracking and the tracking domain

Parameters
id *pathstring
Body (object)
track_opensboolean
track_clicksboolean
tracking_domainstring
Returns 200 with Domain.
delete/v1/domains/{id}

Remove a domain

Parameters
id *pathstring
Returns 204.
post/v1/domains/{id}/verify

Check the DNS records now

Parameters
id *pathstring
Returns 200 with Domain.

API keys

get/v1/api-keys

List keys (test mode: test keys only)

Parameters
limitqueryinteger
Returns 200 with object.
post/v1/api-keys

Create a key (dashboard session only; the token is shown once)

Body (object)
name *string
mode"live" | "test"
permission"full" | "send_only"
Returns 201 with ApiKey.
delete/v1/api-keys/{id}

Revoke a key

Parameters
id *pathstring
Returns 204.

Suppressions

get/v1/suppressions

List suppressed addresses

Parameters
limitqueryinteger
emailquerystring
Returns 200 with object.
post/v1/suppressions

Suppress an address

Body (object)
email *string
Returns 201 with Suppression.
delete/v1/suppressions/{id}

Remove a suppression

Parameters
id *pathstring
Returns 204.

Webhooks

get/v1/webhooks

List endpoints

Parameters
limitqueryinteger
Returns 200 with object.
post/v1/webhooks

Add an endpoint (the secret is shown once)

Body (object)
url *string
eventsstring[]
enabledboolean
Returns 201 with Webhook.
get/v1/webhooks/{id}

An endpoint

Parameters
id *pathstring
Returns 200 with Webhook.
put/v1/webhooks/{id}

Replace an endpoint

Parameters
id *pathstring
Body (Webhook)
idstring
urlstring
eventsstring[]
enabledboolean
created_atstring (date-time)
secretstringOnly in the response to create.
Returns 200 with Webhook.
patch/v1/webhooks/{id}

Change an endpoint

Parameters
id *pathstring
Body (Webhook)
idstring
urlstring
eventsstring[]
enabledboolean
created_atstring (date-time)
secretstringOnly in the response to create.
Returns 200 with Webhook.
delete/v1/webhooks/{id}

Delete an endpoint

Parameters
id *pathstring
Returns 204.
get/v1/webhooks/{id}/deliveries

Delivery log, newest first

Parameters
id *pathstring
limitqueryinteger
Returns 200 with object.
post/v1/webhooks/{id}/test

Send a test event now

Parameters
id *pathstring
Returns 201 with WebhookDelivery.
post/v1/webhooks/{id}/deliveries/{delivery_id}/retry

One more attempt for a failed delivery

Parameters
id *pathstring
delivery_id *pathstring
Returns 200 with WebhookDelivery.

Audiences

get/v1/audiences

List audiences

Parameters
limitqueryinteger
Returns 200 with object.
post/v1/audiences

Create an audience

Body (object)
name *string
Returns 201 with Audience.
get/v1/audiences/{id}

An audience

Parameters
id *pathstring
Returns 200 with Audience.
put/v1/audiences/{id}

Rename an audience

Parameters
id *pathstring
Body (object)
name *string
Returns 200 with Audience.
patch/v1/audiences/{id}

Rename an audience

Parameters
id *pathstring
Body (object)
namestring
Returns 200 with Audience.
delete/v1/audiences/{id}

Delete an audience and its contacts (not if it has broadcasts)

Parameters
id *pathstring
Returns 204.
get/v1/audiences/{id}/contacts

List an audience's contacts

Parameters
id *pathstring
limitqueryinteger
emailquerystring
statusquerystring
Returns 200 with object.
post/v1/audiences/{id}/contacts

Add or update a contact (by email)

Parameters
id *pathstring
Body (object)
email *string
first_namestring
last_namestring
unsubscribedboolean
Returns 201 with Contact.
post/v1/audiences/{id}/contacts/import

Import a CSV (multipart, field 'file')

Parameters
id *pathstring
Returns 200 with object.
get/v1/contacts/{id}

A contact

Parameters
id *pathstring
Returns 200 with Contact.
put/v1/contacts/{id}

Replace a contact

Parameters
id *pathstring
Body (Contact)
idstring
emailstring
first_namestring
last_namestring
unsubscribedboolean
created_atstring (date-time)
Returns 200 with Contact.
patch/v1/contacts/{id}

Change a contact

Parameters
id *pathstring
Body (Contact)
idstring
emailstring
first_namestring
last_namestring
unsubscribedboolean
created_atstring (date-time)
Returns 200 with Contact.
delete/v1/contacts/{id}

Delete a contact

Parameters
id *pathstring
Returns 204.

Broadcasts

get/v1/broadcasts

List broadcasts (your key's mode)

Parameters
limitqueryinteger
statusquerystring
audience_idquerystring
qquerystring
Returns 200 with object.
post/v1/broadcasts

Create a draft

Body (Broadcast)
idstring
namestring
audience_idstring
fromstring
reply_tostring[]
subjectstring
preview_textstring
blocksobject[]Builder blocks (null = raw html). With blocks, html/text are rendered.
htmlstring
textstring
status"draft" | "scheduled" | "sending" | "sent"
scheduled_atstring | null (date-time)
errorstring
recipient_countinteger
sent_atstring | null (date-time)
created_atstring (date-time)
statsobjectOn GET {id} only.
Returns 201 with Broadcast.
get/v1/broadcasts/{id}

A broadcast, with stats

Parameters
id *pathstring
Returns 200 with Broadcast.
put/v1/broadcasts/{id}

Replace a draft

Parameters
id *pathstring
Body (Broadcast)
idstring
namestring
audience_idstring
fromstring
reply_tostring[]
subjectstring
preview_textstring
blocksobject[]Builder blocks (null = raw html). With blocks, html/text are rendered.
htmlstring
textstring
status"draft" | "scheduled" | "sending" | "sent"
scheduled_atstring | null (date-time)
errorstring
recipient_countinteger
sent_atstring | null (date-time)
created_atstring (date-time)
statsobjectOn GET {id} only.
Returns 200 with Broadcast.
patch/v1/broadcasts/{id}

Change a draft

Parameters
id *pathstring
Body (Broadcast)
idstring
namestring
audience_idstring
fromstring
reply_tostring[]
subjectstring
preview_textstring
blocksobject[]Builder blocks (null = raw html). With blocks, html/text are rendered.
htmlstring
textstring
status"draft" | "scheduled" | "sending" | "sent"
scheduled_atstring | null (date-time)
errorstring
recipient_countinteger
sent_atstring | null (date-time)
created_atstring (date-time)
statsobjectOn GET {id} only.
Returns 200 with Broadcast.
delete/v1/broadcasts/{id}

Delete a broadcast

Parameters
id *pathstring
Returns 204.
post/v1/broadcasts/{id}/checks

The Before-you-send checks and recipient count

Parameters
id *pathstring
Returns 200 with object.
post/v1/broadcasts/{id}/send

Send now, or schedule (up to 30 days)

Parameters
id *pathstring
Body (object)
scheduled_atstring (date-time)
Returns 200 with Broadcast.
post/v1/broadcasts/{id}/cancel

A scheduled broadcast back to draft

Parameters
id *pathstring
Returns 200 with Broadcast.
post/v1/broadcasts/{id}/test

One test copy with sample values

Parameters
id *pathstring
Body (object)
to *string
Returns 201 with Email.
post/v1/assets

Upload an image for image blocks (multipart 'file', PNG/JPEG/GIF, 2 MB)

Returns 201 with object.

Objects

Email

idstring
objectobject
mode"live" | "test"
status"queued" | "scheduled" | "sending" | "sent" | "delivered" | "bounced" | "complained" | "failed" | "canceled" | "suppressed"
fromstring
tostring[]
ccstring[]
bccstring[]
reply_tostring[]
subjectstring
tagsobject
broadcast_idstring | null
errorstring | null
scheduled_atstring | null (date-time)
sent_atstring | null (date-time)
created_atstring (date-time)

Domain

idstring
namestring
status"pending" | "verified" | "failed"
regionstring
recordsobject[]
track_opensboolean
track_clicksboolean
tracking_domainstring
verified_atstring | null (date-time)
created_atstring (date-time)

ApiKey

idstring
namestring
mode"live" | "test"
permission"full" | "send_only"
prefixstring
last_used_atstring | null (date-time)
created_atstring (date-time)

Template

idstring
namestring
subjectstring
htmlstring
textstring
variablesstring[]
created_atstring (date-time)
updated_atstring (date-time)

Suppression

idstring
emailstring
reason"bounce" | "complaint" | "manual"
created_atstring (date-time)

Webhook

idstring
urlstring
eventsstring[]
enabledboolean
created_atstring (date-time)
secretstringOnly in the response to create.

WebhookDelivery

idstring
event_typestring
status"pending" | "succeeded" | "failed"
attemptsinteger
response_codeinteger | null
last_errorstring
payloadobject
testboolean
created_atstring (date-time)

Audience

idstring
namestring
contact_countinteger
subscribed_countinteger
created_atstring (date-time)

Contact

idstring
emailstring
first_namestring
last_namestring
unsubscribedboolean
created_atstring (date-time)

Broadcast

idstring
namestring
audience_idstring
fromstring
reply_tostring[]
subjectstring
preview_textstring
blocksobject[]Builder blocks (null = raw html). With blocks, html/text are rendered.
htmlstring
textstring
status"draft" | "scheduled" | "sending" | "sent"
scheduled_atstring | null (date-time)
errorstring
recipient_countinteger
sent_atstring | null (date-time)
created_atstring (date-time)
statsobjectOn GET {id} only.

Stats

totalsobject
seriesobject[]

Usage

period_startstring (date)
period_endstring (date)
usedinteger
quotainteger | null