---
title: "Setup DNS records for an email domain using a configured DNS provider"
method: POST
path: "/email-domains/{id}/setup-dns"
tags: ["Email Domains"]
---

# Setup DNS records for an email domain using a configured DNS provider

`POST /email-domains/{id}/setup-dns`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/email-domains/{id}/setup-dns`
- Auth: HTTP bearer

## Path parameters

- `id` integer, required

## Request body

- SetupDnsRequest: Request to setup DNS records using a configured DNS provider
  - `dns_provider_id` integer, required: The ID of the DNS provider to use for creating records

## Response `200`

DNS records setup result

- SetupDnsResponse: Response from DNS setup operation
  - `message` string, required: Human-readable summary message
  - `records_created` integer, required: Number of records that were successfully created
  - `results` DnsRecordSetupResult[], required: Results for each individual record
    - `automatic` boolean, required: Whether the operation was automatic or manual
    - `message` string, required: Human-readable message
    - `name` string, required: Record name
    - `record_type` string, required: Record type (TXT, CNAME, MX)
    - `success` boolean, required: Whether the record was created successfully
  - `success` boolean, required: Overall success status
  - `total_records` integer, required: Total number of records attempted

## Other responses

- `400`: Invalid request or DNS provider not configured
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Domain not found
- `500`: Internal server error

## Changes

- **2026-01-11** `50604ba8d4a8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/email-domains/:id/setup-dns/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
