import type { RequestInit, RequestInfo } from "./internal/builtin-types.js"; import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from "./internal/types.js"; export type { Logger, LogLevel } from "./internal/utils/log.js"; import * as Opts from "./internal/request-options.js"; import * as Errors from "./core/error.js"; import * as Pagination from "./core/pagination.js"; import { type CursorLimitPaginationParams, CursorLimitPaginationResponse, type CursorPaginationAfterParams, CursorPaginationAfterResponse, type CursorPaginationParams, CursorPaginationResponse, SinglePageResponse, type V4PagePaginationArrayParams, V4PagePaginationArrayResponse, type V4PagePaginationParams, V4PagePaginationResponse } from "./core/pagination.js"; import * as Uploads from "./core/uploads.js"; import * as API from "./resources/index.js"; import { APIPromise } from "./core/api-promise.js"; import { AbuseReports } from "./resources/abuse-reports/abuse-reports.js"; import { Accounts } from "./resources/accounts/accounts.js"; import { ACM } from "./resources/acm/acm.js"; import { Addressing } from "./resources/addressing/addressing.js"; import { AIAudit } from "./resources/ai-audit/ai-audit.js"; import { AIGateway } from "./resources/ai-gateway/ai-gateway.js"; import { AISecurity } from "./resources/ai-security/ai-security.js"; import { AI } from "./resources/ai/ai.js"; import { AISearch } from "./resources/aisearch/aisearch.js"; import { Alerting } from "./resources/alerting/alerting.js"; import { AnalyticsQuery, AnalyticsQuerySummaryParams, AnalyticsQuerySummaryResponse, AnalyticsQueryTimeseriesParams, AnalyticsQueryTimeseriesResponse, AnalyticsQueryTopNParams, AnalyticsQueryTopNResponse, AnalyticsQueryTopNResponsesSinglePage } from "./resources/analytics-query/analytics-query.js"; import { APIGateway } from "./resources/api-gateway/api-gateway.js"; import { Argo } from "./resources/argo/argo.js"; import { AuditLogs } from "./resources/audit-logs/audit-logs.js"; import { Billing } from "./resources/billing/billing.js"; import { BotManagement } from "./resources/bot-management/bot-management.js"; import { BotnetFeed } from "./resources/botnet-feed/botnet-feed.js"; import { BrandProtection } from "./resources/brand-protection/brand-protection.js"; import { BrowserRendering } from "./resources/browser-rendering/browser-rendering.js"; import { Cache } from "./resources/cache/cache.js"; import { Calls } from "./resources/calls/calls.js"; import { CertificateAuthorities } from "./resources/certificate-authorities/certificate-authorities.js"; import { ClientCertificates } from "./resources/client-certificates/client-certificates.js"; import { CloudConnector } from "./resources/cloud-connector/cloud-connector.js"; import { CloudforceOne } from "./resources/cloudforce-one/cloudforce-one.js"; import { Connectivity } from "./resources/connectivity/connectivity.js"; import { ContentScanning } from "./resources/content-scanning/content-scanning.js"; import { CsamScanner } from "./resources/csam-scanner/csam-scanner.js"; import { CustomCertificates } from "./resources/custom-certificates/custom-certificates.js"; import { CustomCsrs } from "./resources/custom-csrs/custom-csrs.js"; import { CustomHostnames } from "./resources/custom-hostnames/custom-hostnames.js"; import { CustomNameservers } from "./resources/custom-nameservers/custom-nameservers.js"; import { CustomPages } from "./resources/custom-pages/custom-pages.js"; import { D1Resource } from "./resources/d1/d1.js"; import { DCVDelegation } from "./resources/dcv-delegation/dcv-delegation.js"; import { DDoSProtection } from "./resources/ddos-protection/ddos-protection.js"; import { Diagnostics } from "./resources/diagnostics/diagnostics.js"; import { DLS } from "./resources/dls/dls.js"; import { DNSFirewall } from "./resources/dns-firewall/dns-firewall.js"; import { DNS } from "./resources/dns/dns.js"; import { DurableObjects } from "./resources/durable-objects/durable-objects.js"; import { EmailAuth } from "./resources/email-auth/email-auth.js"; import { EmailRouting } from "./resources/email-routing/email-routing.js"; import { EmailSecurity } from "./resources/email-security/email-security.js"; import { EmailSending } from "./resources/email-sending/email-sending.js"; import { Filters } from "./resources/filters/filters.js"; import { Firewall } from "./resources/firewall/firewall.js"; import { Flagship } from "./resources/flagship/flagship.js"; import { Fraud } from "./resources/fraud/fraud.js"; import { GoogleTagGateway } from "./resources/google-tag-gateway/google-tag-gateway.js"; import { Healthchecks } from "./resources/healthchecks/healthchecks.js"; import { Hostnames } from "./resources/hostnames/hostnames.js"; import { HyperdriveResource } from "./resources/hyperdrive/hyperdrive.js"; import { IAM } from "./resources/iam/iam.js"; import { Images } from "./resources/images/images.js"; import { Intel } from "./resources/intel/intel.js"; import { IPs } from "./resources/ips/ips.js"; import { KeylessCertificates } from "./resources/keyless-certificates/keyless-certificates.js"; import { KV } from "./resources/kv/kv.js"; import { LeakedCredentialChecks } from "./resources/leaked-credential-checks/leaked-credential-checks.js"; import { LoadBalancers } from "./resources/load-balancers/load-balancers.js"; import { Logpush } from "./resources/logpush/logpush.js"; import { Logs } from "./resources/logs/logs.js"; import { MagicCloudNetworking } from "./resources/magic-cloud-networking/magic-cloud-networking.js"; import { MagicNetworkMonitoring } from "./resources/magic-network-monitoring/magic-network-monitoring.js"; import { MagicTransit } from "./resources/magic-transit/magic-transit.js"; import { ManagedTransforms } from "./resources/managed-transforms/managed-transforms.js"; import { Memberships } from "./resources/memberships/memberships.js"; import { MoQ } from "./resources/moq/moq.js"; import { MTLSCertificates } from "./resources/mtls-certificates/mtls-certificates.js"; import { NetworkInterconnects } from "./resources/network-interconnects/network-interconnects.js"; import { Organizations } from "./resources/organizations/organizations.js"; import { OriginCACertificates } from "./resources/origin-ca-certificates/origin-ca-certificates.js"; import { OriginPostQuantumEncryption } from "./resources/origin-post-quantum-encryption/origin-post-quantum-encryption.js"; import { OriginTLSClientAuth } from "./resources/origin-tls-client-auth/origin-tls-client-auth.js"; import { OriginTLSComplianceModes } from "./resources/origin-tls-compliance-modes/origin-tls-compliance-modes.js"; import { PageRules } from "./resources/page-rules/page-rules.js"; import { PageShield } from "./resources/page-shield/page-shield.js"; import { Pages } from "./resources/pages/pages.js"; import { Pipelines } from "./resources/pipelines/pipelines.js"; import { Precursor } from "./resources/precursor/precursor.js"; import { Queues } from "./resources/queues/queues.js"; import { R2DataCatalog } from "./resources/r2-data-catalog/r2-data-catalog.js"; import { R2 } from "./resources/r2/r2.js"; import { Radar } from "./resources/radar/radar.js"; import { RateLimits } from "./resources/rate-limits/rate-limits.js"; import { RealtimeKit } from "./resources/realtime-kit/realtime-kit.js"; import { RegistrarSandbox } from "./resources/registrar-sandbox/registrar-sandbox.js"; import { Registrar } from "./resources/registrar/registrar.js"; import { RequestTracers } from "./resources/request-tracers/request-tracers.js"; import { ResourceSharing } from "./resources/resource-sharing/resource-sharing.js"; import { ResourceTagging } from "./resources/resource-tagging/resource-tagging.js"; import { Rules } from "./resources/rules/rules.js"; import { Rulesets } from "./resources/rulesets/rulesets.js"; import { RUM } from "./resources/rum/rum.js"; import { SchemaValidation } from "./resources/schema-validation/schema-validation.js"; import { SecretsStore } from "./resources/secrets-store/secrets-store.js"; import { SecurityCenter } from "./resources/security-center/security-center.js"; import { SecurityTXT } from "./resources/security-txt/security-txt.js"; import { Snippets } from "./resources/snippets/snippets.js"; import { Spectrum } from "./resources/spectrum/spectrum.js"; import { Speed } from "./resources/speed/speed.js"; import { SSL } from "./resources/ssl/ssl.js"; import { Stream } from "./resources/stream/stream.js"; import { TenantCustomNameservers } from "./resources/tenant-custom-nameservers/tenant-custom-nameservers.js"; import { Tenants } from "./resources/tenants/tenants.js"; import { TokenValidation } from "./resources/token-validation/token-validation.js"; import { Turnstile } from "./resources/turnstile/turnstile.js"; import { URLNormalization } from "./resources/url-normalization/url-normalization.js"; import { URLScanner } from "./resources/url-scanner/url-scanner.js"; import { User } from "./resources/user/user.js"; import { Vectorize } from "./resources/vectorize/vectorize.js"; import { VulnerabilityScanner } from "./resources/vulnerability-scanner/vulnerability-scanner.js"; import { WaitingRooms } from "./resources/waiting-rooms/waiting-rooms.js"; import { Web3 } from "./resources/web3/web3.js"; import { WorkersForPlatforms } from "./resources/workers-for-platforms/workers-for-platforms.js"; import { Workers } from "./resources/workers/workers.js"; import { Workflows } from "./resources/workflows/workflows.js"; import { Zaraz } from "./resources/zaraz/zaraz.js"; import { ZeroTrust } from "./resources/zero-trust/zero-trust.js"; import { Zones } from "./resources/zones/zones.js"; import { type Fetch } from "./internal/builtin-types.js"; import { HeadersLike, NullableHeaders } from "./internal/headers.js"; import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js"; import { type LogLevel, type Logger } from "./internal/utils/log.js"; export interface ClientOptions { /** * The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/). */ apiToken?: string | null | undefined; /** * The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys. */ apiKey?: string | null | undefined; /** * The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key. */ apiEmail?: string | null | undefined; /** * Used when interacting with the Origin CA certificates API. [View/change your key](https://developers.cloudflare.com/fundamentals/api/get-started/ca-keys/#viewchange-your-origin-ca-keys). */ userServiceKey?: string | null | undefined; /** * Override the default base URL for the API, e.g., "https://api.example.com/v2/" * * Defaults to process.env['CLOUDFLARE_BASE_URL']. */ baseURL?: string | null | undefined; /** * The maximum amount of time (in milliseconds) that the client should wait for a response * from the server before timing out a single request. * * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. * * @unit milliseconds */ timeout?: number | undefined; /** * Additional `RequestInit` options to be passed to `fetch` calls. * Properties will be overridden by per-request `fetchOptions`. */ fetchOptions?: MergedRequestInit | undefined; /** * Specify a custom `fetch` function implementation. * * If not provided, we expect that `fetch` is defined globally. */ fetch?: Fetch | undefined; /** * The maximum number of times that the client will retry a request in case of a * temporary failure, like a network error or a 5XX error from the server. * * @default 2 */ maxRetries?: number | undefined; /** * Default headers to include with every request to the API. * * These can be removed in individual requests by explicitly setting the * header to `null` in request options. */ defaultHeaders?: HeadersLike | undefined; /** * Default query parameters to include with every request to the API. * * These can be removed in individual requests by explicitly setting the * param to `undefined` in request options. */ defaultQuery?: Record | undefined; /** * Set the log level. * * Defaults to process.env['CLOUDFLARE_LOG'] or 'warn' if it isn't set. */ logLevel?: LogLevel | undefined; /** * Set the logger. * * Defaults to globalThis.console. */ logger?: Logger | undefined; /** * Define the API version to target for the requests, e.g., "2025-01-01". * * Defaults to today's date. */ apiVersion?: string | null | undefined; } /** * Base class for Cloudflare API clients. */ export declare class BaseCloudflare { #private; apiToken: string | null; apiKey: string | null; apiEmail: string | null; userServiceKey: string | null; baseURL: string; maxRetries: number; timeout: number; logger: Logger; logLevel: LogLevel | undefined; fetchOptions: MergedRequestInit | undefined; apiVersion: string; private fetch; protected idempotencyHeader?: string; private _options; /** * API Client for interfacing with the Cloudflare API. * * @param {string | null | undefined} [opts.apiToken=process.env['CLOUDFLARE_API_TOKEN'] ?? null] * @param {string | null | undefined} [opts.apiKey=process.env['CLOUDFLARE_API_KEY'] ?? null] * @param {string | null | undefined} [opts.apiEmail=process.env['CLOUDFLARE_EMAIL'] ?? null] * @param {string | null | undefined} [opts.userServiceKey=process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] ?? null] * @param {string} [opts.baseURL=process.env['CLOUDFLARE_BASE_URL'] ?? https://api.cloudflare.com/client/v4] - Override the default base URL for the API. * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API. * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API. * @param {string | null} [opts.apiVersion] - Define the version to target for the API. */ constructor({ baseURL, apiVersion, apiToken, apiKey, apiEmail, userServiceKey, ...opts }?: ClientOptions); /** * Create a new client instance re-using the same options given to the current client with optional overriding. */ withOptions(options: Partial): this; protected defaultQuery(): Record | undefined; protected validateHeaders({ values, nulls }: NullableHeaders): void; protected authHeaders(opts: FinalRequestOptions): Promise; protected apiEmailAuth(opts: FinalRequestOptions): Promise; protected apiKeyAuth(opts: FinalRequestOptions): Promise; protected apiTokenAuth(opts: FinalRequestOptions): Promise; protected userServiceKeyAuth(opts: FinalRequestOptions): Promise; protected stringifyQuery(query: object | Record): string; private getUserAgent; protected defaultIdempotencyKey(): string; protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError; buildURL(path: string, query: Record | null | undefined, defaultBaseURL?: string | undefined): string; /** * Used as a callback for mutating the given `FinalRequestOptions` object. */ protected prepareOptions(options: FinalRequestOptions): Promise; /** * Used as a callback for mutating the given `RequestInit` object. * * This is useful for cases where you want to add certain headers based off of * the request properties, e.g. `method` or `url`. */ protected prepareRequest(request: RequestInit, { url, options }: { url: string; options: FinalRequestOptions; }): Promise; get(path: string, opts?: PromiseOrValue): APIPromise; post(path: string, opts?: PromiseOrValue): APIPromise; patch(path: string, opts?: PromiseOrValue): APIPromise; put(path: string, opts?: PromiseOrValue): APIPromise; delete(path: string, opts?: PromiseOrValue): APIPromise; private methodRequest; request(options: PromiseOrValue, remainingRetries?: number | null): APIPromise; private makeRequest; getAPIList = Pagination.AbstractPage>(path: string, Page: new (...args: any[]) => PageClass, opts?: PromiseOrValue): Pagination.PagePromise; requestAPIList = Pagination.AbstractPage>(Page: new (...args: ConstructorParameters) => PageClass, options: PromiseOrValue): Pagination.PagePromise; fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise; private shouldRetry; private retryRequest; private calculateDefaultRetryTimeoutMillis; buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: { retryCount?: number; }): Promise<{ req: FinalizedRequestInit; url: string; timeout: number; }>; private buildHeaders; private _makeAbort; private buildBody; static DEFAULT_TIMEOUT: number; } /** * API Client for interfacing with the Cloudflare API. */ export declare class Cloudflare extends BaseCloudflare { static Cloudflare: typeof Cloudflare; static CloudflareError: typeof Errors.CloudflareError; static APIError: typeof Errors.APIError; static APIConnectionError: typeof Errors.APIConnectionError; static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError; static APIUserAbortError: typeof Errors.APIUserAbortError; static NotFoundError: typeof Errors.NotFoundError; static ConflictError: typeof Errors.ConflictError; static RateLimitError: typeof Errors.RateLimitError; static BadRequestError: typeof Errors.BadRequestError; static AuthenticationError: typeof Errors.AuthenticationError; static InternalServerError: typeof Errors.InternalServerError; static PermissionDeniedError: typeof Errors.PermissionDeniedError; static UnprocessableEntityError: typeof Errors.UnprocessableEntityError; static toFile: typeof Uploads.toFile; accounts: API.Accounts; organizations: API.Organizations; tenants: API.Tenants; originCACertificates: API.OriginCACertificates; ips: API.IPs; memberships: API.Memberships; user: API.User; zones: API.Zones; loadBalancers: API.LoadBalancers; cache: API.Cache; ssl: API.SSL; acm: API.ACM; analyticsQuery: API.AnalyticsQuery; argo: API.Argo; certificateAuthorities: API.CertificateAuthorities; clientCertificates: API.ClientCertificates; customCertificates: API.CustomCertificates; customCsrs: API.CustomCsrs; customHostnames: API.CustomHostnames; customNameservers: API.CustomNameservers; tenantCustomNameservers: API.TenantCustomNameservers; dnsFirewall: API.DNSFirewall; dns: API.DNS; emailSecurity: API.EmailSecurity; emailAuth: API.EmailAuth; emailRouting: API.EmailRouting; emailSending: API.EmailSending; filters: API.Filters; firewall: API.Firewall; healthchecks: API.Healthchecks; keylessCertificates: API.KeylessCertificates; logpush: API.Logpush; logs: API.Logs; originTLSClientAuth: API.OriginTLSClientAuth; pageRules: API.PageRules; rateLimits: API.RateLimits; waitingRooms: API.WaitingRooms; web3: API.Web3; workers: API.Workers; kv: API.KV; durableObjects: API.DurableObjects; queues: API.Queues; apiGateway: API.APIGateway; managedTransforms: API.ManagedTransforms; pageShield: API.PageShield; rulesets: API.Rulesets; urlNormalization: API.URLNormalization; spectrum: API.Spectrum; addressing: API.Addressing; dls: API.DLS; auditLogs: API.AuditLogs; billing: API.Billing; brandProtection: API.BrandProtection; diagnostics: API.Diagnostics; images: API.Images; intel: API.Intel; magicTransit: API.MagicTransit; DDoSProtection: API.DDoSProtection; magicNetworkMonitoring: API.MagicNetworkMonitoring; magicCloudNetworking: API.MagicCloudNetworking; networkInterconnects: API.NetworkInterconnects; mtlsCertificates: API.MTLSCertificates; pages: API.Pages; /** * Registrar API for searching, checking, registering, and managing domains through Cloudflare Registrar. * * ## Prerequisites * * Before using this API, ensure: * * 1. **Cloudflare account** — the caller must have a valid Cloudflare account. * 2. **Billing profile** — the account must have a billing profile with a valid, * current default payment method (credit card or other accepted method). * This cannot be set up via API — the account owner must configure billing * at `https://dash.cloudflare.com/{account_id}/billing/payment-info` before * calling `POST /registrations`. * 3. **API authentication** — use an API token or API key with the appropriate * Registrar permissions for the operations you are calling. * * ## Terminology: domain extension * * Throughout this API, "extension" refers to the domain extension part of a fully * qualified domain name — the portion after the registrable label. For example, * in `example.co.uk`, the extension is `co.uk` (not just `uk`). This covers both * top-level domains like `com` and multi-level extensions like `co.uk`. This is * distinct from other uses of the word "extension" (e.g., EPP extensions). * * ## Supported extensions * * This API supports programmatic registration for all extensions supported by * the dashboard experience, with the following exceptions: * * `giving`, `mom`, `inc`, `lol`, `sh`, `link`, `cc`, `new` * * Cloudflare Registrar supports 400+ extensions in the dashboard. Extensions * listed above can be registered at `https://dash.cloudflare.com/{account_id}/domains/registrations`. * * ## Typical workflow * * 1. **Search** — call `GET /domain-search?q={keyword}` to discover available domains. * 2. **Check** — call `POST /domain-check` with candidate domains to verify real-time * availability and pricing. * 3. **Review the response** — if `registrable: false`, inspect `reason` to * understand whether the domain is unavailable, the extension is not supported * by this API, the extension is not supported by Cloudflare Registrar at all, * or the extension's registry has frozen new registrations. * 4. **Handle premium domains** — if `tier: premium`, premium registration is * not currently supported by this API. Surface the premium pricing to the user, * but do not proceed to `POST /registrations` for that domain. * 5. **Observe the registration schema** — call `GET /extensions/:extension_name` * to discover the required values for registering this extension. * 6. **Register** — call `POST /registrations` with the chosen domain name for * supported non-premium registrations. * 7. **Confirm completion** — if the response is `201 Created`, registration * completed within the default timeout and no polling is needed. * 8. **Poll when needed** — if the response is `202 Accepted`, poll * `links.self` from the workflow response. * 9. **Stop for user action** — if `state: action_required`, stop polling and * surface `context.action` to the user. * The workflow will not resolve on its own. * 10. **Continue when blocked** — if `state: blocked`, continue polling and * inform the user that a third party, such as the extension registry or losing * registrar, is delaying progress. * 11. **Review failures before retrying** — if `state: failed`, review * `error.code` and `error.message`, then decide whether user action or a new * Check call is needed. * * **All successful domain registrations are non-refundable.** Once the registration * workflow completes with `state: succeeded`, the charge cannot be reversed. * Confirm pricing and domain choice with the user before calling `POST /registrations`. * * ## Default behavior for mutating operations * * By default, mutating operations such as create and update hold the connection * for a bounded, server-defined amount of time while the operation completes. * In most cases, the response contains a completed workflow status and no * polling is required. * * - **Completed within the synchronous wait window:** Returns `201` (create) * or `200` (update) with a `workflow_status` where `state: succeeded` and * `completed: true`. * - **Still processing after the synchronous wait window:** Returns * `202 Accepted` with a `workflow_status` where `completed: false`. Use * the `links.self` URL to poll for completion. * * ## Non-blocking mode * * To receive an immediate `202 Accepted` response without waiting, send the * `Prefer: respond-async` request header (RFC 7240). The server will acknowledge * it with a `Preference-Applied: respond-async` response header. * * ## Polling * * When the response is `202`, poll the workflow status endpoint indicated by * `links.self` in the response body until the workflow reaches a terminal * state or requires user action. */ registrar: API.Registrar; /** * Use the Registrar Sandbox API to test domain search, availability checks, * registration, and domain management flows without buying real domains. * * **This API is a test environment for the production Registrar API.** * * ## Prerequisites * * Before using this API, make sure you have: * * 1. **Cloudflare account** — the caller must have a valid Cloudflare account. * 2. **API authentication** — create an API token with Registrar Sandbox permissions. * * ## How the Sandbox API differs from the production Registrar API * * Because the Sandbox API is intended for testing, it behaves differently from * the production Registrar API in a few important ways: * * 1. **No billing** — you will not be charged real money for purchasing a domain. * 2. **No real domains** — purchased domains are test records and will not be * reachable on the Internet. * 3. **No DNS zones** — purchasing a domain does not create a zone resource. * 4. **No Registration Express Mode** — you must provide full contact data. * * Sandbox purchases are still persisted. If you purchase a domain in the sandbox, * that domain will not be available for others to purchase in the sandbox. * * ## Terminology: domain extension * * Throughout this API, "extension" refers to the domain extension part of a fully * qualified domain name — the portion after the registrable label. For example, * in `example.co.uk`, the extension is `co.uk` (not just `uk`). This covers both * top-level domains like `com` and multi-level extensions like `co.uk`. This is * distinct from other uses of the word "extension" (e.g., EPP extensions). * * ## Supported extensions * * The Sandbox API currently supports programmatic registration for these * extensions: * * `com`, `net` * * The production Registrar API supports 40+ extensions. * * Cloudflare Registrar supports 400+ extensions in the dashboard. Extensions * not listed above can be registered at `https://dash.cloudflare.com/{account_id}/domains/registrations`. * * ## Typical workflow * * 1. **Search** — call `GET /domain-search?q={keyword}` to discover available domains. * 2. **Check** — call `POST /domain-check` with candidate domains to verify real-time * availability and pricing. * 3. **Review the response** — if `registrable: false`, inspect `reason` to * understand whether the domain is unavailable, the extension is not supported * by this API, the extension is not supported by Cloudflare Registrar at all, * or the extension's registry has frozen new registrations. * 4. **Handle premium domains** — if `tier: premium`, premium registration is * not currently supported by this API. The Sandbox API currently supports * only `com` and `net`, which do not have premium registrations, but clients * should still handle this response for consistency with the production * Registrar API. Surface the premium pricing to the user, but do not proceed * to `POST /registrations` for that domain. * 5. **Observe the registration schema** — call `GET /extensions/:extension_name` * to discover the required values for registering this extension. * 6. **Register** — call `POST /registrations` with the chosen domain name for * supported non-premium registrations. * 7. **Confirm completion** — if the response is `201 Created`, registration * completed within the default timeout and no polling is needed. * 8. **Poll when needed** — if the response is `202 Accepted`, poll * `links.self` from the workflow response. * 9. **Stop for user action** — if `state: action_required`, stop polling and * surface `context.action` to the user. * The workflow will not resolve on its own. * 10. **Continue when blocked** — if `state: blocked`, continue polling and * inform the user that a third party, such as the extension registry or losing * registrar, is delaying progress. * 11. **Review failures before retrying** — if `state: failed`, review * `error.code` and `error.message`, then decide whether user action or a new * Check call is needed. * * ## Default behavior for mutating operations * * By default, mutating operations such as create and update hold the connection * for a bounded, server-defined amount of time while the operation completes. * In most cases, the response contains a completed workflow status and no * polling is required. * * - **Completed within the synchronous wait window:** Returns `201` (create) * or `200` (update) with a `workflow_status` where `state: succeeded` and * `completed: true`. * - **Still processing after the synchronous wait window:** Returns * `202 Accepted` with a `workflow_status` where `completed: false`. Use * the `links.self` URL to poll for completion. * * ## Non-blocking mode * * To receive an immediate `202 Accepted` response without waiting, send the * `Prefer: respond-async` request header (RFC 7240). The server will acknowledge * it with a `Preference-Applied: respond-async` response header. * * ## Polling * * When the response is `202`, poll the workflow status endpoint indicated by * `links.self` in the response body until the workflow reaches a terminal * state or requires user action. */ registrarSandbox: API.RegistrarSandbox; requestTracers: API.RequestTracers; rules: API.Rules; stream: API.Stream; alerting: API.Alerting; d1: API.D1Resource; r2: API.R2; r2DataCatalog: API.R2DataCatalog; workersForPlatforms: API.WorkersForPlatforms; zeroTrust: API.ZeroTrust; turnstile: API.Turnstile; connectivity: API.Connectivity; hyperdrive: API.HyperdriveResource; rum: API.RUM; vectorize: API.Vectorize; urlScanner: API.URLScanner; vulnerabilityScanner: API.VulnerabilityScanner; radar: API.Radar; botManagement: API.BotManagement; fraud: API.Fraud; precursor: API.Precursor; originPostQuantumEncryption: API.OriginPostQuantumEncryption; originTLSComplianceModes: API.OriginTLSComplianceModes; googleTagGateway: API.GoogleTagGateway; zaraz: API.Zaraz; speed: API.Speed; dcvDelegation: API.DCVDelegation; hostnames: API.Hostnames; snippets: API.Snippets; realtimeKit: API.RealtimeKit; calls: API.Calls; moq: API.MoQ; cloudforceOne: API.CloudforceOne; aiGateway: API.AIGateway; flagship: API.Flagship; iam: API.IAM; cloudConnector: API.CloudConnector; botnetFeed: API.BotnetFeed; securityTXT: API.SecurityTXT; workflows: API.Workflows; resourceSharing: API.ResourceSharing; resourceTagging: API.ResourceTagging; leakedCredentialChecks: API.LeakedCredentialChecks; contentScanning: API.ContentScanning; aiSecurity: API.AISecurity; csamScanner: API.CsamScanner; abuseReports: API.AbuseReports; ai: API.AI; aiAudit: API.AIAudit; aiSearch: API.AISearch; securityCenter: API.SecurityCenter; browserRendering: API.BrowserRendering; customPages: API.CustomPages; secretsStore: API.SecretsStore; pipelines: API.Pipelines; schemaValidation: API.SchemaValidation; tokenValidation: API.TokenValidation; } export declare namespace Cloudflare { export type RequestOptions = Opts.RequestOptions; export import V4PagePagination = Pagination.V4PagePagination; export { type V4PagePaginationParams as V4PagePaginationParams, type V4PagePaginationResponse as V4PagePaginationResponse, }; export import V4PagePaginationArray = Pagination.V4PagePaginationArray; export { type V4PagePaginationArrayParams as V4PagePaginationArrayParams, type V4PagePaginationArrayResponse as V4PagePaginationArrayResponse, }; export import CursorPagination = Pagination.CursorPagination; export { type CursorPaginationParams as CursorPaginationParams, type CursorPaginationResponse as CursorPaginationResponse, }; export import CursorPaginationAfter = Pagination.CursorPaginationAfter; export { type CursorPaginationAfterParams as CursorPaginationAfterParams, type CursorPaginationAfterResponse as CursorPaginationAfterResponse, }; export import CursorLimitPagination = Pagination.CursorLimitPagination; export { type CursorLimitPaginationParams as CursorLimitPaginationParams, type CursorLimitPaginationResponse as CursorLimitPaginationResponse, }; export import SinglePage = Pagination.SinglePage; export { type SinglePageResponse as SinglePageResponse }; export { Accounts as Accounts }; export { Organizations as Organizations }; export { Tenants as Tenants }; export { OriginCACertificates as OriginCACertificates }; export { IPs as IPs }; export { Memberships as Memberships }; export { User as User }; export { Zones as Zones }; export { LoadBalancers as LoadBalancers }; export { Cache as Cache }; export { SSL as SSL }; export { ACM as ACM }; export { AnalyticsQuery as AnalyticsQuery, type AnalyticsQuerySummaryResponse as AnalyticsQuerySummaryResponse, type AnalyticsQueryTimeseriesResponse as AnalyticsQueryTimeseriesResponse, type AnalyticsQueryTopNResponse as AnalyticsQueryTopNResponse, type AnalyticsQueryTopNResponsesSinglePage as AnalyticsQueryTopNResponsesSinglePage, type AnalyticsQuerySummaryParams as AnalyticsQuerySummaryParams, type AnalyticsQueryTimeseriesParams as AnalyticsQueryTimeseriesParams, type AnalyticsQueryTopNParams as AnalyticsQueryTopNParams, }; export { Argo as Argo }; export { CertificateAuthorities as CertificateAuthorities }; export { ClientCertificates as ClientCertificates }; export { CustomCertificates as CustomCertificates }; export { CustomCsrs as CustomCsrs }; export { CustomHostnames as CustomHostnames }; export { CustomNameservers as CustomNameservers }; export { TenantCustomNameservers as TenantCustomNameservers }; export { DNSFirewall as DNSFirewall }; export { DNS as DNS }; export { EmailSecurity as EmailSecurity }; export { EmailAuth as EmailAuth }; export { EmailRouting as EmailRouting }; export { EmailSending as EmailSending }; export { Filters as Filters }; export { Firewall as Firewall }; export { Healthchecks as Healthchecks }; export { KeylessCertificates as KeylessCertificates }; export { Logpush as Logpush }; export { Logs as Logs }; export { OriginTLSClientAuth as OriginTLSClientAuth }; export { PageRules as PageRules }; export { RateLimits as RateLimits }; export { WaitingRooms as WaitingRooms }; export { Web3 as Web3 }; export { Workers as Workers }; export { KV as KV }; export { DurableObjects as DurableObjects }; export { Queues as Queues }; export { APIGateway as APIGateway }; export { ManagedTransforms as ManagedTransforms }; export { PageShield as PageShield }; export { Rulesets as Rulesets }; export { URLNormalization as URLNormalization }; export { Spectrum as Spectrum }; export { Addressing as Addressing }; export { DLS as DLS }; export { AuditLogs as AuditLogs }; export { Billing as Billing }; export { BrandProtection as BrandProtection }; export { Diagnostics as Diagnostics }; export { Images as Images }; export { Intel as Intel }; export { MagicTransit as MagicTransit }; export { DDoSProtection as DDoSProtection }; export { MagicNetworkMonitoring as MagicNetworkMonitoring }; export { MagicCloudNetworking as MagicCloudNetworking }; export { NetworkInterconnects as NetworkInterconnects }; export { MTLSCertificates as MTLSCertificates }; export { Pages as Pages }; export { Registrar as Registrar }; export { RegistrarSandbox as RegistrarSandbox }; export { RequestTracers as RequestTracers }; export { Rules as Rules }; export { Stream as Stream }; export { Alerting as Alerting }; export { D1Resource as D1Resource }; export { R2 as R2 }; export { R2DataCatalog as R2DataCatalog }; export { WorkersForPlatforms as WorkersForPlatforms }; export { ZeroTrust as ZeroTrust }; export { Turnstile as Turnstile }; export { Connectivity as Connectivity }; export { HyperdriveResource as HyperdriveResource }; export { RUM as RUM }; export { Vectorize as Vectorize }; export { URLScanner as URLScanner }; export { VulnerabilityScanner as VulnerabilityScanner }; export { Radar as Radar }; export { BotManagement as BotManagement }; export { Fraud as Fraud }; export { Precursor as Precursor }; export { OriginPostQuantumEncryption as OriginPostQuantumEncryption }; export { OriginTLSComplianceModes as OriginTLSComplianceModes }; export { GoogleTagGateway as GoogleTagGateway }; export { Zaraz as Zaraz }; export { Speed as Speed }; export { DCVDelegation as DCVDelegation }; export { Hostnames as Hostnames }; export { Snippets as Snippets }; export { RealtimeKit as RealtimeKit }; export { Calls as Calls }; export { MoQ as MoQ }; export { CloudforceOne as CloudforceOne }; export { AIGateway as AIGateway }; export { Flagship as Flagship }; export { IAM as IAM }; export { CloudConnector as CloudConnector }; export { BotnetFeed as BotnetFeed }; export { SecurityTXT as SecurityTXT }; export { Workflows as Workflows }; export { ResourceSharing as ResourceSharing }; export { ResourceTagging as ResourceTagging }; export { LeakedCredentialChecks as LeakedCredentialChecks }; export { ContentScanning as ContentScanning }; export { AISecurity as AISecurity }; export { CsamScanner as CsamScanner }; export { AbuseReports as AbuseReports }; export { AI as AI }; export { AIAudit as AIAudit }; export { AISearch as AISearch }; export { SecurityCenter as SecurityCenter }; export { BrowserRendering as BrowserRendering }; export { CustomPages as CustomPages }; export { SecretsStore as SecretsStore }; export { Pipelines as Pipelines }; export { SchemaValidation as SchemaValidation }; export { TokenValidation as TokenValidation }; export type ASN = API.ASN; export type AuditLog = API.AuditLog; export type CertificateCA = API.CertificateCA; export type CertificateRequestType = API.CertificateRequestType; export type CloudflareTunnel = API.CloudflareTunnel; export type ErrorData = API.ErrorData; export type Identifier = API.Identifier; export type LoadBalancerPreview = API.LoadBalancerPreview; export type Member = API.Member; export type PaginationInfo = API.PaginationInfo; export type Permission = API.Permission; export type PermissionGrant = API.PermissionGrant; export type RatePlan = API.RatePlan; export type ResponseInfo = API.ResponseInfo; export type Result = API.Result; export type Role = API.Role; export type SortDirection = API.SortDirection; export type Subscription = API.Subscription; export type SubscriptionComponent = API.SubscriptionComponent; export type SubscriptionZone = API.SubscriptionZone; export type Token = API.Token; export type TokenConditionCIDRList = API.TokenConditionCIDRList; export type TokenPolicy = API.TokenPolicy; export type TokenValue = API.TokenValue; } //# sourceMappingURL=client.d.ts.map