domainName. A domain must be ACTIVE in the workspace and must not be a pre-warmed domain.failed with a reason. The status is 200 in both cases, so check failedCount.IN_PROGRESS; poll Get Mailbox with the returned mailbox.id until status is ACTIVE or FAILED. Re-queue FAILED ones with Retry Failed Mailboxes.slotsPurchased. The request fails with 400 if the balance does not cover the cost. The charge is not reversed when an individual mailbox then fails; the unused slots stay on the add-on subscription.curl --location 'https://api.zapmail.ai/api/v3/mailboxes/provision' \
--header 'x-auth-zapmail;' \
--header 'x-workspace-key;' \
--header 'Content-Type: application/json' \
--data '{
"domains": [
{
"domainName": "acme.com",
"mailboxes": [
{
"mailboxUsername": "jane",
"firstName": "Jane",
"lastName": "Doe"
},
{
"mailboxUsername": "john",
"firstName": "John",
"lastName": "Smith"
}
]
}
]
}'{
"status": 200,
"message": "Mailbox provisioning completed with failures",
"data": {
"requested": 2,
"succeeded": [
{
"domainIndex": 0,
"mailboxIndex": 0,
"domainName": "acme.com",
"email": "jane@acme.com",
"mailbox": {
"id": "0b6f7a52-3a0e-4a73-9d34-6f0d1a2c9e11",
"username": "jane",
"domain": "acme.com"
}
}
],
"failed": [
{
"domainIndex": 0,
"mailboxIndex": 1,
"domainName": "acme.com",
"mailboxUsername": "john",
"email": "john@acme.com",
"reason": "Mailbox already exists"
}
],
"successCount": 1,
"failedCount": 1,
"slotsPurchased": 1
}
}