Partner API

The Partner API lets resellers and agencies manage sub-accounts programmatically. You can create, suspend, and delete sub-accounts, and access their resources using your partner credentials.

Create a sub-account

curl -X POST https://api.cakemail.dev/sub-accounts \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Acme Corp",
    "admin_email": "admin@acmecorp.com"
  }'

The response includes a sub_account_id you'll use for all subsequent operations on that account.

List sub-accounts

curl "https://api.cakemail.dev/sub-accounts?page=1&per_page=50" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Use page and per_page for pagination. Results are sorted by creation date.

Update a sub-account

curl -X PATCH https://api.cakemail.dev/sub-accounts/{sub_account_id} \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"company_name": "Acme Corporation"}'

Suspend a sub-account

curl -X POST https://api.cakemail.dev/sub-accounts/{sub_account_id}/suspend \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Suspended accounts cannot send emails or access the API. Their data is preserved.

Unsuspend a sub-account

curl -X POST https://api.cakemail.dev/sub-accounts/{sub_account_id}/unsuspend \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

This restores full access to the sub-account.

Access sub-account resources

As a partner, you can access any sub-account's resources by adding the account_id query parameter to standard API endpoints. This lets you manage campaigns, contacts, and other resources on behalf of your sub-accounts without needing their credentials.

For example, to list campaigns for a specific sub-account:

curl "https://api.cakemail.dev/campaigns?account_id={sub_account_id}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

The account_id parameter works with any API endpoint — contacts, lists, templates, and more.

Delete a sub-account

curl -X DELETE https://api.cakemail.dev/sub-accounts/{sub_account_id} \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

This permanently removes the sub-account and all its associated data. This action cannot be undone.