Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

Domains HTTP API

POST/api/v1/projects/{project_id}/domains/{domain_id}/dns/apply

apply_dns_records

Applies a sending domain’s required DNS records through its provider.

Call it
after add_sending_domain for a Porkbun domain to create the records automatically, or on a manual domain to get the list to enter by hand (nothing is changed; every outcome is manual).
Needs
an admin key with project_id, or a project key with scope write (its own project; the argument is ignored), the domain’s id, and, for Porkbun, credentials on the node or the project. No confirm is needed: re-running converges, _dmarc and records Postwind does not own are never overwritten, and nothing is deleted. A provider failure is that record’s outcome, not an error; the first unavailable record stops the run and the call ends within 30 s, so run it again for whatever is not created, updated or unchanged. Until the node has a TLS client, a Porkbun domain answers precondition_failed.
Returns
dns_provider and records (each with purpose, type, name, content, outcome and detail); the same as POST /api/v1/projects/{project_id}/domains/{domain_id}/dns/apply.

Arguments

  • object
  • domain_idstring · uuidrequired

    The domain’s id, as add_sending_domain or list_sending_domains gave it.

  • project_idstring · uuid | null

    The domain’s project. An admin key must pass it; a project key’s own project is used and this is ignored.

No other arguments are accepted.

Result

The result comes back as structuredContent, with the same JSON as a text block.

  • object · all fields required
  • dns_providerDnsProviderOutput

    Who applied the records: porkbun, or manual (nothing changed).

    porkbun Porkbun’s API.

    manual Nobody: the records are for entry by hand.

  • 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 conflict, provider_error and unavailable; null otherwise.

    • namestring

      The owner name, without a trailing dot.

    • What apply_dns_records did to one record.

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

      spf_bounce SPF of the bounce subdomain.

      mx_bounce MX of the bounce subdomain.

      dkim The DKIM public key.

      dmarc The DMARC policy.

      tracking_cname The tracking host’s CNAME.

    • The type of a DNS record.

      • txt
      • mx
      • cname

Definitions

AppliedDnsRecord

One required record and what apply_dns_records did to it.

  • object · all fields required
  • contentstring

    The value the record should hold.

  • detailstring | null

    A message for conflict, provider_error and unavailable; null otherwise.

  • namestring

    The owner name, without a trailing dot.

  • What apply_dns_records did to one record.

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

    spf_bounce SPF of the bounce subdomain.

    mx_bounce MX of the bounce subdomain.

    dkim The DKIM public key.

    dmarc The DMARC policy.

    tracking_cname The tracking host’s CNAME.

  • The type of a DNS record.

    • txt
    • mx
    • cname

DnsApplyOutcomeOutput

What apply_dns_records did to one record.

string · enum

  • created
  • updated
  • unchanged
  • skipped_exists
  • manual
  • conflict
  • provider_error
  • unavailable

DnsProviderOutput

Who applies a domain’s DNS records.

string · enum

porkbun Porkbun’s API.

manual Nobody: the records are for entry by hand.

RecordPurposeOutput

What a required record is for.

string · enum

spf_bounce SPF of the bounce subdomain.

mx_bounce MX of the bounce subdomain.

dkim The DKIM public key.

dmarc The DMARC policy.

tracking_cname The tracking host’s CNAME.

RecordTypeOutput

The type of a DNS record.

string · enum

  • txt
  • mx
  • cname

Errors

A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors

HTTP API

The same operation over HTTP: POST /api/v1/projects/{project_id}/domains/{domain_id}/dns/apply