Receive Emails

Read emails with the API

Read the emails that arrive on your domain from your own code. List conversations, open messages, search, label, organize, send and reply, all through one endpoint.

  • REST
  • JSON
  • Threads and search
  • Labels and folders
  • Send and reply
Hosthttps://g.sendcorex.com

How it works

One token, one mailbox

Your token belongs to a sender, and a sender is a mailbox. No argument picks whose emails you read: the token decides.

One endpoint for everything

List, read, search, flag, move, send and reply are commands sent to POST /v1. Send up to 20 per request.

Short-lived tokens

The access token lasts 1 hour and the refresh token 15 days. The refresh token rotates every time you use it.

Set up your mailbox

Do these once. After that, every request only needs your token.

  1. 1

    Add a domain, or use a shared one

    Verify your own domain, or skip the DNS work and use a shared domain.

  2. 2

    Create a sender

    A sender is a mailbox. Create one on your verified domain or on a shared domain: on a shared domain, creating the sender creates the mailbox.

    If you registered your own domain and already sent an email, the sender was created for you automatically.

  3. 3

    Point your MX record

    Only needed if you want to receive email on your own domain. Point the MX record to the Sendcorex inbound host.

  4. 4

    Generate your tokens

    Open the webmail, go to Settings and generate an access token and a refresh token for the sender.

  5. 5

    Call the API

    Send your token in the Authorization header and your first command to POST /v1.

MX record

To receive email on your own domain, its MX record must point to the Sendcorex inbound host. Add this record at your DNS provider.

  • TypeMX
  • Points tobounce.emailsbit.com
i

The MX record is only for receiving on your own domain. Without it, you can still send, and read the bounces and complaints that return to your mailbox.

What reaches the mailbox

Regular emails

Everything sent to your sender address, as in any mailbox.

Return-path messages

Bounces and other messages that come back to the return path are saved in the mailbox too, so you can read them through the API.

Complaints

Spam complaints are saved in the mailbox as well. They only come from Microsoft 365 and Microsoft services in general.

Your first request

List the unread conversations in your INBOX. Replace SENDCOREX_TOKEN with the access token from the webmail settings.

curl -X POST 'https://g.sendcorex.com/v1' \
  -H "Authorization: $SENDCOREX_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "commands": [
    { "command": "list_threads", "args": { "folder": "INBOX", "is_read": false, "limit": 10 } }
  ]
}'

Each thread has a last_message_uid. Pass it to Get Messages to read the email, or to Reply to answer it.

Full reference

Everything marked CMD is a command sent through POST /v1, up to 20 per request. Routes use their own paths.