Zapmail
latest
  • latest
  • v1
  1. mailbox
Zapmail
latest
  • latest
  • v1
  • Zapmail Docs
  • users
    • Retrieve User Details
      GET
  • workspaces
    • Retrieve all workspaces
      GET
    • Create new workspace
      POST
    • Update workspace
      PUT
  • billing
    • Add Billing Details
      POST
    • Update Billing Details
      PUT
  • mailbox
    • Retrieve All Mailboxes
      GET
    • Get Mailbox Details by ID
      GET
    • Assign New Mailboxes to Domains
      POST
    • Update mailbox
      PUT
    • Remove mailboxes on next renewal
      PUT
    • Get Authenticator code
      GET
    • Remove Mailboxes Instantly
      POST
  • payments & wallet
    • Add balance to wallet
      POST
    • Get wallet balance
      GET
    • Enable auto recharge
      POST
  • export
    • Export mailboxes
      POST
    • Add third party account details
      POST
    • Update third party account details
      PUT
  • subscriptions
    • Get all subscriptions
      GET
    • Cancel subscription
      POST
    • Upgrade existing subscription
      POST
  • domains
    • Retrieve All Domains
    • List Assignable Domains
    • Add DMARC record
    • Add Domain forwarding
    • Get Name servers to connect domain
    • Verify Name Server Propagation
    • Connect Domain with Zapmail
    • Enable email forwarding
    • Remove email forwarding
    • Enable catch all emails
    • Remove catch all emails
    • Check DNS records
    • Remove unused domains
    • Get available domains for registration
    • Get domains purchase payment link
    • Get domain connection requests
    • Remove domain connection requests
    • Connect Domain with Zapmail (New)
    • Add Google Client ID to Domain
    • Get availability of multiple domain names.
  • dns
    • Get dns records
    • Add dns records
    • Update dns records
    • Delete dns records
  1. mailbox

Assign New Mailboxes to Domains

POST
/v2/mailboxes
This endpoint allows you to assign new mailboxes to specific domains.

Validation Rules#

1.
Payload Structure
The root object must have domain IDs as keys.
Each value must be an array of mailbox objects.
Arrays cannot be empty.
2.
Mailbox Object Validation
Each mailbox object must include firstName, lastName, mailboxUsername, and domainName.
mailboxUsername must:
1.
Not start or end with ., _, or -.
2.
Not contain consecutive ., _, or -.
3.
firstName, lastName, and domainName must be strings.
3.
Microsoft Service Provider Rule
For users with Microsoft, mailboxes cannot be assigned if previously assigned mailboxes are not yet active.
4.
Subscription and Quota Checks
Users must have purchased mailboxes available for assignment.
The total mailboxes being assigned cannot exceed the remaining mailbox quota.
Scheduled and "immedidate delete" mailboxes in a subscription is deducted from the quota.
5.
24-Hour Domain Rule
Mailboxes cannot be assigned to domains where mailboxes were already created within the last 24 hours.
6.
Per-Domain Assignment Limit
Total mailboxes assigned to a single domain cannot exceed 5

Request

Header Params

Body Params application/json

Example
{
    "64e71b99-bc07-4b5d-90b6-6abc0120c08c": [
        {
            "firstName": "Jaspreet",
            "lastName": "Singh",
            "mailboxUsername": "jaspreet",
            "domainName": "azhaz.com"
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.zapmail.ai/api/v2/mailboxes' \
--header 'x-auth-zapmail;' \
--header 'x-workspace-key;' \
--header 'x-service-provider;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "64e71b99-bc07-4b5d-90b6-6abc0120c08c": [
        {
            "firstName": "Jaspreet",
            "lastName": "Singh",
            "mailboxUsername": "jaspreet",
            "domainName": "azhaz.com"
        }
    ]
}'

Responses

🟢200Success
application/json
Body

Example
{
    "status": 200,
    "message": "Mailboxes will be assigned shortly",
    "data": null
}
🟠400No slots remaining
🟠403Unauthorized
🟠40024 Hour Rule
🟠422Invalid Payload
Modified at 2025-10-14 09:22:07
Previous
Get Mailbox Details by ID
Next
Update mailbox
Built with