POST/api/v1/projects/{project_id}/domains/{domain_id}/dns/apply
Needs scope: writeIdempotency-KeyMCP tool: apply_dns_records
operationId apply_dns_records
Apply a domain's DNS records
Applies the domain’s required records through its DNS provider and answers
each record’s outcome. For a manual-provider domain nothing is changed
and every record’s outcome is manual (the records to enter by hand).
Postwind creates and changes the SPF and MX of the bounce subdomain, the
DKIM record and the tracking CNAME; it creates _dmarc only when absent
and never changes it; and it refuses (never overwrites) a bounce-subdomain
TXT that is not SPF. A provider failure on one record is that record’s
outcome, not an error; the first unavailable record stops the run, which
ends within 30 s, and a repeat converges. Until the node has a TLS client,
a Porkbun domain answers precondition_failed. Needs scope write.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
project_idrequired |
path | string · uuid | The project’s id |
domain_idrequired |
path | string · uuid | The domain’s id |
Idempotency-Key |
header | string
1–128 characters · pattern |
A key of the client’s choosing, one per request it means to send once (a UUID will do). A repeat with the same key and the same body within 24 h creates nothing again and gets the first answer, marked Idempotent-Replayed: true. The key belongs to the API key that sent it. Only a 2xx answer is kept: after any other answer the key is free again. |
Request body
None.
Responses
200
Each record’s outcome
| Header | Type | Description |
|---|---|---|
Idempotent-Replayed | string · enum | true when the answer is a replay of an earlier request with the same Idempotency-Key; absent otherwise. |
- AppliedDnsRecords object · all fields required
-
dns_providerDnsProviderWho applied the records:
porkbun, ormanual(nothing was changed; each record’s outcome ismanual).- porkbun
- manual
-
recordsarray of AppliedDnsRecordOne entry per required record, in the order they are created.
6 fields
- AppliedDnsRecord object · all fields required
-
contentstringThe value the record should hold.
-
detailstring | nullA message for the outcomes that carry one (
conflict,provider_error,unavailable);nullotherwise. -
namestringThe owner name, without a trailing dot.
example
bounce.news.example.com -
outcomeDnsApplyOutcomeWhat
applydid to one record.- created
- updated
- unchanged
- skipped_exists
- manual
- conflict
- provider_error
- unavailable
-
purposeRecordPurposeWhat a required record is for.
- spf_bounce
- mx_bounce
- dkim
- dmarc
- tracking_cname
-
typeRecordTypeThe type of a DNS record.
- txt
- mx
- cname
404
No such project or domain in it, or another project’s (not_found)
409
The project is deleted (conflict); or a request with the same Idempotency-Key has not answered yet (idempotency_key_in_progress)
422
The node has no usable web.public_url, no longer declares the domain’s IP pool, Porkbun is not configured for the domain or cannot be reached over HTTPS from this build, or the domain has no registrable domain (precondition_failed); or the Idempotency-Key was used in the last 24 h for another request (idempotency_key_reused), or is not 1 to 128 visible ASCII characters (validation_failed, field Idempotency-Key)
429
The key is over its rate limit, api.rate_limit_per_minute requests a minute on this node (rate_limited)
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds until the key’s next request passes; rounded up. |
504
Postwind’s storage did not answer within its time limit (storage_timeout). A change the request makes may still take effect: check before repeating it. A repeat with the same Idempotency-Key never runs it twice: it is 409 idempotency_key_in_progress until the key’s 24 h end