---
title: "Add domains"
method: POST
path: "/api/v1/domains"
tags: ["Domains"]
---

# Add domains

`POST /api/v1/domains`

## Request

- Base URL: `https://api.aerosend.io`
- URL: `https://api.aerosend.io/api/v1/domains`
- Auth: API key in header `X-API-Key`

Adds one or more domains for the authenticated client.

## Domain Validation
- Domain format is validated according to RFC standards (e.g., `example.com`)
- Domain names are normalized (http/https and trailing slashes removed)
- Duplicate domains in the request are rejected

## Redirect URL Validation
- Redirect URLs are validated according to RFC standards (same validation as domain names)
- Protocol (http://, https://) and trailing slashes are automatically removed
- Redirect URLs are normalized to lowercase
- Each redirect URL must be a valid domain format (e.g., `mysite.com`, `example.co.in`)

## Slot Management
- Client must have sufficient domain slots available
- Domain slots are automatically updated after successful addition

## Existing Domains
- **Active domains**: Cannot be added (returns error)
- **Inactive domains**: Reactivated and ownership transferred to the client

## Default Settings
- All new domains have warmup enabled by default
- Initial status is set to `pending`

## Request body

- AddDomainsRequest: Request to add one or more domains
  - `domains` AddDomainItem[], required: List of domains to add
    - `domain` string, required: Domain name (e.g., example.com)
    - `redirect_url` string, required: Redirect URL for the domain

## Response `201`

Domains added successfully

- AddDomainsApiResponse
  - `success` boolean: Success flag
  - `data` AddDomainsResponse: Response after adding domains
    - `added_count` integer: Number of domains successfully added
    - `reactivated_count` integer: Number of inactive domains reactivated
    - `domains` DomainSummary[]: List of added domain details
      - `id` integer: Domain ID
      - `domain` string: Domain name
      - `status` string: Domain status
  - `timestamp` string: Response timestamp

## Other responses

- `400`: Invalid request - validation error or invalid domain format
- `401`: Unauthorized - Invalid or expired API key
- `409`: Conflict - One or more domains already exist
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/aerosend/apis/aerosend-developer-api.md) · [All operations](https://skmtc.dev/aerosend/apis/aerosend-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aerosend/apis/aerosend-developer-api/revisions/9828eeb89b1f?raw)
