---
title: "Create Dns Credential"
method: POST
path: "/api/v1/dns-credentials"
tags: ["dns-credentials"]
---

# Create Dns Credential

`POST /api/v1/dns-credentials`

## Request

- Base URL: `https://api.mengi.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mengi.cloud/api/v1/dns-credentials`
- Auth: none declared

Create a new DNS credential.

Credentials are stored securely in OpenBao, not in our database.
After creation, credentials should be validated using the validate endpoint.

## Request body

- DNSCredentialCreate: Create a new DNS credential (multi-provider).
  - `name` string, required: User-friendly name
  - `provider` string, required: DNS provider: one of bunny, cloudflare, digitalocean, route53
  - `credentials` object: Provider-specific credential fields
  - `api_key` string, nullable: Deprecated: use credentials.api_key
  - `managed_domain` string, nullable: DNS zone this credential manages (e.g. example.com)
  - `organization_id` string, uuid, nullable: Active org; defaults to the user's personal org

## Response `201`

Successful Response

- DNSCredentialResponse: Response schema for a DNS credential (excludes sensitive data).
  - `id` string, uuid, required
  - `name` string, required
  - `organization_id` string, uuid, nullable
  - `provider` string, required
  - `managed_domain` string, nullable
  - `is_valid` boolean, required
  - `validation_error` string, nullable
  - `last_validated_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mengi/apis/mengi-cloud.md) · [All operations](https://skmtc.dev/mengi/apis/mengi-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/mengi/apis/mengi-cloud/revisions/4ae9b375cdbb?raw)
