Cloudflare

Cloudflare API

Cloudflare API v4: manage accounts, zones, DNS, Workers, R2, WAF, Zero Trust, cache and more. Needs an API token.

Developer tools#openapi

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

The official OpenAPI description of the Cloudflare API v4 (https://api.cloudflare.com/client/v4), published by Cloudflare in cloudflare/api-schemas.

It covers account and zone management, DNS records, Workers and Pages, R2, KV, D1, WAF and firewall rules, cache, load balancing, Zero Trust, Radar and more.

Authenticate with an API token: Authorization: Bearer <token> (create one in the Cloudflare dashboard under My Profile → API Tokens). Older endpoints also accept X-Auth-Email + X-Auth-Key.

For the free, keyless connection check (/cdn-cgi/trace), see Cloudflare Trace API from the same publisher.

To get started using Cloudflare's products and services via the API, refer to how to interact with Cloudflare, which covers using tools like Terraform and the official SDKs to maintain your Cloudflare resources.

Using the Cloudflare API requires authentication so that Cloudflare knows who is making requests and what permissions you have. Create an API token to grant access to the API to perform actions. You can also authenticate with API keys, but these keys have several limitations that make them less secure than API tokens. Whenever possible, use API tokens to interact with the Cloudflare API.

To create an API token, from the Cloudflare dashboard, go to My Profile > API Tokens and select Create Token. For more information on how to create and troubleshoot API tokens, refer to
our API fundamentals.

For information regarding rate limits, refer to our API Rate Limits.

Totally new to Cloudflare? Start here.

Endpoints 400

Accounts

  • GETList Accounts/accounts?name=example.com&page=1&per_page=20&direction=descList all accounts you have ownership or verified access to.
  • POSTCreate an Account/accountsCreate an Account. To create the Account within an Organization, provide unit.id and omit standalone. To create a standalone Free Account, provide standalone:…
  • GETAccount Details/accounts/:account_idGet information about a specific account that you are a member of.
  • PUTUpdate Account/accounts/:account_idUpdate an existing account. Account names are limited to 65 UTF-8 bytes.
  • DELETEDelete a specific account/accounts/:account_idDelete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under…
  • POSTMove account to organization/accounts/:account_id/moveMove an account into a destination organization, either assigning a standalone account to an organization or moving it between organizations in the same…
  • GETList account organizations/accounts/:account_id/organizationsRetrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the…
  • GETGet account profile/accounts/:account_id/profileRetrieves the business profile (name, email, phone, address, and external metadata) associated with this account's customer record. Profiles can be shared…
  • PUTUpdate account profile/accounts/:account_id/profilePartially updates the business profile (name, email, phone, address, and external metadata) associated with this account's parent organization customer…

tseng-abuse-complaint-processor_other

  • GETList abuse reports against the account/accounts/:account_id/abuse-reports?page=0&per_page=0&sort=cdate,desc&search=example.com&domain=example.com&created_before=2009-11-10T23:00:00Z&created_after=2009-11-10T23:00:00Z&status=denied&type=denied&mitigation_status=active&pending_notice=trueList abuse reports made against domains or other content associated with the account. To list reports that the account submitted, use the submitted abuse…
  • GETList submitted abuse reports/accounts/:account_id/abuse-reports/submitted?page=1&per_page=100&sort=cdate,desc&id=string&domain=string&created_before=2024-01-01T00:00:00Z&created_after=2024-01-01T00:00:00Z&status=submitted&type=PHISHList abuse reports submitted by the account.
  • GETGet a submitted abuse report/accounts/:account_id/abuse-reports/submitted/:report_idRetrieve a report submitted by the account.
  • GETList emails sent to an abuse report submitter/accounts/:account_id/abuse-reports/submitted/:report_id/emails?page=0&per_page=0List successful emails sent to the submitter of a report submitted by the account. Does not include emails sent to customers or hosts.
  • GETCheck whether a report can be appealed/accounts/:account_id/abuse-reports/:report_id/appeals/eligibilityReturns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have…
  • GETList abuse report emails/accounts/:account_id/abuse-reports/:report_id/emails?page=0&per_page=0List emails sent to the customer for an abuse report. Returns all successful customer emails sent for the specified abuse report. Does not include emails sent…
  • GETList abuse report mitigations/accounts/:account_id/abuse-reports/:report_id/mitigations?page=0&per_page=0&sort=type,desc&type=string&effective_before=2009-11-10T23:00:00Z&effective_after=2009-11-10T23:00:00Z&status=pending&entity_type=url_patternList mitigations done to remediate the abuse report.
  • POSTRequest review on mitigations/accounts/:account_id/abuse-reports/:report_id/mitigations/appealRequest a review of mitigations applied because of an abuse report, or submit a report-level appeal. To request a review of specific mitigations, send appeals…
  • GETGet an abuse report against the account/accounts/:account_id/abuse-reports/:report_paramRetrieve the details of an abuse report made against a domain or other content associated with the account. To retrieve a report that the account submitted,…
  • POSTSubmit an abuse report/accounts/:account_id/abuse-reports/:report_paramSubmit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts…

MCP Portal Analytics

  • GETPer-portal MCP tool-call timeseries/accounts/:account_id/access/ai-controls/mcp/analytics/portals/:portal_id/tool-calls/timeseries?granularity=daily&aggregate=false&tz=utc&days=1&response_status=successReturns daily or monthly tool-call counts for a portal.
  • GETPer-server MCP tool-call timeseries/accounts/:account_id/access/ai-controls/mcp/analytics/servers/:server_id/tool-calls/timeseries?granularity=daily&aggregate=false&tz=utc&days=1&response_status=successReturns daily or monthly tool-call counts for a server.
  • GETAccount-global MCP tool-call timeseries/accounts/:account_id/access/ai-controls/mcp/analytics/tool-calls/timeseries?granularity=daily&aggregate=false&tz=utc&days=1&response_status=successReturns daily or monthly tool-call counts across the account.

MCP Portal

  • GETList MCP Portals/accounts/:account_id/access/ai-controls/mcp/portals?page=1&per_page=20&search=stringLists all MCP portals configured for the account.
  • POSTCreate a new MCP Portal/accounts/:account_id/access/ai-controls/mcp/portalsCreates a new MCP portal for managing AI tool access through Cloudflare Access.
  • GETRead details of an MCP Portal/accounts/:account_id/access/ai-controls/mcp/portals/:idRead the details of a single MCP Portal, including its configured servers.
  • PUTUpdate an MCP Portal/accounts/:account_id/access/ai-controls/mcp/portals/:idUpdates an MCP portal configuration.
  • DELETEDelete an MCP Portal/accounts/:account_id/access/ai-controls/mcp/portals/:idDeletes an MCP portal from the account.
  • GETResolve an MCP server OAuth redirect URI/accounts/:account_id/access/ai-controls/mcp/portals/:portal_id/servers/:server_id/effective-redirect-uriResolves the OAuth redirect URI to register for a portal and server based on the server's current shared callback setting. Use the returned value when setting…

MCP Portal Servers

  • GETList MCP Servers/accounts/:account_id/access/ai-controls/mcp/servers?page=1&per_page=20&search=stringLists all MCP servers configured for the account.
  • POSTCreate a new MCP Server/accounts/:account_id/access/ai-controls/mcp/serversCreates a new MCP server for connecting to an upstream MCP endpoint.
  • GETRead the details of an MCP Server/accounts/:account_id/access/ai-controls/mcp/servers/:idRetrieves an MCP server's configuration and capability sync state.
  • PUTUpdate an MCP Server/accounts/:account_id/access/ai-controls/mcp/servers/:idUpdates an MCP server's configuration and credentials.
  • DELETEDelete an MCP Server/accounts/:account_id/access/ai-controls/mcp/servers/:idDeletes an MCP server from the account.
  • POSTSync MCP Server Capabilities/accounts/:account_id/access/ai-controls/mcp/servers/:id/syncSyncs an MCP server's capabilities and returns the updated server state, including any connection errors.

Access applications

  • GETList Access applications/accounts/:account_id/access/apps?name=string&domain=string&aud=string&target_attributes=string&exact=true&search=string&page=1&per_page=1000Lists all Access applications in an account.
  • POSTAdd an Access application/accounts/:account_id/access/appsAdds a new application to Access.
  • GETGet an Access application/accounts/:account_id/access/apps/:app_idFetches information about an Access application.
  • PUTUpdate an Access application/accounts/:account_id/access/apps/:app_idUpdates an Access application.
  • DELETEDelete an Access application/accounts/:account_id/access/apps/:app_idDeletes an application from Access.
  • POSTRevoke application tokens/accounts/:account_id/access/apps/:app_id/revoke_tokensRevokes all tokens issued for an application.
  • PUTUpdate Access application settings/accounts/:account_id/access/apps/:app_id/settingsUpdates Access application settings.
  • PATCHUpdate Access application settings/accounts/:account_id/access/apps/:app_id/settingsUpdates Access application settings.
  • GETTest Access policies/accounts/:account_id/access/apps/:app_id/user_policy_checksTests if a specific user has permission to access an application.

Access short-lived certificate CAs

  • GETList short-lived certificate CAs/accounts/:account_id/access/apps/ca?page=1&per_page=100Lists short-lived certificate CAs and their public keys.
  • GETGet a short-lived certificate CA/accounts/:account_id/access/apps/:app_id/caFetches a short-lived certificate CA and its public key.
  • POSTCreate a short-lived certificate CA/accounts/:account_id/access/apps/:app_id/caGenerates a new short-lived certificate CA and public key.
  • DELETEDelete a short-lived certificate CA/accounts/:account_id/access/apps/:app_id/caDeletes a short-lived certificate CA.

Access application-scoped policies

  • GETList Access application policies/accounts/:account_id/access/apps/:app_id/policies?page=1&per_page=200Lists Access policies configured for an application. Returns both exclusively scoped and reusable policies used by the application.
  • POSTCreate an Access application policy/accounts/:account_id/access/apps/:app_id/policiesCreates a policy applying exclusive to a single application that defines the users or groups who can reach it. We recommend creating a reusable policy instead…
  • GETGet an Access application policy/accounts/:account_id/access/apps/:app_id/policies/:policy_idFetches a single Access policy configured for an application. Returns both exclusively owned and reusable policies used by the application.
  • PUTUpdate an Access application policy/accounts/:account_id/access/apps/:app_id/policies/:policy_idUpdates an Access policy specific to an application. To update a reusable policy, use the /accounts/{account_id}/policies/{uid} endpoint.
  • DELETEDelete an Access application policy/accounts/:account_id/access/apps/:app_id/policies/:policy_idDeletes an Access policy specific to an application. To delete a reusable policy, use the /accounts/{account_id}/policies/{uid} endpoint.
  • PUTConvert an Access application policy to a reusable policy/accounts/:account_id/access/apps/:app_id/policies/:policy_id/make_reusableConverts an application-scoped policy to a reusable policy. The policy will no longer be exclusively scoped to the application. Further updates to the policy…

Access Authenticator Device AAGUIDs

  • GETList authenticator device AAGUIDs/accounts/:account_id/access/authenticator_device_aaguidsReturns a list of Authenticator Device AAGUIDs for MFA configuration.

Access Bookmark applications (Deprecated)

  • GETList Bookmark applications/accounts/:account_id/access/bookmarksDeprecated. Lists Bookmark applications.
  • GETGet a Bookmark application/accounts/:account_id/access/bookmarks/:bookmark_idDeprecated. Fetches a single Bookmark application.
  • PUTUpdate a Bookmark application/accounts/:account_id/access/bookmarks/:bookmark_idDeprecated. Updates a configured Bookmark application.
  • POSTCreate a Bookmark application/accounts/:account_id/access/bookmarks/:bookmark_idDeprecated. Create a new Bookmark application.
  • DELETEDelete a Bookmark application/accounts/:account_id/access/bookmarks/:bookmark_idDeprecated. Deletes a Bookmark application.

Access mTLS authentication

  • GETList mTLS certificates/accounts/:account_id/access/certificates?page=1&per_page=50Lists all mTLS root certificates.
  • POSTAdd an mTLS certificate/accounts/:account_id/access/certificatesAdds a new mTLS root certificate to Access.
  • GETList all mTLS hostname settings/accounts/:account_id/access/certificates/settingsList all mTLS hostname settings for this account.
  • PUTUpdate an mTLS certificate's hostname settings/accounts/:account_id/access/certificates/settingsUpdates an mTLS certificate's hostname settings.
  • GETGet an mTLS certificate/accounts/:account_id/access/certificates/:certificate_idFetches a single mTLS certificate.
  • PUTUpdate an mTLS certificate/accounts/:account_id/access/certificates/:certificate_idUpdates a configured mTLS certificate.
  • DELETEDelete an mTLS certificate/accounts/:account_id/access/certificates/:certificate_idDeletes an mTLS certificate.

Access custom pages

  • GETList custom pages/accounts/:account_id/access/custom_pages?page=1&per_page=50List custom pages
  • POSTCreate a custom page/accounts/:account_id/access/custom_pagesCreate a custom page
  • POSTValidate a custom page template/accounts/:account_id/access/custom_pages/validateValidate a Liquid template and return its errors and warnings without persisting it.
  • GETGet a custom page/accounts/:account_id/access/custom_pages/:custom_page_idFetches a custom page and also returns its HTML.
  • PUTUpdate a custom page/accounts/:account_id/access/custom_pages/:custom_page_idUpdate a custom page
  • DELETEDelete a custom page/accounts/:account_id/access/custom_pages/:custom_page_idDelete a custom page

Gateway CA

  • GETList SSH Certificate Authorities (CA)/accounts/:account_id/access/gateway_caLists SSH Certificate Authorities (CA).
  • POSTAdd a new SSH Certificate Authority (CA)/accounts/:account_id/access/gateway_caAdds a new SSH Certificate Authority (CA).
  • DELETEDelete an SSH Certificate Authority (CA)/accounts/:account_id/access/gateway_ca/:certificate_idDeletes an SSH Certificate Authority.

Access groups

  • GETList Access groups/accounts/:account_id/access/groups?name=string&search=string&page=1&per_page=1000Lists all Access groups.
  • POSTCreate an Access group/accounts/:account_id/access/groupsCreates a new Access group.
  • GETGet an Access group/accounts/:account_id/access/groups/:group_idFetches a single Access group.
  • PUTUpdate an Access group/accounts/:account_id/access/groups/:group_idUpdates a configured Access group.
  • DELETEDelete an Access group/accounts/:account_id/access/groups/:group_idDeletes an Access group.

Access identity providers

  • GETList Access identity providers/accounts/:account_id/access/identity_providers?scim_enabled=true&page=1&per_page=200Lists all configured identity providers.
  • POSTAdd an Access identity provider/accounts/:account_id/access/identity_providersAdds a new identity provider to Access.
  • GETGet an Access identity provider/accounts/:account_id/access/identity_providers/:identity_provider_idFetches a configured identity provider.
  • PUTUpdate an Access identity provider/accounts/:account_id/access/identity_providers/:identity_provider_idUpdates a configured identity provider.
  • DELETEDelete an Access identity provider/accounts/:account_id/access/identity_providers/:identity_provider_idDeletes an identity provider from Access.
  • POSTCreate SAML encryption certificate for Identity Provider/accounts/:account_id/access/identity_providers/:identity_provider_id/saml_certificateCreates a new SAML encryption certificate set and assigns it to the specified SAML Identity Provider. This endpoint is idempotent - if the IdP already has a…
  • GETList SCIM Group resources/accounts/:account_id/access/identity_providers/:identity_provider_id/scim/groups?cf_resource_id=a2abeb50-59c9-4c01-8c5c-963d3bf5700f&idp_resource_id=all_employees&name=ALL_EMPLOYEES&page=1&per_page=100Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).
  • GETGet a SCIM Group resource/accounts/:account_id/access/identity_providers/:identity_provider_id/scim/groups/:group_idReturns a SCIM Group resource, including its direct members, synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).
  • DELETEDelete a SCIM Group resource/accounts/:account_id/access/identity_providers/:identity_provider_id/scim/groups/:group_idDeletes a SCIM Group resource from the identity provider's SCIM population.
  • GETList SCIM User resources/accounts/:account_id/access/identity_providers/:identity_provider_id/scim/users?cf_resource_id=bd97ef8d-7986-43e3-9ee0-c25dda33e4b0&idp_resource_id=john_smith_01&username=John Smith&email=john.smith@example.com&name=John Smith&page=1&per_page=100Lists SCIM User resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).
  • GETGet a SCIM User resource/accounts/:account_id/access/identity_providers/:identity_provider_id/scim/users/:user_idReturns a SCIM User resource synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).
  • DELETEDelete a SCIM User resource/accounts/:account_id/access/identity_providers/:identity_provider_id/scim/users/:user_idDeletes a SCIM User resource from the identity provider's SCIM population.

Access IdP federation grants

  • GETList IdP federation grants/accounts/:account_id/access/idp_federation_grantsLists the IdP federation grants owned by the account.
  • POSTCreate an IdP federation grant/accounts/:account_id/access/idp_federation_grantsCreates an IdP federation grant for the specified identity provider, making it available for federation to other accounts in the same Cloudflare organization.…
  • GETGet an IdP federation grant/accounts/:account_id/access/idp_federation_grants/:grant_idRetrieves a single IdP federation grant by its UID.
  • DELETEDelete an IdP federation grant/accounts/:account_id/access/idp_federation_grants/:grant_idDeletes an IdP federation grant. The identity provider remains in the account, but it is no longer available for federation to other accounts.

Access key configuration

  • GETGet the Access key configuration/accounts/:account_id/access/keysGets the Access key rotation settings for an account.
  • PUTUpdate the Access key configuration/accounts/:account_id/access/keysUpdates the Access key rotation settings for an account.
  • POSTRotate Access keys/accounts/:account_id/access/keys/rotatePerfoms a key rotation for an account.

Access authentication logs

  • GETGet Access authentication logs/accounts/:account_id/access/logs/access_requests?limit=25&direction=desc&since=2020-07-01T05:20:00Z&until=2020-10-01T05:20:00Z&page=1&per_page=25&email=user@example.com&email_exact=true&user_id=f757c5c3-c1b2-50f7-9126-150a099b6f7e&allowedOp=eq&country_codeOp=eq&app_typeOp=eq&app_uidOp=eq&ray_idOp=eq&emailOp=eq&idpOp=eq&non_identityOp=eq&user_idOp=eq&fields=action,allowed,app_name,country,created_at,ray_id,user_emailGets a list of Access authentication audit logs for an account.

Access JIT request logs

  • GETList Access JIT request logs/accounts/:account_id/access/logs/jit_requests?page=1&per_page=25&status=PENDING&search=string&since=2024-01-01T00:00:00Z&until=2024-01-01T00:00:00ZLists account-wide Access JIT request logs reconstructed from request lifecycle events.
  • GETGet an Access JIT request log/accounts/:account_id/access/logs/jit_requests/:knock_request_idGets an account-scoped Access JIT request summary and its lifecycle events in chronological order.

Access SCIM update logs

  • GETList Access SCIM update logs/accounts/:account_id/access/logs/scim/updates?limit=10&direction=desc&since=2025-01-01T00:00:00Z&until=2025-01-02T00:00:00Z&idp_id=df7e2w5f-02b7-4d9d-af26-8d1988fca630,0194ae2c-efcf-7cfb-8884-055f1a161fa5&status=FAILURE,SUCCESS&resource_type=USER,GROUP&request_method=DELETE,PATCH&resource_user_email=john.smith@example.com&resource_group_name=ALL_EMPLOYEES&cf_resource_id=bd97ef8d-7986-43e3-9ee0-c25dda33e4b0&idp_resource_id=all_employees&page=1&per_page=20Lists Access SCIM update logs that maintain a record of updates made to User and Group resources synced to Cloudflare via the System for Cross-domain Identity…

Zero Trust organization

  • GETGet your Zero Trust organization/accounts/:account_id/access/organizationsReturns the configuration for your Zero Trust organization.
  • PUTUpdate your Zero Trust organization/accounts/:account_id/access/organizationsUpdates the configuration for your Zero Trust organization.
  • POSTCreate your Zero Trust organization/accounts/:account_id/access/organizationsSets up a Zero Trust organization for your account.
  • PATCHPartially update your Zero Trust organization/accounts/:account_id/access/organizationsUpdates only the fields included in the request body. Omitted fields keep their current values. To clear mfa_config or mfa_piv_key_requirements, send the…
  • GETGet your Zero Trust organization DoH settings/accounts/:account_id/access/organizations/dohReturns the DoH settings for your Zero Trust organization.
  • PUTUpdate your Zero Trust organization DoH settings/accounts/:account_id/access/organizations/dohUpdates the DoH settings for your Zero Trust organization.
  • POSTRevoke all Access tokens for a user/accounts/:account_id/access/organizations/revoke_user?devices=trueRevokes a user's access across all applications.
  • GETGet Zero Trust organization trust settings/accounts/:account_id/access/organizations/trust_settingsReturns the trust settings for your Zero Trust organization.
  • PUTReplace Zero Trust organization trust settings/accounts/:account_id/access/organizations/trust_settingsReplaces the trust settings for your Zero Trust organization.
  • DELETEDelete Zero Trust organization trust settings/accounts/:account_id/access/organizations/trust_settingsResets the trust settings for your Zero Trust organization.
  • PATCHUpdate Zero Trust organization trust settings/accounts/:account_id/access/organizations/trust_settingsUpdates the trust settings for your Zero Trust organization.

Access reusable policies

  • GETList Access reusable policies/accounts/:account_id/access/policies?page=1&per_page=100Lists Access reusable policies.
  • POSTCreate an Access reusable policy/accounts/:account_id/access/policiesCreates a new Access reusable policy.
  • GETGet an Access reusable policy/accounts/:account_id/access/policies/:policy_idFetches a single Access reusable policy.
  • PUTUpdate an Access reusable policy/accounts/:account_id/access/policies/:policy_idUpdates a Access reusable policy.
  • DELETEDelete an Access reusable policy/accounts/:account_id/access/policies/:policy_idDeletes an Access reusable policy.

Access policy tester

  • POSTStart Access policy test/accounts/:account_id/access/policy-testsStarts an Access policy test.
  • GETGet the current status of a given Access policy test/accounts/:account_id/access/policy-tests/:policy_test_idFetches the current status of a given Access policy test.
  • GETGet an Access policy test users page/accounts/:account_id/access/policy-tests/:policy_test_id/users?page=1&per_page=25&status=successFetches a single page of user results from an Access policy test.

Access SAML encryption certificates

  • GETList SAML certificate sets/accounts/:account_id/access/saml_certificates?page=1&per_page=25&id=a5bb4b3f-c2d1-4e6a-8f9b-1d3e4f5a6b7c,f174e90a-fafe-4643-bbbc-4a0ed4fc8415Returns a paginated list of the organization's SAML encryption certificate sets. Each certificate set includes the current and (if present) previous…
  • GETGet SAML certificate set/accounts/:account_id/access/saml_certificates/:saml_cert_set_idRetrieves a specific SAML encryption certificate set by its UID, including both current and previous certificates if available.
  • GETDownload current certificate in PEM format/accounts/:account_id/access/saml_certificates/:saml_cert_set_id/pemDownloads the current SAML encryption certificate's public key in PEM format for the specified certificate set. This endpoint is useful for providing the…
  • POSTRotate SAML certificate/accounts/:account_id/access/saml_certificates/:saml_cert_set_id/rotateRotates the SAML encryption certificates within the specified certificate set. This generates a new certificate and moves the current certificate to the…

Zero Trust seats

  • PATCHUpdate a user seat/accounts/:account_id/access/seatsRemoves a user from a Zero Trust seat when both access_seat and gateway_seat are set to false.

Access service tokens

  • GETList service tokens/accounts/:account_id/access/service_tokens?name=string&search=string&page=1&per_page=1000Lists all service tokens.
  • POSTCreate a service token/accounts/:account_id/access/service_tokensGenerates a new service token. Note: This is the only time you can get the Client Secret. If you lose the Client Secret, you will have to rotate the Client…
  • GETGet a service token/accounts/:account_id/access/service_tokens/:service_token_idFetches a single service token.
  • PUTUpdate a service token/accounts/:account_id/access/service_tokens/:service_token_idUpdates a configured service token.
  • DELETEDelete a service token/accounts/:account_id/access/service_tokens/:service_token_idDeletes a service token.
  • POSTRefresh a service token/accounts/:account_id/access/service_tokens/:service_token_id/refreshRefreshes the expiration of a service token.
  • POSTRotate a service token/accounts/:account_id/access/service_tokens/:service_token_id/rotateGenerates a new Client Secret for a service token and revokes the old one.

Access tags

  • GETList tags/accounts/:account_id/access/tags?page=1&per_page=50List tags
  • POSTCreate a tag/accounts/:account_id/access/tagsCreate a tag
  • GETGet a tag/accounts/:account_id/access/tags/:tag_nameGet a tag
  • PUTUpdate a tag/accounts/:account_id/access/tags/:tag_nameUpdate a tag
  • DELETEDelete a tag/accounts/:account_id/access/tags/:tag_nameDelete a tag

Access user populations

  • GETList user populations/accounts/:account_id/access/user_populations?page=1&per_page=100Lists the user populations in an account.
  • POSTCreate a user population/accounts/:account_id/access/user_populationsCreates a user population in an account. Requires permission to update the account's Access organization.
  • GETGet a user population/accounts/:account_id/access/user_populations/:user_population_idFetches a user population.
  • PUTUpdate a user population/accounts/:account_id/access/user_populations/:user_population_idUpdates a user population's name.
  • DELETEDelete a user population/accounts/:account_id/access/user_populations/:user_population_idDeletes a user population that is not attached to an application.

Access user population users

  • GETList users in a user population/accounts/:account_id/access/user_populations/:user_population_id/users?filter=string&startIndex=1&count=0&attributes=string&excludedAttributes=stringLists SCIM users in a user population.
  • POSTCreate a user population user/accounts/:account_id/access/user_populations/:user_population_id/usersCreates a SCIM user in a user population.
  • GETGet a user population user/accounts/:account_id/access/user_populations/:user_population_id/users/:user_id?attributes=string&excludedAttributes=stringFetches a SCIM user from a user population.
  • PUTReplace a user population user/accounts/:account_id/access/user_populations/:user_population_id/users/:user_idReplaces a SCIM user in a user population.
  • DELETEDelete a user population user/accounts/:account_id/access/user_populations/:user_population_id/users/:user_idDeletes a SCIM user from a user population.
  • PATCHUpdate a user population user/accounts/:account_id/access/user_populations/:user_population_id/users/:user_idUpdates a SCIM user in a user population.

Zero Trust users

  • GETGet users/accounts/:account_id/access/users?name=string&email=string&search=string&page=1&per_page=1000Gets a list of users for an account.
  • POSTCreate a user/accounts/:account_id/access/usersCreates a new user.
  • GETGet a user/accounts/:account_id/access/users/:user_idGets a specific user for an account.
  • PUTUpdate a user/accounts/:account_id/access/users/:user_idUpdates a specific user's name for an account. Requires the user's current email as confirmation (email cannot be changed).
  • DELETEDelete a user/accounts/:account_id/access/users/:user_idDeletes a specific user for an account. This will also revoke any active seats and tokens for the user.
  • GETGet active sessions/accounts/:account_id/access/users/:user_id/active_sessionsGet active sessions for a single user.
  • GETGet single active session/accounts/:account_id/access/users/:user_id/active_sessions/:nonceGet an active session for a single user.
  • GETGet failed logins/accounts/:account_id/access/users/:user_id/failed_loginsGet all failed login attempts for a single user.
  • GETGet last seen identity/accounts/:account_id/access/users/:user_id/last_seen_identityGet last seen identity for a single user.
  • DELETEDelete a user's authenticator/accounts/:account_id/access/users/:user_id/mfa_authenticators/:authenticator_idDeletes a specific MFA device or passkey, including a PIV key or FIDO2 key enrollment, for a user. Admin deletion remains available when MFA is disabled.…
  • DELETEDelete a user's passkey/accounts/:account_id/access/users/:user_id/passkeys/:authenticator_idAlias of the authenticator deletion endpoint for passkey management. The identifier is the passkey's authenticator ID from the last-seen identity response.…

IP Address Management Address Maps

  • GETList Address Maps/accounts/:account_id/addressing/address_mapsList all address maps owned by the account.
  • POSTCreate Address Map/accounts/:account_id/addressing/address_mapsCreate a new address map under the account.
  • GETAddress Map Details/accounts/:account_id/addressing/address_maps/:address_map_idShow a particular address map owned by the account.
  • DELETEDelete Address Map/accounts/:account_id/addressing/address_maps/:address_map_idDelete a particular address map owned by the account. An Address Map must be disabled before it can be deleted.
  • PATCHUpdate Address Map/accounts/:account_id/addressing/address_maps/:address_map_idModify properties of an address map owned by the account.
  • PUTAdd an account membership to an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/accounts/:member_account_idAdd an account as a member of a particular address map.
  • DELETERemove an account membership from an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/accounts/:member_account_idRemove an account as a member of a particular address map.
  • POSTAdd Multiple IPs to an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/ipsAdd multiple IPs to a particular address map.
  • DELETERemove Multiple IPs from an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/ipsRemove multiple IPs from a particular address map.
  • PUTAdd an IP to an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/ips/:ip_addressAdd an IP from a prefix owned by the account to a particular address map.
  • DELETERemove an IP from an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/ips/:ip_addressRemove an IP from a particular address map.
  • POSTAdd Multiple Zones to an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/zonesAdd multiple zones as members of a particular address map.
  • DELETERemove Multiple Zones from an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/zonesRemove multiple zones as members of a particular address map.
  • PUTAdd a zone membership to an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/zones/:member_zone_idAdd a zone as a member of a particular address map.
  • DELETERemove a zone membership from an Address Map/accounts/:account_id/addressing/address_maps/:address_map_id/zones/:member_zone_idRemove a zone as a member of a particular address map.

IP Address Management Leases

  • GETList Leases/accounts/:account_id/addressing/leasesList all leases owned by the account.

IP Address Management Prefixes

  • GETList LOA Documents/accounts/:account_id/addressing/loa_documentsList all LOA documents uploaded under the account.
  • POSTUpload LOA Document/accounts/:account_id/addressing/loa_documentsSubmit LOA document (pdf format) under the account.
  • GETDownload LOA Document/accounts/:account_id/addressing/loa_documents/:loa_document_id/downloadDownload specified LOA document under the account.
  • GETList Prefixes/accounts/:account_id/addressing/prefixesList all prefixes owned by the account.
  • POSTAdd Prefix/accounts/:account_id/addressing/prefixesAdd a new prefix under the account.
  • GETPrefix Details/accounts/:account_id/addressing/prefixes/:prefix_idList a particular prefix owned by the account.
  • DELETEDelete Prefix/accounts/:account_id/addressing/prefixes/:prefix_idDelete an unapproved prefix owned by the account.
  • PATCHUpdate Prefix Description/accounts/:account_id/addressing/prefixes/:prefix_idModify the description for a prefix owned by the account.
  • POSTValidate Prefix/accounts/:account_id/addressing/prefixes/:prefix_id/validateTriggers a new prefix validation. The checks run asynchronously and include IRR, RPKI, prefix ownership, and, when applicable, ASN ownership and Autonomous…

IP Address Management BGP Prefixes

  • GETList BGP Prefixes/accounts/:account_id/addressing/prefixes/:prefix_id/bgp/prefixesList all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to control which specific subnets are advertised to the Internet. It is possible…
  • POSTCreate BGP Prefix/accounts/:account_id/addressing/prefixes/:prefix_id/bgp/prefixesCreate a BGP prefix, controlling the BGP advertisement status of a specific subnet. When created, BGP prefixes are initially withdrawn, and can be advertised…
  • GETFetch BGP Prefix/accounts/:account_id/addressing/prefixes/:prefix_id/bgp/prefixes/:bgp_prefix_idRetrieve a single BGP Prefix according to its identifier
  • DELETEDelete BGP Prefix/accounts/:account_id/addressing/prefixes/:prefix_id/bgp/prefixes/:bgp_prefix_idDelete a BGP Prefix associated with the specified IP Prefix. A BGP Prefix must be withdrawn before it can be deleted.
  • PATCHUpdate BGP Prefix/accounts/:account_id/addressing/prefixes/:prefix_id/bgp/prefixes/:bgp_prefix_idUpdate the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn).

IP Address Management Dynamic Advertisement

  • GETGet Advertisement Status/accounts/:account_id/addressing/prefixes/:prefix_id/bgp/statusDeprecated. View the current advertisement state for a prefix. Deprecated: Prefer the BGP Prefixes endpoints, which additionally allow for advertising and…
  • PATCHUpdate Prefix Dynamic Advertisement Status/accounts/:account_id/addressing/prefixes/:prefix_id/bgp/statusDeprecated. Advertise or withdraw the BGP route for a prefix. Deprecated: Prefer the BGP Prefixes endpoints, which additionally allow for advertising and…

IP Address Management Service Bindings

  • GETList Service Bindings/accounts/:account_id/addressing/prefixes/:prefix_id/bindingsList the Cloudflare services this prefix is currently bound to. Traffic sent to an address within an IP prefix will be routed to the Cloudflare service of the…
  • POSTCreate Service Binding/accounts/:account_id/addressing/prefixes/:prefix_id/bindingsCreates a new Service Binding, routing traffic to IPs within the given CIDR to a service running on Cloudflare's network. NOTE: The first Service Binding…
  • GETGet Service Binding/accounts/:account_id/addressing/prefixes/:prefix_id/bindings/:binding_idFetch a single Service Binding
  • DELETEDelete Service Binding/accounts/:account_id/addressing/prefixes/:prefix_id/bindings/:binding_idDelete a Service Binding
  • GETList Services/accounts/:account_id/addressing/servicesBring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a service running on the Cloudflare network to enable a Cloudflare product on the…

IP Address Management Prefix Delegation

  • GETList Prefix Delegations/accounts/:account_id/addressing/prefixes/:prefix_id/delegationsList all delegations for a given account IP prefix.
  • POSTCreate Prefix Delegation/accounts/:account_id/addressing/prefixes/:prefix_id/delegationsCreate a new account delegation for a given IP prefix.
  • DELETEDelete Prefix Delegation/accounts/:account_id/addressing/prefixes/:prefix_id/delegations/:delegation_idDelete an account delegation for a given IP prefix.

DLS Regional Services

  • GETList Regions/accounts/:account_id/addressing/regional_hostnames/regionsList all Regional Services regions available for use by this account.
  • GETList Regional Hostnames/zones/:zone_id/addressing/regional_hostnamesList all Regional Hostnames within a zone.
  • POSTCreate Regional Hostname/zones/:zone_id/addressing/regional_hostnamesCreate a new Regional Hostname entry. Cloudflare will only use data centers that are physically located within the chosen region to decrypt and service HTTPS…
  • GETFetch Regional Hostname/zones/:zone_id/addressing/regional_hostnames/:hostnameFetch the configuration for a specific Regional Hostname, within a zone.
  • DELETEDelete Regional Hostname/zones/:zone_id/addressing/regional_hostnames/:hostnameDelete the region configuration for a specific Regional Hostname.
  • PATCHUpdate Regional Hostname/zones/:zone_id/addressing/regional_hostnames/:hostnameUpdate the configuration for a specific Regional Hostname. Only the region_key of a hostname is mutable.

Namespaces

  • GETList namespaces/accounts/:account_id/agent-memory/namespaces?per_page=20&order=id&direction=asc&cursor=stringLists all namespaces for the given account. Results are paginated.
  • POSTCreate a namespace/accounts/:account_id/agent-memory/namespacesCreates a new memory namespace owned by the account.
  • GETGet a namespace/accounts/:account_id/agent-memory/namespaces/:namespace_nameGets a namespace by name.
  • DELETEDelete a namespace/accounts/:account_id/agent-memory/namespaces/:namespace_nameDeletes a namespace.

Memory

  • GETList profiles/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles?per_page=20&cursor=eyJ2IjoxLCJuIjoibXktcHJvZmlsZSJ9Lists the profiles of a namespace, ordered by name. A profile appears once it has been used.
  • DELETEDelete a profile/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_nameMarks a profile for deletion.
  • POSTIngest messages/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/ingestProcesses a conversation and extracts structured memories from it. Agent Memory identifies facts, events, instructions, and tasks automatically.
  • GETList memories/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/memories?per_page=20&cursor=01JSGCEXAMP1E0000000000000&session_id=chat-session-42&type=factList memories stored in a profile.
  • GETGet a memory/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/memories/:memory_idRetrieves a memory by ID.
  • DELETEDelete a memory/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/memories/:memory_idDeletes a memory by ID. Removes the memory and any source messages linked to it. Returns the deleted memory.
  • POSTRecall memories/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/recallRetrieves memories relevant to the query and returns a synthesized answer.
  • POSTRemember a memory/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/rememberStores a single memory explicitly.
  • DELETEDelete a session/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/sessions/:session_idMarks all memories and messages in a profile that are tagged with the given session ID for deletion.
  • POSTGet a profile summary/accounts/:account_id/agent-memory/namespaces/:namespace_name/profiles/:profile_name/summaryGenerates a paste-ready prompt block summarizing everything stored in a memory profile.

AI Gateway

  • GETGet credit balance/accounts/:account_id/ai-gateway/billing/credit-balanceRetrieve the current credit balance, payment method info, and top-up configuration.
  • GETGet invoice history/accounts/:account_id/ai-gateway/billing/invoice-history?type=allRetrieve a list of past invoices with pagination, optionally filtered by type.
  • GETGet invoice preview/accounts/:account_id/ai-gateway/billing/invoice-previewRetrieve a preview of the upcoming invoice including line items and tax.
  • GETGet spending limit (deprecated)/accounts/:account_id/ai-gateway/billing/spending-limitRetrieve the current spending limit configuration for the account.
  • POSTSet spending limit (deprecated)/accounts/:account_id/ai-gateway/billing/spending-limitDeprecated. Deprecated: spending limits can no longer be created, enabled, or modified and this endpoint always responds 403. Use the new AI Gateway spend…
  • DELETEDelete spending limit (deprecated)/accounts/:account_id/ai-gateway/billing/spending-limitRemove the spending limit for the account.
  • POSTCreate a top-up/accounts/:account_id/ai-gateway/billing/topupCreate a credit top-up for the given account, charged to the account's default payment method. Requires a dashboard session; API token, OAuth, and service…
  • GETGet auto top-up configuration/accounts/:account_id/ai-gateway/billing/topup/configRetrieve the current auto top-up threshold, amount, and any error state.
  • POSTSet auto top-up configuration/accounts/:account_id/ai-gateway/billing/topup/configConfigure auto top-up with a balance threshold and top-up amount. Requests that add a payment method first return authentication details. The configuration is…
  • DELETEDelete auto top-up configuration/accounts/:account_id/ai-gateway/billing/topup/configRemove the auto top-up configuration for the account. Dashboard sessions only: API token, OAuth, and service credentials are rejected with 403.
  • GETGet top-up eligibility (version 2)/accounts/:account_id/ai-gateway/billing/topup/eligibilityRead-only top-up eligibility, contract version 2: the account's payment methods and whether each can pay for a top-up, whether a manual top-up is available…
  • POSTGet top-up eligibility/accounts/:account_id/ai-gateway/billing/topup/eligibilityReturns legacy top-up eligibility from forwarded payment methods. Version 2 is read with GET; a body naming contract_version is rejected. No response…
  • GETGet account top-up limits/accounts/:account_id/ai-gateway/billing/topup/limitsRetrieve the minimum and maximum allowed top-up amounts (in cents) for this account.
  • POSTCheck top-up status/accounts/:account_id/ai-gateway/billing/topup/statusGet the payment processing status of a top-up by its top-up identifier.
  • GETGet usage history/accounts/:account_id/ai-gateway/billing/usage-history?value_grouping_window=day&start_time=1700000000000&end_time=1700086400000Retrieve AI Gateway usage cost, in US dollars, aggregated by hour or day for the given time range.
  • POSTSearch the web through AI Gateway/accounts/:account_id/ai/websearchRun a web search through a configured AI Gateway.

AI Gateway Custom Providers

  • GETList custom providers/accounts/:account_id/ai-gateway/custom-providers?page=1&per_page=20&beta=true&enable=true&search=stringLists the custom providers configured for the account, ordered by position and then name.
  • POSTCreate a custom provider/accounts/:account_id/ai-gateway/custom-providersCreates an account-level custom provider that forwards AI Gateway requests to the HTTPS base URL you supply. Requests reference the provider as custom-{slug},…
  • GETGet a custom provider/accounts/:account_id/ai-gateway/custom-providers/:idRetrieves a custom provider, including its slug, base URL, and custom headers.
  • DELETEDelete a custom provider/accounts/:account_id/ai-gateway/custom-providers/:idDeletes a custom provider and every pricing rule that belongs to it.
  • PATCHUpdate a custom provider/accounts/:account_id/ai-gateway/custom-providers/:idUpdates the specified fields of a custom provider. Changes clear cached entries for the provider.

AI Gateway Custom Provider Costs

  • GETList custom provider pricing rules/accounts/:account_id/ai-gateway/custom-providers/costs?page=1&per_page=20&enable=true&account_provider_id=3fa85f64-5717-4562-b3fc-2c963f66afa6&model_rule=equals&cost_type=tokens&search=stringLists the pricing rules for custom providers in the account, most recently modified first.
  • POSTCreate a custom provider pricing rule/accounts/:account_id/ai-gateway/custom-providers/costsCreates a pricing rule that sets per-token costs for models matched on a custom provider. AI Gateway uses these rules to calculate request costs.
  • GETGet a custom provider pricing rule/accounts/:account_id/ai-gateway/custom-providers/costs/:idRetrieves a custom provider pricing rule, including its model match rule and token prices.
  • DELETEDelete a custom provider pricing rule/accounts/:account_id/ai-gateway/custom-providers/costs/:idDeletes a custom provider pricing rule. Requests to the matched model stop using its prices.
  • PATCHUpdate a custom provider pricing rule/accounts/:account_id/ai-gateway/custom-providers/costs/:idUpdates the specified fields of a custom provider pricing rule. Changes clear cached costs for the matched model.

AI Gateway Evaluations

  • GETList evaluator types (deprecated)/accounts/:account_id/ai-gateway/evaluation-types?page=1&per_page=20&order_by=mandatory&order_by_direction=descLists the evaluator types that evaluations can use to score AI Gateway responses. Evaluations are deprecated and unavailable to new accounts.
  • GETList evaluations (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/evaluations?page=1&per_page=20&name=string&processed=true&search=stringLists the evaluations run on an AI Gateway. Evaluations and datasets are deprecated and unavailable to new accounts.
  • POSTCreate an evaluation (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/evaluationsCreates an evaluation that scores the logs in a dataset with the specified evaluator types. Evaluations and datasets are deprecated and unavailable to new…
  • GETGet an evaluation (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/evaluations/:idRetrieves an evaluation and its results. Evaluations and datasets are deprecated and unavailable to new accounts.
  • DELETEDelete an evaluation (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/evaluations/:idDeletes an evaluation and its results. Evaluations and datasets are deprecated and unavailable to new accounts.

AI Gateway Gateways

  • GETList gateways/accounts/:account_id/ai-gateway/gateways?page=1&per_page=20&search=stringLists the AI Gateways in the account. Use search to filter by gateway ID.
  • POSTCreate a gateway/accounts/:account_id/ai-gateway/gatewaysCreates an AI Gateway in the account with the specified caching, rate limiting, logging, and authentication settings. The gateway ID appears in request URLs…
  • GETGet Gateway URL/accounts/:account_id/ai-gateway/gateways/:gateway_id/url/:providerRetrieves the endpoint URL for an AI Gateway.
  • GETGet a gateway/accounts/:account_id/ai-gateway/gateways/:idRetrieves the configuration of an AI Gateway.
  • PUTUpdate a gateway/accounts/:account_id/ai-gateway/gateways/:idUpdates the configuration of an AI Gateway, such as its caching, rate limiting, spend limits, logging, and authentication settings.
  • DELETEDelete a gateway/accounts/:account_id/ai-gateway/gateways/:idPermanently deletes an AI Gateway, its configuration, and its stored logs.

AI Gateway Custom Domains

  • GETList custom domains/accounts/:account_id/ai-gateway/gateways/:gateway_id/custom-domains?page=1&per_page=20&status=initializing&search=stringLists the custom domains attached to an AI Gateway, including the certificate and validation status of each domain.
  • POSTCreate a custom domain for a gateway/accounts/:account_id/ai-gateway/gateways/:gateway_id/custom-domainsProvisions a Cloudflare-for-SaaS custom hostname and returns the CNAME target to point DNS at.
  • GETGet a custom domain/accounts/:account_id/ai-gateway/gateways/:gateway_id/custom-domains/:hostnameRetrieves a custom domain attached to an AI Gateway, including its status and CNAME target.
  • DELETEDelete a custom domain/accounts/:account_id/ai-gateway/gateways/:gateway_id/custom-domains/:hostnameDeletes a custom domain from an AI Gateway and removes its Cloudflare for SaaS custom hostname.

AI Gateway Datasets

  • GETList datasets (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/datasets?page=1&per_page=20&name=string&enable=true&search=stringLists the datasets defined for an AI Gateway. Evaluations and datasets are deprecated and unavailable to new accounts.
  • POSTCreate a dataset (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/datasetsCreates a dataset that selects gateway logs matching the specified filters for use in evaluations. Evaluations and datasets are deprecated and unavailable to…
  • GETGet a dataset (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/datasets/:idRetrieves a dataset and its log filters. Evaluations and datasets are deprecated and unavailable to new accounts.
  • PUTUpdate a dataset (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/datasets/:idReplaces the name, log filters, and enabled state of a dataset. Evaluations and datasets are deprecated and unavailable to new accounts.
  • DELETEDelete a dataset (deprecated)/accounts/:account_id/ai-gateway/gateways/:gateway_id/datasets/:idDeletes a dataset. Evaluations and datasets are deprecated and unavailable to new accounts.

AI Gateway Logs

  • GETList Gateway Logs/accounts/:account_id/ai-gateway/gateways/:gateway_id/logs?search=string&page=1&per_page=20&order_by=created_at&order_by_direction=desc&filters={"key":"id","operator":"eq","value":["string"]}&meta_info=true&direction=asc&start_date=2024-01-01T00:00:00Z&end_date=2024-01-01T00:00:00Z&min_cost=0.0&max_cost=0.0&min_tokens_in=0.0&max_tokens_in=0.0&min_tokens_out=0.0&max_tokens_out=0.0&min_total_tokens=0.0&max_total_tokens=0.0&min_duration=0.0&max_duration=0.0&feedback=-1&success=true&cached=true&model=string&model_type=string&provider=string&request_content_type=string&response_content_type=stringLists request/response log entries for the AI gateway with filtering and pagination.
  • DELETEDelete Gateway Logs/accounts/:account_id/ai-gateway/gateways/:gateway_id/logs?order_by=created_at&order_by_direction=asc&filters={"key":"id","operator":"eq","value":["string"]}&limit=10000Deletes gateway log entries matching the specified criteria.
  • GETGet Gateway Log Detail/accounts/:account_id/ai-gateway/gateways/:gateway_id/logs/:idRetrieves detailed information for a specific AI Gateway log entry.
  • PATCHPatch Gateway Log/accounts/:account_id/ai-gateway/gateways/:gateway_id/logs/:idUpdates metadata for an AI Gateway log entry.
  • GETGet Gateway Log Request/accounts/:account_id/ai-gateway/gateways/:gateway_id/logs/:id/requestRetrieves the original request payload for an AI Gateway log entry.
  • GETGet Gateway Log Response/accounts/:account_id/ai-gateway/gateways/:gateway_id/logs/:id/responseRetrieves the response payload for an AI Gateway log entry.

AI Gateway Provider Configs

  • GETList provider keys/accounts/:account_id/ai-gateway/gateways/:gateway_id/provider_configs?page=1&per_page=20Lists the provider keys stored for an AI Gateway. Responses show a masked preview of each key, never the key itself.
  • POSTStore a provider key/accounts/:account_id/ai-gateway/gateways/:gateway_id/provider_configsStores an upstream AI provider API key for an AI Gateway in the Secrets Store configured on the gateway, with an optional rate limit. Pass secret to store a…
  • GETGet a provider key/accounts/:account_id/ai-gateway/gateways/:gateway_id/provider_configs/:idRetrieves a provider key configuration for an AI Gateway. The response shows a masked preview of the key, never the key itself.
  • PUTRotate a provider key/accounts/:account_id/ai-gateway/gateways/:gateway_id/provider_configs/:idReplaces the stored API key of a provider key configuration. Only the key can change.
  • DELETEDelete a provider key/accounts/:account_id/ai-gateway/gateways/:gateway_id/provider_configs/:idDeletes a provider key configuration from an AI Gateway and deletes its secret from the Secrets Store.
  • POSTCheck stored provider credentials/accounts/:account_id/ai-gateway/gateways/:gateway_id/provider_configs/:id/testChecks whether stored credentials can list models through the provider implementation in AI Gateway. Requires AI Gateway content update permission. Does not…

AI Gateway Dynamic Routes

  • GETList dynamic routes/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes?page=1&per_page=20Lists the dynamic routes configured on an AI Gateway.
  • POSTCreate a dynamic route/accounts/:account_id/ai-gateway/gateways/:gateway_id/routesCreates a dynamic route on an AI Gateway from the specified routing elements. Clients call the route by using dynamic/{name} as the model name.
  • GETGet a dynamic route/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:idRetrieves a dynamic route with its routing elements, active version, and current deployment.
  • DELETEDelete a dynamic route/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:idDeletes a dynamic route from an AI Gateway.
  • PATCHRename a dynamic route/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:idUpdates the name of a dynamic route. To change routing behaviour, create and deploy a new version.
  • GETList dynamic route deployments/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:id/deployments?page=1&per_page=20Lists the deployment history of a dynamic route.
  • POSTDeploy a dynamic route version/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:id/deploymentsDeploys the specified version of a dynamic route so that it serves traffic. Deploy an earlier version to roll back.
  • GETList dynamic route versions/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:id/versions?page=1&per_page=20Lists the saved versions of a dynamic route.
  • POSTCreate a dynamic route version/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:id/versionsCreates a new version of a dynamic route from the specified routing elements. The version does not serve traffic until you deploy it.
  • GETGet a dynamic route version/accounts/:account_id/ai-gateway/gateways/:gateway_id/routes/:id/versions/:version_idRetrieves a saved version of a dynamic route, including its routing elements.

Account

  • GETGet AI Gateway logging state/accounts/:account_id/ai-gateway/logging-stateReturns the canonical logging platform and migration availability for an account.
  • PATCHMigrate AI Gateway logging to Workers Observability/accounts/:account_id/ai-gateway/logging-stateIrreversibly migrates an eligible account to Workers Observability logging.
  • GETGet build-minute availability/accounts/:account_id/builds/account/limitsReturn whether the account's build-minute allowance is exhausted and when it refreshes.
  • GETGet live account usage/accounts/:account_id/containers/usageGet current live resource usage and maximum limits for your account. Usage includes active and assigned instances.

AI Search Instances

  • GETList AI Search instances./accounts/:account_id/ai-search/instances?page=1&per_page=20&search=string&hostname=string&namespace=string&order_by=created_at&order_by_direction=descDeprecated. Lists all AI Search instances in the account. Deprecated: use /accounts/{account_id}/ai-search/namespaces/{namespace}/instances (and descendant…
  • POSTCreate an AI Search instance./accounts/:account_id/ai-search/instancesDeprecated. Create a new AI Search instance with the given configuration. If type is omitted or null, a non-blank HTTP(S) source infers web-crawler and any…
  • GETGet an AI Search instance./accounts/:account_id/ai-search/instances/:idDeprecated. Retrieve the configuration and status of an AI Search instance. Deprecated: use /accounts/{account_id}/ai-search/namespaces/{namespace}/instances…
  • PUTUpdate an AI Search instance./accounts/:account_id/ai-search/instances/:idDeprecated. Updates the configuration of an AI Search instance. Deprecated: use /accounts/{account_id}/ai-search/namespaces/{namespace}/instances (and…
  • DELETEDelete an AI Search instance./accounts/:account_id/ai-search/instances/:idDeprecated. Deletes an AI Search instance and all its indexed data permanently. Deprecated: use…
  • POSTChat Completions/accounts/:account_id/ai-search/instances/:id/chat/completionsDeprecated. Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses. Deprecated: use…
  • POSTSearch/accounts/:account_id/ai-search/instances/:id/searchDeprecated. Executes a semantic search query against an AI Search instance to find relevant indexed content. Deprecated: use…

Showing 300 of 400 endpoints. Fork the collection to see all of them.

API details

Base URL
https://api.cloudflare.com/client/v4
Authentication
An API key in the X-Auth-Email header
An API key in the X-Auth-Key header
A bearer token in the Authorization header
An API key in the X-Auth-User-Service-Key header
Operations
3773 operations on 2352 pathsGET 1843POST 800DELETE 486PUT 368PATCH 276
316 marked deprecated
Main resources
Email Security Settings 53dos-flowtrackd-api_other 45Radar HTTP 41Brand Protection 35Event 35R2 Bucket 34Threat Signals 32Workflows 31Devices 30Zone Settings 29
Response formats
application/json application/octet-stream application/pdf text/html
Description format
OpenAPI 3.0.3, API version 4.0.0

How to test the Cloudflare API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Cloudflare API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the X-Auth-Email header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “List Accounts” (GET /accounts?name=example.com&page=1&per_page=20&direction=desc), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Cloudflare API?

Cloudflare API v4: manage accounts, zones, DNS, Workers, R2, WAF, Zero Trust, cache and more. Needs an API token. It is listed under Developer tools and has 3773 endpoints.

Who publishes the Cloudflare API?

It is listed from Cloudflare's public API description (an OpenAPI document), not published by Cloudflare on Swastik Codes. Anyone who controls cloudflare.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Cloudflare API?

Requests go to https://api.cloudflare.com/client/v4. Endpoint paths are added to this base URL.

How do I authenticate with the Cloudflare API?

It accepts 4 methods: an API key in the X-Auth-Email header; an API key in the X-Auth-Key header; A bearer token in the Authorization header; an API key in the X-Auth-User-Service-Key header.

How many endpoints does the Cloudflare API have?

3773 operations on 2352 paths (1843 GET, 800 POST, 486 DELETE, 368 PUT, 276 PATCH). The largest groups are Email Security Settings, dos-flowtrackd-api_other, Radar HTTP, Brand Protection. This listing's collection holds the first 400.

Is forking the Cloudflare API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.