Skip to content

Pro Accounts

Manage mailboxes under your Pro account. Create mailboxes on system domains or your own verified custom domains.

List Mailboxes

GET /pro/api/accounts

Request

bash
curl https://api.mail.cx/pro/api/accounts \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx"

Response 200

json
{
  "accounts": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "address": "info@yourdomain.com",
      "quota": 52428800,
      "used": 1048576,
      "created_at": "2025-01-15T10:00:00Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "address": "support@yourdomain.com",
      "quota": 52428800,
      "used": 0,
      "created_at": "2025-01-16T12:00:00Z"
    }
  ]
}

Create a Mailbox

POST /api/accounts

Pro users create mailboxes via the same endpoint as free users (POST /api/accounts), but include their Pro Bearer token. This allows creating mailboxes on both system domains and verified custom domains.

Request

bash
curl -X POST https://api.mail.cx/api/accounts \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"address":"info@yourdomain.com","password":"securepass"}'
FieldTypeRequiredDescription
addressstringYesEmail address (system domain or custom domain)
passwordstringYesMailbox password

Response 201

json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "address": "info@yourdomain.com",
  "token": "eyJhbGciOiJIUzI1NiIs..."
}

TIP

Without a Pro Bearer token, only system domains are available. With a Pro token, you can also use your verified custom domains.

Errors

StatusError CodeDescription
400invalid_addressInvalid email format or unverified domain
403account_limit_reachedMailbox limit reached
409address_takenAddress already in use

Delete a Mailbox

DELETE /pro/api/accounts/{id}

Permanently deletes the mailbox and all its emails.

Request

bash
curl -X DELETE https://api.mail.cx/pro/api/accounts/a1b2c3d4-... \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx"

Response 204

No content.


Reset Mailbox Password

PUT /pro/api/accounts/{id}/reset-password

Request

bash
curl -X PUT https://api.mail.cx/pro/api/accounts/a1b2c3d4-.../reset-password \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"password":"newpassword123"}'

Response 200

json
{
  "message": "password_reset"
}

Errors

StatusError CodeDescription
400password_too_shortPassword too short
404not_foundMailbox not found

List Mailbox Messages

GET /pro/api/accounts/{id}/messages

List messages for a specific mailbox without needing that mailbox's JWT token.

Parameters

NameInTypeDefaultDescription
idpathuuidAccount ID
pagequeryinteger1Page number

Request

bash
curl https://api.mail.cx/pro/api/accounts/a1b2c3d4-.../messages?page=1 \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx"

Response 200

json
{
  "messages": [
    {
      "id": "f5e6d7c8-a1b2-3c4d-e5f6-789012345678",
      "sender": "noreply@example.com",
      "from": "Example <noreply@example.com>",
      "subject": "Welcome!",
      "preview_text": "Thanks for signing up...",
      "size": 3200,
      "created_at": "2025-01-15T10:30:00Z"
    }
  ],
  "page": 1
}

Mail.cx API Documentation