Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

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

NameInTypeDescription
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 ^[!-~]{1,128}$

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

HeaderTypeDescription
Idempotent-Replayedstring · enumtrue when the answer is a replay of an earlier request with the same Idempotency-Key; absent otherwise.
  • AppliedDnsRecords object · all fields required
  • dns_providerDnsProvider

    Who applied the records: porkbun, or manual (nothing was changed; each record’s outcome is manual).

    • porkbun
    • manual
  • recordsarray of AppliedDnsRecord

    One entry per required record, in the order they are created.

    6 fields
    • AppliedDnsRecord object · all fields required
    • contentstring

      The value the record should hold.

    • detailstring | null

      A message for the outcomes that carry one (conflict, provider_error, unavailable); null otherwise.

    • namestring

      The owner name, without a trailing dot.

      example bounce.news.example.com

    • What apply did to one record.

      • created
      • updated
      • unchanged
      • skipped_exists
      • manual
      • conflict
      • provider_error
      • unavailable
    • What a required record is for.

      • spf_bounce
      • mx_bounce
      • dkim
      • dmarc
      • tracking_cname
    • The type of a DNS record.

      • txt
      • mx
      • cname

403

A project key without scope write (forbidden)

Problem (application/problem+json)

404

No such project or domain in it, or another project’s (not_found)

Problem (application/problem+json)

409

The project is deleted (conflict); or a request with the same Idempotency-Key has not answered yet (idempotency_key_in_progress)

Problem (application/problem+json)

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)

Problem (application/problem+json)

429

The key is over its rate limit, api.rate_limit_per_minute requests a minute on this node (rate_limited)

HeaderTypeDescription
Retry-AfterintegerSeconds until the key’s next request passes; rounded up.

Problem (application/problem+json)

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

Problem (application/problem+json)