Skip to content

Accounts

Create and manage email accounts. All endpoints require Authorization: Bearer <token>.

Create an Account

POST /api/accounts

Creates an email account. Returns the account ID and address. All subsequent operations use the same API token.

Request:

bash
curl -X POST https://api.mail.td/api/accounts \
  -H "Authorization: Bearer td_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"address": "demo@mail.td", "password": "supersecret"}'
FieldTypeRequiredDescription
addressstringYesEmail address (local@domain)
passwordstringYesPassword (min 6 characters)

Response (201):

json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-1234567890ab",
  "address": "demo@mail.td"
}

INFO

Save the id (account ID). It is used as {account_id} in all subsequent API paths.

{account_id} is the email address

All API paths that contain {account_id} accept the email address directly (e.g. demo@mail.td). UUID format is also supported.

Pro accounts can create addresses on custom domains and get higher storage quotas.

Errors:

CodeErrorDescription
400invalid_addressMalformed email address
400invalid_domainDomain not available
400password_too_shortPassword under minimum length
403account_limit_reachedQuota exceeded
409address_takenAddress already in use

Get Account Info

GET /api/accounts/{account_id}

Returns account details including storage usage.

Response (200):

json
{
  "id": "a1b2c3d4-...",
  "address": "demo@mail.td",
  "role": "user",
  "quota": 41943040,
  "used": 1234567,
  "created_at": "2025-01-15T10:30:00Z"
}
FieldTypeDescription
quotaintegerStorage limit in bytes
usedintegerCurrent storage usage in bytes

Delete Account

DELETE /api/accounts/{account_id}

Permanently deletes the account and all its messages. This action is irreversible.

Response: 204 No Content

Reset Password

PUT /api/accounts/{account_id}/reset-password

Resets the account's authentication credentials. All existing tokens are invalidated.

Request:

json
{
  "password": "newpassword123"
}

Response (200):

json
{
  "message": "password_reset"
}

Access Control

Your API token (td_...) can access any account owned by your Pro user. Attempting to access an account you don't own returns 404 Not Found.

Mail.td API Documentation