Assign Email Address
Assign an email address that the company can receive mail at. Unlike most other white-label partner endpoints, this one is called with a company token, not the partner JWT, and the company must have an active ADMIN user.
Before you start
-
Get the company API key
If you just created the company with Create company, the API key is already in that response and you can skip this step. Otherwise, retrieve it with Get company API key:
curl --location '{{baseUrl}}/white-label-partner/{{companyId}}/api-key' \
--header 'R-Auth: {{partnerJwt}}' -
Exchange the API key for a token
curl --location '{{baseUrl}}/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"apiKey": "{{companyApiKey}}"
}'The
jwtfield in the response is a token valid only for this company. The company must have an active ADMIN user for this endpoint to accept it. See Company login for details.
Endpoint
| Property | Value |
|---|---|
| URL | POST /smtp/account/{companyId}/create?emailLocalPart={emailLocalPart} |
| Method | POST |
| Auth | R-Auth: <company-jwt> (Administrator role required) |
| Base URL | Stage Environment https://api-stage.docnova.ai/ Production Environment https://api.docnova.ai/ |
Example Request
curl --location --request POST '{{baseUrl}}/smtp/account/{{companyId}}/create?emailLocalPart=sales' \
--header 'R-Auth: {{companyJwt}}'
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
companyId | UUID | Yes | Company UUID |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
emailLocalPart | string | Yes | Local part of the email address to create |
emailLocalPart is lowercased automatically, and any character that is not a letter or digit is replaced with -.
Request fields
This endpoint takes no request body.
Response
sales-team@mail.example.com
Response fields
| Field | Type | Description |
|---|---|---|
(body) | string | The assigned email address. The response is a plain text value, not a JSON object. |
Response Codes
| Code | Description |
|---|---|
200 | OK — Returns the assigned email address |
400 | Bad Request — Plan limit for email addresses reached |
401 | Unauthorized — R-Auth header missing or invalid |
403 | Forbidden — Company does not have an active ADMIN user |
409 | Conflict — Address already belongs to another company |