Skip to main content
Version: 1.0.1

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​

  1. 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}}'
  2. Exchange the API key for a token

    curl --location '{{baseUrl}}/auth/login' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "apiKey": "{{companyApiKey}}"
    }'

    The jwt field 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​

PropertyValue
URLPOST /smtp/account/{companyId}/create?emailLocalPart={emailLocalPart}
MethodPOST
AuthR-Auth: <company-jwt> (Administrator role required)
Base URLStage 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​

ParameterTypeRequiredDescription
companyIdUUIDYesCompany UUID

Query parameters​

ParameterTypeRequiredDescription
emailLocalPartstringYesLocal part of the email address to create
note

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​

FieldTypeDescription
(body)stringThe assigned email address. The response is a plain text value, not a JSON object.

Response Codes​

CodeDescription
200OK — Returns the assigned email address
400Bad Request — Plan limit for email addresses reached
401Unauthorized — R-Auth header missing or invalid
403Forbidden — Company does not have an active ADMIN user
409Conflict — Address already belongs to another company