# Extensions ## List extensions `client.registrar.extensions.list(ExtensionListParamsparams, RequestOptionsoptions?): CursorPagination` **get** `/accounts/{account_id}/registrar/extensions` Returns metadata and JSON Schema documents describing the expected input structure for registration operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed. ### Parameters - `params: ExtensionListParams` - `account_id: string` Path param: Identifier - `cursor?: string` Query param: Opaque token from a previous response's `result_info.cursor`. Pass this value to fetch the next page of results. Omit (or pass an empty string) for the first page. - `direction?: "asc" | "desc"` Query param: Sort direction for results. Defaults to ascending order. - `"asc"` - `"desc"` - `name?: string` Query param: Filter extensions by exact name match. For example, `name=com` returns only the `com` extension. - `per_page?: number` Query param: Number of items to return per page. - `sort_by?: "name" | "created_at" | "updated_at"` Query param: Column to sort results by. Defaults to `name` when omitted. - `"name"` - `"created_at"` - `"updated_at"` ### Returns - `ExtensionListResponse` Extension entry with metadata and JSON Schema documents for the registration operation. - `metadata: Metadata` Extension metadata - `name: string` The full name of the extension. For example, "co.uk", or "uk" - `tld: string` The tld of the extension. For example, for "co.uk", it's "uk". For "uk", it's "uk" - `registration_schema: unknown` JSON Schema describing the expected input structure for registration operations on this extension. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const extensionListResponse of client.registrar.extensions.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(extensionListResponse.metadata); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "metadata": { "name": "name", "tld": "tld" }, "registration_schema": {} } ], "success": true, "result_info": { "count": 0, "cursor": "cursor", "per_page": 0 } } ``` ## Get extension `client.registrar.extensions.get(stringextension, ExtensionGetParamsparams, RequestOptionsoptions?): ExtensionGetResponse` **get** `/accounts/{account_id}/registrar/extensions/{extension}` Returns metadata and JSON Schema documents describing the expected input structure for registration operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed. ### Parameters - `extension: string` - `params: ExtensionGetParams` - `account_id: string` Identifier ### Returns - `ExtensionGetResponse` Extension entry with metadata and JSON Schema documents for the registration operation. - `metadata: Metadata` Extension metadata - `name: string` The full name of the extension. For example, "co.uk", or "uk" - `tld: string` The tld of the extension. For example, for "co.uk", it's "uk". For "uk", it's "uk" - `registration_schema: unknown` JSON Schema describing the expected input structure for registration operations on this extension. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const extension = await client.registrar.extensions.get('com', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(extension.metadata); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "metadata": { "name": "name", "tld": "tld" }, "registration_schema": {} }, "success": true } ``` ## Domain Types ### Extension List Response - `ExtensionListResponse` Extension entry with metadata and JSON Schema documents for the registration operation. - `metadata: Metadata` Extension metadata - `name: string` The full name of the extension. For example, "co.uk", or "uk" - `tld: string` The tld of the extension. For example, for "co.uk", it's "uk". For "uk", it's "uk" - `registration_schema: unknown` JSON Schema describing the expected input structure for registration operations on this extension. ### Extension Get Response - `ExtensionGetResponse` Extension entry with metadata and JSON Schema documents for the registration operation. - `metadata: Metadata` Extension metadata - `name: string` The full name of the extension. For example, "co.uk", or "uk" - `tld: string` The tld of the extension. For example, for "co.uk", it's "uk". For "uk", it's "uk" - `registration_schema: unknown` JSON Schema describing the expected input structure for registration operations on this extension.