Tutorial

Prerequisites

Before working with emails, you need:

  • An authentication token. Obtain one via POST /auth/login or use an access key from GET /accesskeys.

  • A verified sender email address (the source field must use a domain verified with VoIPBIN).

  • Recipient email addresses for sending.

Note

AI Implementation Hint

Sending emails incurs charges. The source address must use a domain that has been verified in VoIPBIN’s system. The destinations field uses the Address format with type set to email. Email status follows this lifecycle: initiated -> processed -> delivered. Additional statuses include open, click, bounce, dropped, deferred, unsubscribe, and spamreport.

Send an email

Example

$ curl --location --request POST 'https://api.voipbin.net/v1.0/emails?token=<YOUR_AUTH_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "destinations": [
        {
            "type": "email",
            "target": "[email protected]"
        }
    ],
    "subject": "Hello from VoIPBIN",
    "content": "This is a test email sent via the VoIPBIN API.",
    "attachments": []
}'

{
    "id": "1f25e6c9-6709-44d1-b93e-a5f1c5f80411",
    "customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
    "source": {
        "type": "email",
        "target": "[email protected]",
        "target_name": "voipbin service",
        "name": "",
        "detail": ""
    },
    "destinations": [
        {
            "type": "email",
            "target": "[email protected]",
            "target_name": "",
            "name": "",
            "detail": ""
        }
    ],
    "status": "initiated",
    "subject": "Hello from VoIPBIN",
    "content": "This is a test email sent via the VoIPBIN API.",
    "attachments": [],
    "tm_create": "2025-03-14 19:04:01.160250",
    "tm_update": "2025-03-14 19:04:01.160250",
    "tm_delete": "9999-01-01 00:00:00.000000"
}

Get list of emails

Example

$ curl --location 'https://api.voipbin.net/v1.0/emails?accesskey=your_accesskey'

{
    "result": [
        {
            "id": "1f25e6c9-6709-44d1-b93e-a5f1c5f80411",
            "customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
            "source": {
                "type": "email",
                "target": "[email protected]",
                "target_name": "voipbin service",
                "name": "",
                "detail": ""
            },
            "destinations": [
                {
                    "type": "email",
                    "target": "[email protected]",
                    "target_name": "",
                    "name": "",
                    "detail": ""
                }
            ],
            "status": "delivered",
            "subject": "test email 7",
            "content": "test email from voipbin.",
            "attachments": [],
            "tm_create": "2025-03-14 19:04:01.160250",
            "tm_update": "2025-03-14 19:04:11.509512",
            "tm_delete": "9999-01-01 00:00:00.000000"
        },
        ...
    ],
    "next_page_token": "2025-03-14 18:04:41.998152"
}