# Request paths

> A purchase, a record change and a connection, step by step.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://domains.docs.sypnia.com/architecture/request-paths/

For agents: Domains request paths: purchase — POST /quotes (CheckDomainAvailability, ListPrices, 15-min quote) → POST /registrations (purchase scope + role; reserve credits in same transaction as operation) → RegisterDomain (registrant, privacy, registrar auto-renew off; Domains drives renewals) → poll GetOperationDetail; SUCCESSFUL → charge, create hosted zone, set name servers, connections; FAILED → release. Record change — validate batch, ownership check, store desired state + history → one ChangeResourceRecordSets, wait INSYNC (~1 min). Connection — ask product requirements, write owned records, subscribe to product events, remove on deletion.

## A purchase

1. `POST /v1/quotes` checks availability and price with Route 53 Domains (`CheckDomainAvailability`, `ListPrices`) and stores a quote for 15 minutes.
2. `POST /v1/registrations` checks the key's `purchase` scope and the member's role, then **reserves** the quote's total in the credit ledger in the same transaction that creates the operation.
3. The operations runner calls `RegisterDomain` with the registrant contact, privacy and auto-renew off at the registrar (renewals are driven by Domains, from credits), and stores Route 53's operation id.
4. It polls `GetOperationDetail` with backoff. On `SUCCESSFUL` it **charges** the reservation, creates the hosted zone, sets the name servers, and starts any requested connections. On `FAILED` it **releases** the reservation.

## A record change

1. `POST /v1/zones/{name}/changes` validates the batch, checks ownership (a change to a connection's record needs confirmation), and stores the new desired state with its history entry.
2. The DNS manager sends one `ChangeResourceRecordSets` batch and waits until Route 53 reports `INSYNC`, usually within a minute.

## A connection

1. The connections manager asks the target product (Run, Mail, Data, Files) for its requirements: records and validations.
2. It writes them as owned records, then subscribes to the product's events (certificate issued, domain verified, resource deleted).
3. On a deletion event it removes its records at once.
