readyDocs Open the app

Email

Send an email to one of your contacts with POST /v1/email-messages, then read your email history. It’s the same key, base URL and envelope as texts: copy a text send, post it to /v1/email-messages and add a subject. Emails go out from the mailboxes you connected in the app, with your business address and an unsubscribe link added at the bottom. A contact who unsubscribed isn’t emailed. Email is available on accounts that have it turned on; on any other account these calls answer 404. Test keys (rsms_test_) can read but can’t send.

#The Email object

idstring
The email’s id. Also returned as message_id. Use it with GET /v1/email-messages/:id.
channelstring
Always email.
directionenum
outbound for what you sent, inbound for a reply.
from, tostring
Email addresses: your mailbox and the contact’s.
subjectstring | null
The subject line.
bodystring
The text you sent, before the footer.
statusenum
queued (not handed to the mailbox’s server yet), sent, bounced (the contact’s server sent it back), failed (refused before it left), unknown (it may have gone; Ready never resends it) or received (a reply from the contact).
error_detailstring | null
Only on failed, bounced and unknown: the server’s explanation.
contact_idinteger | null
The contact it belongs to.
created_at, sent_attimestamp
When it was created and when it was handed to the mailbox’s server.

#Send an email

Sends one email to a contact. Returns the Email object in data.

Parameters

tostring
The email address of one of your contacts. Send this or contact_id, not both. An address no contact has answers 404 contact_not_found: add the contact first.
contact_idinteger
The contact to email, by id.
subjectstringRequired
The subject line.
bodystringRequired
The message, as plain text. Ready adds your business address and an unsubscribe link below it.
fromstring
The address of one of your connected mailboxes. Leave it out and Ready picks one.
Idempotency-Keystring, headerRecommended
Unique per send; reuse only to retry. A retry with the same key returns the first answer and sends nothing more.

Errors

HTTPCodeWhen
400invalid_requestBoth or neither of to and contact_id, or no subject or body.
400invalid_fromfrom isn’t one of your connected mailboxes.
400no_emailThe contact has no email address we can send to, or isn’t on your account.
403recipient_unsubscribedThe contact unsubscribed from email.
403email_pausedSending is paused because too many recent emails bounced.
404contact_not_foundNo contact on your account has that address.
409email_not_connectedNo mailbox is connected on your account.
409business_address_requiredYour business address, which goes in every email’s footer, isn’t on file.
429daily_limit_reachedYour mailboxes sent their daily limit.
502send_unknownWe couldn’t confirm the email left. The answer carries its message_id. Don’t send it again; read it with GET /v1/email-messages/:id.

Every refusal above except send_unknown happened before anything was sent, and isn’t stored under your Idempotency-Key, so you can fix the request and retry with the same key.

#Get an email

One email and its current status. Returns the Email object in data. An id that isn’t an email on your account answers 404 message_not_found.

#List emails

Your account’s sent emails and replies, newest first. Returns a list of Email objects in data, paged with a cursor.

Parameters

directionenum, query
inbound or outbound.
tostring, query
Only emails with this contact address, sent or received.
contact_idinteger, query
Only this contact’s emails.
statusstring, query
queued, sent, bounced, failed, unknown or received. Any other word returns an empty list with a warnings sentence.
limitinteger, queryDefault 50Max 200
Page size.
before_idinteger, query
The next_before_id from the previous page.

Returns

data[]object[]
Email objects.
has_moreboolean
Keep paging while true. It’s true on an exactly full page, so the last page can be empty.
next_before_idstring | null
Pass as before_id for the next page; null on an empty page.

A reply from a contact also fires your inbound_reply webhook, with channel set to email.