{"openapi":"3.1.0","info":{"title":"prefix.domains API","version":"1.0.0","description":"Agent-first HTTP API for comparing registrar domain prices,\nchecking availability (including premiums), and obtaining executable\npurchase plans at other registrars.\n\nAgents with an account key can also register names directly, paid from\naccount credit, with their own contact as registrant, and manage DNS\nrecords (including TXT) on names they registered.\n\nStart with https://prefix.domains/llms.txt\n","contact":{"url":"https://prefix.domains","name":"prefix.domains"}},"servers":[{"url":"https://prefix.domains/v1","description":"Production"}],"paths":{"/registrars":{"get":{"summary":"List registrars and purchase capabilities","operationId":"listRegistrars","responses":{"200":{"description":"Registrar matrix","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"registrars":{"type":"array","items":{"$ref":"#/components/schemas/RegistrarSummary"}}}}}}}}}},"/registrars/{slug}":{"get":{"summary":"Registrar detail","operationId":"getRegistrar","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registrar detail"},"404":{"$ref":"#/components/responses/Error"}}}},"/prices":{"get":{"summary":"Standard list prices for a TLD","operationId":"getPrices","parameters":[{"name":"tld","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List prices"},"503":{"$ref":"#/components/responses/Error"}}}},"/compare":{"get":{"summary":"Rank registrar offers for a domain's TLD","operationId":"compare","parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string"}},{"name":"optimize","in":"query","schema":{"type":"string","enum":["register","tco_2y","renew","year1"],"default":"register"}},{"name":"live_quote","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Ranked offers"}}}},"/availability":{"post":{"summary":"Batch definitive availability","operationId":"checkAvailability","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domains"],"properties":{"domains":{"type":"array","maxItems":10,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Per-domain definitive statuses"},"429":{"$ref":"#/components/responses/Error"}}}},"/quote":{"post":{"summary":"Live registrar quotes (premium-aware)","operationId":"quote","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"},"registrars":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Quotes"}}}},"/purchase-plan":{"post":{"summary":"Cold-start executable purchase plan","description":"Returns prerequisites the agent must have (email, card, contact, …)\nplus ordered steps that create or log into a registrar account,\nverify email, add payment, and complete the purchase.\nSteps may branch with `when` (for example `account.exists == false`).\n","operationId":"purchasePlan","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchasePlanRequest"}}}},"responses":{"200":{"description":"Purchase plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchasePlanResponse"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/suggest":{"post":{"summary":"Suggest candidate domains","operationId":"suggest","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"string"}},"tlds":{"type":"array","items":{"type":"string"}},"max_register_cents":{"type":"integer"}}}}}},"responses":{"200":{"description":"Candidates"}}}},"/names/search":{"post":{"summary":"Search registrable names with live minimum-term prices","operationId":"searchNames","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["keyword"],"properties":{"keyword":{"type":"string"},"tlds":{"type":"array","maxItems":50,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Purchasable names (registration inventory only)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"premium":{"type":"boolean"},"price_cents":{"type":"integer","description":"Price for the TLD's minimum term (usually 1 year; 2 for .ai)"},"renewal_cents":{"type":["integer","null"]},"currency":{"type":"string"}}}}}}}}}}}},"/names/quote":{"post":{"summary":"Exact price to register one name for a term","operationId":"quoteName","description":"Pass the returned price_cents as accept_price_cents to POST /registrations.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NameQuoteRequest"}}}},"responses":{"200":{"description":"Quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NameQuote"}}}}}}},"/signup":{"post":{"summary":"Create an account for a principal and get an API key","operationId":"signup","description":"`contact` is the principal (person or org) the agent acts for; they are the\nregistrant of every name on the account. `api_key` is shown once. No payment\nstep is needed now: the first POST /registrations returns 402 with\n`checkout_url`, which pays for that order and saves the card.\n`payment_setup_url` saves a card without buying anything. IP rate limited.\nAn existing email starts a sign-in instead: 409 `account_exists` with `login_id`\n(see POST /auth/login/verify).\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","contact"],"properties":{"email":{"type":"string","format":"email"},"contact":{"$ref":"#/components/schemas/Contact"},"agent_name":{"type":"string","maxLength":80,"description":"Label for this agent's key, e.g. \"Otherwise on MacBook\"."}}}}}},"responses":{"201":{"description":"Account created","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"customer_id":{"type":"string","format":"uuid"},"api_key":{"type":"string"},"payment_ready":{"type":"boolean"},"payment_setup_url":{"type":["string","null"]},"next":{"type":"string"}}}}}},"409":{"description":"account_exists; a sign-in code was emailed (`login_id`, `expires_at`)"}}}},"/auth/login":{"post":{"summary":"Email a sign-in code to an existing account","operationId":"login","description":"For a lost key, a new machine, or a second agent. Emails a 6-digit code to the\naccount address. Get it from the principal, then POST /auth/login/verify.\nCodes last 15 minutes; 5 per account per hour.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"agent_name":{"type":"string","maxLength":80}}}}}},"responses":{"202":{"description":"Code emailed if an account uses this email. Unknown emails get the same response (with a login_id that never verifies) so this never reveals accounts.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"login_id":{"type":"string","format":"uuid"},"expires_at":{"type":"string","format":"date-time"},"next":{"type":"string"}}}}}},"403":{"description":"account_suspended"},"429":{"description":"rate_limited (retry_after_s); per account, or per client IP"},"503":{"description":"login_unavailable or email_failed"}}}},"/auth/login/verify":{"post":{"summary":"Trade the emailed code for a new API key","operationId":"loginVerify","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["login_id","code"],"properties":{"login_id":{"type":"string","format":"uuid"},"code":{"type":"string","description":"6 digits; spaces and dashes are ignored."}}}}}},"responses":{"200":{"description":"Signed in; `api_key` is shown once","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"customer_id":{"type":"string","format":"uuid"},"api_key":{"type":"string"},"key_id":{"type":"string","format":"uuid"},"next":{"type":"string"}}}}}},"400":{"description":"invalid_code (attempts_left) or invalid_request"},"410":{"description":"login_expired (expired, already used, or too many wrong codes)"}}}},"/account/keys":{"get":{"summary":"The account's API keys, one per agent","operationId":"listKeys","security":[{"apiKey":[]}],"responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"type":["string","null"],"format":"date-time"},"current":{"type":"boolean","description":"The key this request used."}}}}}}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/account/keys/{id}":{"delete":{"summary":"Revoke an API key","operationId":"revokeKey","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Revoked (`revoked_current` is true if it was the calling key)"},"401":{"$ref":"#/components/responses/Error"},"404":{"description":"not_found"}}}},"/account":{"get":{"summary":"Caller's account, credit balance, card status, and limits","operationId":"getAccount","security":[{"apiKey":[]}],"responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"type":"object","properties":{"customer_id":{"type":"string"},"email":{"type":"string"},"contact":{"$ref":"#/components/schemas/Contact"},"balance_cents":{"type":"integer"},"payment_ready":{"type":"boolean"},"email_verified":{"type":"boolean","description":"True once a sign-in code sent to this email was used."},"currency":{"type":"string"},"limits":{"type":"object","properties":{"max_price_cents":{"type":"integer"},"daily_spend_cap_cents":{"type":"integer"},"daily_registration_cap":{"type":"integer"},"dns_writes_per_hour":{"type":["integer","null"]}}},"attention":{"type":"array","description":"Names the principal must act on","items":{"type":"object","properties":{"domain":{"type":"string"},"code":{"type":"string","enum":["contact_unverified","auto_renew_failing","expiring_soon","expired"]},"message":{"type":"string"},"by":{"type":["string","null"],"format":"date-time"}}}}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"description":"account_suspended"}}}},"/account/payment-setup":{"post":{"summary":"New link for the principal to save a card (expires after 24h)","operationId":"paymentSetup","security":[{"apiKey":[]}],"responses":{"200":{"description":"{payment_setup_url}"},"503":{"description":"Card payments are not enabled"}}}},"/registrations":{"post":{"summary":"Register a name to the caller's principal","operationId":"register","description":"The account contact (the principal) is the registrant of record. Paid from\naccount credit; any shortfall is charged to the saved card. Retrying with the\nsame idempotency_key returns the original registration and never charges twice.\nA 202 means the outcome is still settling; poll GET /registrations/{id}.\nFailed registrations are refunded: the card-funded part to the card, the rest to\naccount credit (see `refund`).\n\nNo saved card: 402 `payment_required` with `checkout_url`. Give it to the\nprincipal; paying it places this order and saves the card. Retry the same\nrequest (same idempotency_key) every few seconds: 402 with the same link until\npaid, then the registration. An order that cannot be placed after payment is\nrefunded to the card.\n\nErrors: 402 `payment_required` (no saved card), `insufficient_credit`,\n`card_declined`, `authentication_required`; 403 `limit_exceeded` (see\nGET /account limits), `name_blocked`, `account_suspended`; 409\n`price_changed`, `not_available`, `idempotency_conflict`.\n","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"200":{"description":"Replay of an earlier request with the same idempotency_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationResponse"}}}},"201":{"description":"Registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationResponse"}}}},"202":{"description":"Pending; poll GET /registrations/{id}","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationResponse"}}}},"401":{"$ref":"#/components/responses/Error"},"402":{"description":"`payment_required` with `checkout_url` (no saved card), `insufficient_credit`,\n`card_declined`, or `authentication_required`\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"409":{"description":"price_changed, not_available, idempotency_conflict, or register_failed"},"503":{"description":"Registration temporarily unavailable; any charge was refunded"}}}},"/registrations/{id}":{"get":{"summary":"Registration status","operationId":"getRegistration","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Registration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationResponse"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/domains":{"get":{"summary":"Names registered by the caller","operationId":"listDomains","security":[{"apiKey":[]}],"responses":{"200":{"description":"Owned domains"}}}},"/domains/{domain}":{"get":{"summary":"Expiry, auto-renew, lock, privacy, nameservers, and contact verification","operationId":"getDomain","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"responses":{"200":{"description":"Domain detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"summary":"Change auto-renew, transfer lock, or WHOIS privacy","operationId":"updateDomain","description":"Omitted fields are unchanged. `auto_renew` renews 1 year before expiry from\naccount credit or the saved card; failures show in GET /account `attention`.\n","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"auto_renew":{"type":"boolean"},"locked":{"type":"boolean"},"privacy":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated domain detail (`warning` when auto-renew has no saved card)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/domains/{domain}/nameservers":{"put":{"summary":"Point the name at other nameservers","operationId":"setNameservers","description":"Counts as one DNS write. DNS record routes stop affecting resolution once nameservers point elsewhere.","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["nameservers"],"properties":{"nameservers":{"type":"array","minItems":2,"maxItems":13,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"{nameservers, dns_active}, plus a warning when the new nameservers are not Name.com's"},"400":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/domains/{domain}/contact-verification/resend":{"post":{"summary":"Resend the registrant contact verification email","operationId":"resendContactVerification","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"responses":{"200":{"description":"{email, next_eligible_at}"},"409":{"description":"no_pending_verification"},"429":{"description":"Resent too recently (one per 15 minutes)"}}}},"/domains/{domain}/renewal-quote":{"get":{"summary":"Price to renew an owned name","operationId":"renewalQuote","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"},{"name":"years","in":"query","schema":{"type":"integer","minimum":1,"maximum":10,"default":1}}],"responses":{"200":{"description":"Quote","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"domain":{"type":"string"},"years":{"type":"integer"},"available":{"type":"boolean"},"reason":{"type":"string","enum":["not_in_account","term_not_offered"]},"premium":{"type":"boolean"},"price_cents":{"type":"integer","description":"Total for the requested years"},"currency":{"type":"string"},"expires_at":{"type":["string","null"],"format":"date-time"}}}}}}}}},"/domains/{domain}/renewals":{"post":{"summary":"Renew an owned name","operationId":"renew","description":"Paid like a registration: account credit first, any shortfall from the saved card.\nRetrying with the same idempotency_key never charges twice. 202 = settling; poll\nGET /renewals/{id}. Renewals the registrar refuses are refunded (card part to the card).\n\nErrors: 402 `payment_required`, `insufficient_credit`, `card_declined`,\n`authentication_required`; 403 `limit_exceeded`; 409 `price_changed`,\n`not_renewable`, `idempotency_conflict`, `renew_failed`.\n","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accept_price_cents","idempotency_key"],"properties":{"years":{"type":"integer","minimum":1,"maximum":10,"default":1},"accept_price_cents":{"type":"integer","description":"Must equal price_cents from /domains/{domain}/renewal-quote"},"idempotency_key":{"type":"string","minLength":8}}}}}},"responses":{"200":{"description":"Replay of an earlier request with the same idempotency_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewalResponse"}}}},"201":{"description":"Renewed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewalResponse"}}}},"202":{"description":"Pending; poll GET /renewals/{id}","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewalResponse"}}}},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"}}},"get":{"summary":"Recent renewals of an owned name","operationId":"listRenewals","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"responses":{"200":{"description":"{renewals}"}}}},"/renewals/{id}":{"get":{"summary":"Renewal status","operationId":"getRenewal","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Renewal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewalResponse"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/domains/{domain}/auth-code":{"get":{"summary":"Always 403 approval_required; use POST to request the principal's approval","operationId":"getAuthCode","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"responses":{"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Email the principal an approval code for releasing the transfer code","description":"A transfer code lets anyone move the domain to another registrar, so an API key alone never gets it. This emails a 6-digit approval code to the account address; trade it at /auth-code/verify. Approvals expire in 15 minutes, allow 5 wrong tries, and are capped at 5 per account per hour.","operationId":"requestAuthCodeApproval","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"responses":{"202":{"description":"Approval code emailed","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"approval_id":{"type":"string","format":"uuid"},"expires_at":{"type":"string","format":"date-time"},"next":{"type":"string"}}}}}},"404":{"$ref":"#/components/responses/Error"},"429":{"description":"rate_limited (retry_after_s)"},"503":{"description":"approval_unavailable or email_failed"}}}},"/domains/{domain}/auth-code/verify":{"post":{"summary":"Trade the principal's approval code for the transfer code","operationId":"verifyAuthCodeApproval","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["approval_id","code"],"properties":{"approval_id":{"type":"string","format":"uuid"},"code":{"type":"string","description":"6 digits; spaces and dashes are ignored"}}}}}},"responses":{"200":{"description":"Transfer code","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"auth_code":{"type":"string"}}}}}},"400":{"description":"invalid_code (attempts_left) or invalid_request"},"404":{"$ref":"#/components/responses/Error"},"410":{"description":"approval_expired (expired, used, or too many wrong codes)"}}}},"/domains/{domain}/records":{"get":{"summary":"List DNS records (optionally ?type=TXT)","operationId":"listRecords","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"},{"name":"type","in":"query","schema":{"$ref":"#/components/schemas/DnsRecordType"}}],"responses":{"200":{"description":"Records","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"records":{"type":"array","items":{"$ref":"#/components/schemas/DnsRecord"}},"dns_active":{"$ref":"#/components/schemas/DnsStatus/properties/dns_active"},"nameservers":{"$ref":"#/components/schemas/DnsStatus/properties/nameservers"},"warning":{"$ref":"#/components/schemas/DnsStatus/properties/warning"}}}}}}}},"post":{"summary":"Create a DNS record","operationId":"createRecord","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsRecordInput"}}}},"responses":{"201":{"description":"{record} plus DnsStatus fields (dns_active, warning)"}}}},"/domains/{domain}/records/{id}":{"put":{"summary":"Replace a DNS record (all fields required)","operationId":"updateRecord","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"},{"$ref":"#/components/parameters/RecordId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsRecordInput"}}}},"responses":{"200":{"description":"{record} plus DnsStatus fields (dns_active, warning)"}}},"delete":{"summary":"Delete a DNS record","operationId":"deleteRecord","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/Domain"},{"$ref":"#/components/parameters/RecordId"}],"responses":{"200":{"description":"{ok} plus DnsStatus fields (dns_active, warning)"}}}},"/domains/{domain}/txt":{"parameters":[{"$ref":"#/components/parameters/Domain"}],"get":{"summary":"TXT values at a host","operationId":"getTxt","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/TxtHost"}],"responses":{"200":{"description":"Values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TxtSet"}}}}}},"put":{"summary":"Set exactly these TXT values at a host","operationId":"setTxt","description":"Creates missing values, then deletes the rest, so a replaced token never\ndisappears before its successor exists. Safe to repeat.\n","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"properties":{"host":{"type":"string","default":"","description":"\"\" or \"@\" for the apex, else relative labels like _verify"},"values":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string"}},"ttl":{"type":"integer","minimum":300,"default":300}}}}}},"responses":{"200":{"description":"Values after the change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TxtSet"}}}},"429":{"description":"DNS write limit reached"}}},"post":{"summary":"Add one TXT value at a host (no-op if present)","operationId":"addTxt","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"host":{"type":"string","default":""},"value":{"type":"string"},"ttl":{"type":"integer","minimum":300,"default":300}}}}}},"responses":{"200":{"description":"Already present"},"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TxtSet"}}}}}},"delete":{"summary":"Remove one TXT value, or all TXT values, at a host","operationId":"deleteTxt","security":[{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/TxtHost"},{"name":"value","in":"query","required":false,"schema":{"type":"string"},"description":"Omit to remove every TXT value at the host"}],"responses":{"200":{"description":"Values after the change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TxtSet"}}}}}}},"/health":{"get":{"summary":"Service health","operationId":"health","responses":{"200":{"description":"Healthy"},"503":{"description":"Unhealthy"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Account API key (sfx_...)"}},"parameters":{"Domain":{"name":"domain","in":"path","required":true,"schema":{"type":"string"}},"RecordId":{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},"TxtHost":{"name":"host","in":"query","required":false,"schema":{"type":"string","default":""},"description":"\"\" or \"@\" for the apex, else relative labels like _verify"}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"schemas":{"ErrorBody":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}}}}},"PaymentRequired":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"},{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri","description":"Present with `payment_required`. Short link for the principal; it opens\na live Stripe page for this order and does not expire.\n"},"checkout":{"type":"object","required":["id","url","domain","years","price_cents","amount_cents","status"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"domain":{"type":"string"},"years":{"type":"integer"},"price_cents":{"type":"integer","description":"Order price (what you accepted)."},"amount_cents":{"type":"integer","description":"Charged on the card; account credit covers the rest."},"status":{"type":"string","enum":["open","paid","refunded"]}}},"balance_cents":{"type":"integer"},"price_cents":{"type":"integer"}}}]},"Contact":{"type":"object","required":["firstName","lastName","address1","city","state","zip","country","email","phone"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"email":{"type":"string","format":"email"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$","description":"E.164, e.g. +15551234567"}}},"NameQuoteRequest":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"},"years":{"type":"integer","minimum":1,"maximum":10,"default":1}}},"NameQuote":{"type":"object","properties":{"ok":{"type":"boolean"},"domain":{"type":"string"},"years":{"type":"integer"},"available":{"type":"boolean"},"reason":{"type":"string","enum":["not_available","unsupported_inventory_class","term_not_offered","brand_impersonation","idn_not_supported"],"description":"Set when available is false. term_not_offered means retry with a different years value."},"premium":{"type":"boolean"},"price_cents":{"type":"integer","description":"Total for the requested years"},"renewal_cents":{"type":["integer","null"],"description":"Total to renew for the same number of years"},"currency":{"type":"string"}}},"RegisterRequest":{"type":"object","required":["domain","accept_price_cents","idempotency_key"],"properties":{"domain":{"type":"string"},"years":{"type":"integer","minimum":1,"maximum":10,"default":1},"accept_price_cents":{"type":"integer","description":"Must equal price_cents from /names/quote"},"idempotency_key":{"type":"string","minLength":8},"privacy":{"type":"boolean","default":true}}},"RegistrationResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"registration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domain":{"type":"string"},"years":{"type":"integer"},"status":{"type":"string","enum":["pending","registered","failed"]},"premium":{"type":"boolean"},"price_cents":{"type":"integer"},"error":{"type":["object","null"]},"refund":{"$ref":"#/components/schemas/Refund"},"created_at":{"type":"string","format":"date-time"}}}}},"Refund":{"type":["object","null"],"description":"Set on failed orders","properties":{"to_card_cents":{"type":"integer"},"to_credit_cents":{"type":"integer"},"card_status":{"type":["string","null"],"enum":["pending","succeeded","failed",null],"description":"failed means the card refund was refused and went to credit instead"}}},"RenewalResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"renewal":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domain":{"type":"string"},"years":{"type":"integer"},"status":{"type":"string","enum":["pending","renewed","failed"]},"trigger":{"type":"string","enum":["agent","auto"]},"premium":{"type":"boolean"},"price_cents":{"type":"integer"},"expires_at":{"type":["string","null"],"format":"date-time","description":"Expiry after this renewal"},"error":{"type":["object","null"]},"refund":{"$ref":"#/components/schemas/Refund"},"created_at":{"type":"string","format":"date-time"}}}}},"DomainResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"warning":{"type":"string"},"domain":{"type":"object","properties":{"domain":{"type":"string"},"created_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"auto_renew":{"type":"boolean"},"auto_renew_error":{"type":["string","null"]},"locked":{"type":["boolean","null"]},"locks":{"type":"array","items":{"type":"string"}},"privacy":{"type":["boolean","null"]},"nameservers":{"type":"array","items":{"type":"string"}},"dns_active":{"type":"boolean","description":"false when nameservers point away from Name.com, so DNS routes here do not affect resolution"},"contact_verification":{"type":"string","enum":["unknown","verified","unverified"]},"verify_by":{"type":["string","null"],"format":"date-time"}}}}},"DnsRecordType":{"type":"string","enum":["A","AAAA","ANAME","CNAME","MX","NS","SRV","TXT"]},"DnsRecordInput":{"type":"object","required":["type","answer"],"properties":{"type":{"$ref":"#/components/schemas/DnsRecordType"},"host":{"type":"string","default":"","description":"Relative to the zone; \"\" or \"@\" for the apex"},"answer":{"type":"string"},"ttl":{"type":"integer","minimum":300,"default":300},"priority":{"type":"integer","description":"Required for MX and SRV"}}},"TxtSet":{"type":"object","properties":{"ok":{"type":"boolean"},"host":{"type":"string"},"fqdn":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"changes":{"type":"object","properties":{"created":{"type":"integer"},"deleted":{"type":"integer"}}},"dns_active":{"type":"boolean","description":"false when the domain delegates to nameservers other than Name.com's, so these\nrecords do not affect resolution. Omitted if the nameserver lookup failed.\n"},"nameservers":{"type":"array","items":{"type":"string"},"description":"The outside nameservers, present only when dns_active is false."},"warning":{"type":"string","description":"Present only when dns_active is false; says where DNS is actually served."}}},"DnsStatus":{"type":"object","description":"Added to every DNS response.","properties":{"dns_active":{"type":"boolean","description":"false when the domain delegates to nameservers other than Name.com's, so these\nrecords do not affect resolution. Omitted if the nameserver lookup failed.\n"},"nameservers":{"type":"array","items":{"type":"string"},"description":"The outside nameservers, present only when dns_active is false."},"warning":{"type":"string","description":"Present only when dns_active is false; says where DNS is actually served."}}},"DnsRecord":{"type":"object","properties":{"id":{"type":"integer"},"type":{"$ref":"#/components/schemas/DnsRecordType"},"host":{"type":"string"},"fqdn":{"type":["string","null"]},"answer":{"type":"string"},"ttl":{"type":"integer"},"priority":{"type":["integer","null"]}}},"RegistrarSummary":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"adapter_maturity":{"type":"string","enum":["healthy","degraded","path_closed"],"description":"healthy = purchase-plan available; degraded = temporarily unavailable;\npath_closed = adapter exhaustively proven unavailable (terminal)\n"},"requires_sms":{"type":"boolean"},"requires_kyc":{"type":"boolean"},"auth_modes":{"type":"array","items":{"type":"string"}},"payment_modes":{"type":"array","items":{"type":"string"}}}},"Prerequisite":{"type":"object","required":["id","label","description","required"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"}}},"PlanStep":{"type":"object","required":["id","title","action"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"action":{"type":"string","enum":["http","browser","email.wait","payment.ensure","secret.store","secret.load","assert"]},"when":{"type":"string","description":"Optional branch predicate, e.g. account.exists == false"},"request":{"type":"object","additionalProperties":true},"expect":{"type":"object","additionalProperties":true},"on_fail":{"type":"string"}}},"PurchasePlanRequest":{"type":"object","required":["domain","registrar"],"properties":{"domain":{"type":"string"},"registrar":{"type":"string"},"optimize":{"type":"string","enum":["register","tco_2y","renew","year1"],"default":"register"},"accept_premium":{"type":"boolean","default":false},"accept_price_cents":{"type":"integer","nullable":true},"max_price_cents":{"type":"integer","nullable":true},"years":{"type":"integer","default":1},"agent_capabilities":{"type":"array","items":{"type":"string","enum":["http","email","payment","browser","secrets","sms"]}}}},"PurchasePlanResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"string","enum":["ready","needs_capability","needs_confirmation","unsupported","adapter_unhealthy"]},"domain":{"type":"string"},"registrar":{"type":"string"},"prerequisites":{"type":"array","items":{"$ref":"#/components/schemas/Prerequisite"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/PlanStep"}},"risks":{"type":"array","items":{"type":"string"}},"agreements":{"type":"array","items":{"type":"object","additionalProperties":true}},"missing_capabilities":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","description":"How far this plan has been proven. Agents must read this before buying.","properties":{"level":{"type":"string","enum":["template_unverified","documented_api_mock_tested","harness_mock_executed"]},"live_register_proven":{"type":"boolean"},"notes":{"type":"string"}}}}}}}}