CherryMail
Skip to documentation
Developersv1
Search the CherryMail developer documentation
Developers/Get started
Get started

Your first API request

Go from an API key to your first request, then send an email from a mailbox you control.

Developer preview
The API is gated while gateway acceptance is completed. Until access is enabled, requests return 503 integrations_disabled. These examples describe the enabled API.
1

Create a credential

Open Account → Integrations. Authorize the mailboxes you need, then create a REST API credential with the required permissions and selected mailboxes.

Copy the secret when it appears. It is shown once. Save it as a server environment variable and keep it outside source control.

Set your API key
export CHERRYMAIL_API_KEY='your-cm_rest_-credential'
2

Make your first request

Retrieve your account with read permission. All endpoints use the base URL https://cherrymail.net/api/v1 and a Bearer authorization header.

Example request
curl 'https://cherrymail.net/api/v1/account/' \
  -H "Authorization: Bearer $CHERRYMAIL_API_KEY"

Successful JSON responses wrap the result in data and include a request_id for troubleshooting.

3

Send an email

Use a credential with send permission and a current grant for the selected mailbox. Replace 123 with your mailbox ID. The sender must match the granted mailbox identity.

Example request
curl -X POST 'https://cherrymail.net/api/v1/mailboxes/123/send/' \
  -H "Authorization: Bearer $CHERRYMAIL_API_KEY" \
  -H "Idempotency-Key: example-request-1042" \
  -H "Content-Type: application/json" \
  -d '{
  "to": [
    "recipient@example.com"
  ],
  "subject": "Hello from CherryMail",
  "text": "Your first email, sent with the CherryMail API."
}'

Use a unique Idempotency-Key for each intentional submission. Reuse the same key and unchanged request when checking a retry.

Track the result

Creation and change requests return a durable operation_id. Retrieve the operation to follow its state and result.

Accepted is different from delivered
An SMTP submission receipt means the mail server accepted the message. It does not prove delivery. If a submission is uncertain, inspect its operation receipt before taking further action. A new idempotency key could send another email.
Next upAuthentication & permissions