{"openapi":"3.0.0","info":{"description":"Cloudflare Workers API — scripts, routes, domains, subdomain, cron, tails, ai-account, observability.","version":[]},"servers":[{"description":"Cloudflare Workers API — scripts, routes, domains, subdomain, cron, tails, ai-account, observability.","url":"https://api.apirails.com/cloudflare-workers"}],"paths":{"/client/v4/accounts/{account_id}/workers/account-settings":{"get":{"tags":["Worker Account Settings"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/account-settings"},"summary":"Fetch Worker Account Settings","description":"Fetches Worker account settings for an account.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Account Settings"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/account-settings"},"summary":"Create Worker Account Settings","description":"Creates Worker account settings for an account.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"default_usage_model":{"type":"string","description":"Default usage model"},"green_compute":{"type":"boolean","description":"Green compute","enum":[true,false]}}},"example":{"default_usage_model":"","green_compute":""}}}}}},"/client/v4/accounts/{account_id}/workers/domains":{"get":{"tags":["Domains"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"environment","in":"query","description":"Worker environment associated with the domain.","required":false,"schema":{"type":"string","example":""}},{"name":"hostname","in":"query","description":"Hostname of the domain.","required":false,"schema":{"type":"string","example":""}},{"name":"service","in":"query","description":"Name of the Worker associated with the domain.","required":false,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"query","description":"ID of the zone containing the domain hostname.","required":false,"schema":{"type":"string","example":""}},{"name":"zone_name","in":"query","description":"Name of the zone containing the domain hostname.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/domains"},"summary":"List Domains","description":"Lists all domains for an account.","security":[{"bearerAuth":[]}]},"put":{"tags":["Domains"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/domains"},"summary":"Attach Domain","description":"Attaches a domain that routes traffic to a Worker.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cert_id":{"type":"string","description":"ID of the TLS certificate issued for the domain.","required":true},"environment":{"type":"string","description":"Worker environment associated with the domain.","required":true},"hostname":{"type":"string","description":"Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.","required":true},"id":{"type":"string","description":"Immutable ID of the domain.","required":true},"service":{"type":"string","description":"Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.","required":true},"zone_id":{"type":"string","description":"ID of the zone containing the domain hostname.","required":true},"zone_name":{"type":"string","description":"Name of the zone containing the domain hostname.","required":true}}},"example":{"cert_id":"9fdf92c8-64c2-4a3d-b1af-e15304961145","environment":"production","hostname":"app.example.com","id":"dbe10b4bc17c295377eabd600e1787fd","service":"my-worker","zone_id":"593c9c94de529bbbfaac7c53ced0447d","zone_name":"example.com"}}}}}},"/client/v4/accounts/{account_id}/workers/domains/{domain_id}":{"get":{"tags":["Domains"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"domain_id","in":"path","description":"ID of the domain.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/domains/{domain_id}"},"summary":"Get Domain","description":"Gets information about a domain.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Domains"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"domain_id","in":"path","description":"ID of the domain.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/domains/{domain_id}"},"summary":"Detach Domain","description":"Detaches a domain from a Worker. Both the Worker and all of its previews are no longer routable using this domain.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/durable_objects/namespaces":{"get":{"tags":["Durable Objects Namespace"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"page","in":"query","description":"Current page.","required":false,"schema":{"type":"number","example":""}},{"name":"per_page","in":"query","description":"Items per-page.","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/durable_objects/namespaces"},"summary":"List Namespaces","description":"Returns the Durable Object namespaces owned by an account.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects":{"get":{"tags":["Durable Objects Namespace"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"id","in":"path","description":"ID of the namespace.","required":true,"schema":{"type":"string","example":""}},{"name":"cursor","in":"query","description":"Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.","required":false,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects"},"summary":"List Objects","description":"Returns the Durable Objects in a given namespace.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/observability/destinations":{"get":{"tags":["Destinations"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"order","in":"query","description":"Order","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"orderBy","in":"query","description":"Orderby","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["created","updated"]}}},{"name":"page","in":"query","description":"Page","required":false,"schema":{"type":"number","example":""}},{"name":"perPage","in":"query","description":"Perpage","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/destinations"},"summary":"Get Destinations","description":"List your Workers Observability Telemetry Destinations.","security":[{"bearerAuth":[]}]},"post":{"tags":["Destinations"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/destinations"},"summary":"Create Destination","description":"Create a new Workers Observability Telemetry Destination.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"configuration":{"type":"object","description":"Configuration","required":true,"properties":{"type":{"type":"string","description":"Type","required":true,"enum":["logpush"]},"headers":{"type":"object","description":"Headers","required":true},"logpushDataset":{"type":"string","description":"Logpushdataset","required":true,"enum":["opentelemetry-traces","opentelemetry-logs","opentelemetry-metrics"]},"url":{"type":"string","description":"Url","required":true}}},"enabled":{"type":"boolean","description":"Enabled","required":true,"enum":[true,false]},"name":{"type":"string","description":"Name","required":true},"skipPreflightCheck":{"type":"boolean","description":"Skippreflightcheck","enum":[true,false]}}},"example":{"configuration":{},"enabled":"","name":"","skipPreflightCheck":""}}}}}},"/client/v4/accounts/{account_id}/workers/observability/destinations/{slug}":{"delete":{"tags":["Destinations"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"slug","in":"path","description":"Slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/destinations/{slug}"},"summary":"Delete Destination","description":"Delete a Workers Observability Telemetry Destination.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"patch":{"tags":["Destinations"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"slug","in":"path","description":"Slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/destinations/{slug}"},"summary":"Update Destination","description":"Update an existing Workers Observability Telemetry Destination.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"configuration":{"type":"object","description":"Configuration","required":true,"properties":{"type":{"type":"string","description":"Type","required":true,"enum":["logpush"]},"headers":{"type":"object","description":"Headers","required":true},"url":{"type":"string","description":"Url","required":true}}},"enabled":{"type":"boolean","description":"Enabled","required":true,"enum":[true,false]}}},"example":{"configuration":{},"enabled":""}}}}}},"/client/v4/accounts/{account_id}/workers/observability/metricsexport":{"get":{"tags":["Metrics Export"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/metricsexport"},"summary":"List Metrics Exports","description":"List resources configured for Workers Observability metrics export.","security":[{"bearerAuth":[]}]},"post":{"tags":["Metrics Export"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/metricsexport"},"summary":"Upsert Metrics Exports","description":"Create or replace resources configured for Workers Observability metrics export.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"requester":{"type":"object","description":"Requester","required":true,"properties":{"requesterId":{"type":"string","description":"Requesterid","required":true},"requesterType":{"type":"string","description":"Requestertype","required":true,"enum":["workers"]}}},"resources":{"type":"array","description":"Resources","required":true,"items":{"type":"object","properties":{"destinations":{"type":"array","description":"Destinations","required":true},"resourceId":{"type":"string","description":"Resourceid","required":true},"resourceType":{"type":"string","description":"Resourcetype","required":true,"enum":["workers","d1","r2","containers"]}}}}}},"example":{"requester":{},"resources":[]}}}}}},"/client/v4/accounts/{account_id}/workers/observability/queries":{"get":{"tags":["Saved Queries"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"order","in":"query","description":"Order","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"orderBy","in":"query","description":"Orderby","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["created","updated"]}}},{"name":"page","in":"query","description":"Page","required":false,"schema":{"type":"number","example":""}},{"name":"perPage","in":"query","description":"Perpage","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/queries"},"summary":"List queries","description":"List saved queries.","security":[{"bearerAuth":[]}]},"post":{"tags":["Saved Queries"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/queries"},"summary":"Save query","description":"Persist query for later use.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"description":{"type":"string","description":"Description","required":true},"name":{"type":"string","description":"Query name","required":true},"parameters":{"type":"object","description":"Parameters","required":true,"properties":{"calculations":{"type":"array","description":"Create Calculations to compute as part of the query. — item shape varies by setting: alias, key, keyType, operator | alias, key, keyType, operator"},"datasets":{"type":"array","description":"Set the Datasets to query. Leave it empty to query all the datasets."},"filterCombination":{"type":"string","description":"Set a Flag to describe how to combine the filters on the query.","enum":["and","or","AND","OR"]},"filters":{"type":"array","description":"Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. — item shape varies by setting: filterCombination, filters, kind | key, kind, operation, type"},"groupBys":{"type":"array","description":"Define how to group the results of the query."},"havings":{"type":"array","description":"Configure the Having clauses that filter on calculations in the query result."},"limit":{"type":"number","description":"Set a limit on the number of results / records returned by the query"},"needle":{"type":"object","description":"Define an expression to search using full-text search."},"orderBy":{"type":"object","description":"Configure the order of the results returned by the query."}}}}},"example":{"description":"Query description","name":"","parameters":{}}}}}}},"/client/v4/accounts/{account_id}/workers/observability/queries/{queryId}":{"get":{"tags":["Saved Queries"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"queryId","in":"path","description":"Queryid","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/queries/{queryId}"},"summary":"Get query","description":"Retrieve a saved query.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Saved Queries"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"queryId","in":"path","description":"Queryid","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/queries/{queryId}"},"summary":"Delete query","description":"Delete a saved query.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"patch":{"tags":["Saved Queries"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"queryId","in":"path","description":"Queryid","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/queries/{queryId}"},"summary":"Update query","description":"Update saved query.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"description":{"type":"string","description":"Description","required":true},"name":{"type":"string","description":"Query name","required":true},"parameters":{"type":"object","description":"Parameters","required":true,"properties":{"calculations":{"type":"array","description":"Create Calculations to compute as part of the query. — item shape varies by setting: alias, key, keyType, operator | alias, key, keyType, operator"},"datasets":{"type":"array","description":"Set the Datasets to query. Leave it empty to query all the datasets."},"filterCombination":{"type":"string","description":"Set a Flag to describe how to combine the filters on the query.","enum":["and","or","AND","OR"]},"filters":{"type":"array","description":"Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. — item shape varies by setting: filterCombination, filters, kind | key, kind, operation, type"},"groupBys":{"type":"array","description":"Define how to group the results of the query."},"havings":{"type":"array","description":"Configure the Having clauses that filter on calculations in the query result."},"limit":{"type":"number","description":"Set a limit on the number of results / records returned by the query"},"needle":{"type":"object","description":"Define an expression to search using full-text search."},"orderBy":{"type":"object","description":"Configure the order of the results returned by the query."}}}}},"example":{"description":"Query description","name":"","parameters":{}}}}}}},"/client/v4/accounts/{account_id}/workers/observability/shared/query":{"post":{"tags":["Shared"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/shared/query"},"summary":"Create a sharable link to a query result","description":"Shared queries store the results of a previously run query, allowing you to share the results with others.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"chart":{"type":"boolean","description":"When true, includes time-series data in the response.","enum":[true,false]},"chartType":{"type":"string","description":"Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.","enum":["timeseries_and_aggregate","timeseries","aggregate","distribution"]},"compare":{"type":"boolean","description":"When true, includes a comparison dataset from the previous time period of equal length.","enum":[true,false]},"distributionScale":{"type":"string","description":"Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.","enum":["log","linear"]},"dry":{"type":"boolean","description":"When true, executes the query without persisting the results. Useful for validation or previewing.","enum":[true,false]},"granularity":{"type":"number","description":"Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity."},"ignoreSeries":{"type":"boolean","description":"When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.","enum":[true,false]},"limit":{"type":"number","description":"Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'."},"offset":{"type":"string","description":"Cursor for pagination in event, trace, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id to fetch the next page."},"offsetBy":{"type":"number","description":"Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination."},"offsetDirection":{"type":"string","description":"Pagination direction: 'next' for forward, 'prev' for backward."},"parameters":{"type":"object","description":"Query parameters defining what data to retrieve — filters, calculations, group-bys, and ordering. In practice this should always be provided for ad-hoc queries. Only omit when executing a previously saved query by queryId. Use the keys and values endpoints to discover available fields before building filters.","properties":{"calculations":{"type":"array","description":"Aggregation calculations to compute (e.g. count, avg, p99). Each calculation produces aggregate values and optional time-series data. — item shape varies by setting: alias, key, keyType, operator | alias, key, keyType, operator"},"datasets":{"type":"array","description":"Datasets to query. Leave empty to query all available datasets."},"filterCombination":{"type":"string","description":"Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.","enum":["and","or","AND","OR"]},"filters":{"type":"array","description":"Filters to narrow query results. Use the keys and values endpoints to discover available fields before building filters. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. — item shape varies by setting: filterCombination, filters, kind | key, kind, operation, type"},"groupBys":{"type":"array","description":"Fields to group calculation results by. Only applicable when the query view is 'calculations'. Produces per-group aggregate values."},"havings":{"type":"array","description":"Post-aggregation filters applied to calculation results. Use to filter groups after aggregation (e.g. only groups where count > 100)."},"limit":{"type":"number","description":"Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases."},"needle":{"type":"object","description":"Full-text search expression applied across all event fields. Matches events containing the specified text."},"orderBy":{"type":"object","description":"Ordering for grouped calculation results. Only effective when a group-by is present."}}},"queryId":{"type":"string","description":"Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).","required":true},"timeframe":{"type":"object","description":"Timeframe for the query using Unix timestamps in milliseconds. 'from' must be earlier than 'to'. Narrower timeframes produce faster responses and more specific results.","required":true,"properties":{"from":{"type":"number","description":"Start timestamp for the query timeframe. Unix timestamp in milliseconds","required":true},"to":{"type":"number","description":"End timestamp for the query timeframe. Unix timestamp in milliseconds","required":true}}},"view":{"type":"string","description":"Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': agent-specific trace summaries.","enum":["traces","events","calculations","invocations","requests","agents"]}}},"example":{"chart":"","chartType":"","compare":"","distributionScale":"","dry":"","granularity":"","ignoreSeries":"","limit":"","offset":"","offsetBy":"","offsetDirection":"","parameters":{},"queryId":"","timeframe":{},"view":"calculations"}}}}}},"/client/v4/accounts/{account_id}/workers/observability/shared/query/{id}":{"get":{"tags":["Shared"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"id","in":"path","description":"Specify the ID of the shared query.","required":true,"schema":{"type":"string","example":""}},{"name":"view","in":"query","description":"Select the view of the query result to return, defaults to events.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["events","invocations","calculations"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/shared/query/{id}"},"summary":"View a query that has been shared","description":"Shared queries store the results of a previously run query, allowing you to share the results with others.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/observability/telemetry/keys":{"post":{"tags":["Keys"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/telemetry/keys"},"summary":"List keys","description":"List all the keys in your telemetry events.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"datasets":{"type":"array","description":"Leave this empty to use the default datasets","items":{"type":"string"}},"filters":{"type":"array","description":"Apply filters to narrow key discovery. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. — item shape varies by setting: filterCombination, filters, kind | key, kind, operation, type","items":{"type":"object","properties":{}}},"from":{"type":"number","description":"From"},"keyNeedle":{"type":"object","description":"If the user suggests a key, use this to narrow down the list of keys returned. Make sure matchCase is false to avoid case sensitivity issues.","properties":{"isRegex":{"type":"boolean","description":"When true, treats the value as a regular expression (RE2 syntax).","enum":[true,false]},"matchCase":{"type":"boolean","description":"When true, performs a case-sensitive search. Defaults to case-insensitive.","enum":[true,false]},"value":{"type":"object","description":"The text or pattern to search for. — shape varies: string | number | boolean","required":true}}},"limit":{"type":"number","description":"Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering."},"needle":{"type":"object","description":"Search for a specific substring in any of the events","properties":{"isRegex":{"type":"boolean","description":"When true, treats the value as a regular expression (RE2 syntax).","enum":[true,false]},"matchCase":{"type":"boolean","description":"When true, performs a case-sensitive search. Defaults to case-insensitive.","enum":[true,false]},"value":{"type":"object","description":"The text or pattern to search for. — shape varies: string | number | boolean","required":true}}},"to":{"type":"number","description":"To"}}},"example":{"datasets":[],"filters":[],"from":"","keyNeedle":{},"limit":"","needle":{},"to":""}}}}}},"/client/v4/accounts/{account_id}/workers/observability/telemetry/live-tail":{"post":{"tags":["Live Tail"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/telemetry/live-tail"},"summary":"Prepare live tail","description":"Prepare websocket server for live tail.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"filterCombination":{"type":"string","description":"Set a flag to describe how to combine the filters on the query.","enum":["and","or","AND","OR"]},"filters":{"type":"array","description":"Apply filters to the query. Supports nested groups via kind: 'group'. — item shape varies by setting: filterCombination, filters, kind | key, kind, operation, type","items":{"type":"object","properties":{}}},"scriptId":{"type":"string","description":"Scriptid"}}},"example":{"filterCombination":"and","filters":[],"scriptId":""}}}}}},"/client/v4/accounts/{account_id}/workers/observability/telemetry/live-tail/heartbeat":{"post":{"tags":["Live Tail"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/telemetry/live-tail/heartbeat"},"summary":"Live tail heartbeat","description":"Notify live tail that user is still eligible to receive live events.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"scriptId":{"type":"string","description":"Scriptid"}}},"example":{"scriptId":""}}}}}},"/client/v4/accounts/{account_id}/workers/observability/telemetry/query":{"post":{"tags":["Query Run"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/telemetry/query"},"summary":"Run a query","description":"Run a temporary or saved query.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"chart":{"type":"boolean","description":"When true, includes time-series data in the response.","enum":[true,false]},"chartType":{"type":"string","description":"Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.","enum":["timeseries_and_aggregate","timeseries","aggregate","distribution"]},"compare":{"type":"boolean","description":"When true, includes a comparison dataset from the previous time period of equal length.","enum":[true,false]},"distributionScale":{"type":"string","description":"Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.","enum":["log","linear"]},"dry":{"type":"boolean","description":"When true, executes the query without persisting the results. Useful for validation or previewing.","enum":[true,false]},"granularity":{"type":"number","description":"Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity."},"ignoreSeries":{"type":"boolean","description":"When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.","enum":[true,false]},"limit":{"type":"number","description":"Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'."},"offset":{"type":"string","description":"Cursor for pagination in event, trace, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id to fetch the next page."},"offsetBy":{"type":"number","description":"Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination."},"offsetDirection":{"type":"string","description":"Pagination direction: 'next' for forward, 'prev' for backward."},"parameters":{"type":"object","description":"Query parameters defining what data to retrieve — filters, calculations, group-bys, and ordering. In practice this should always be provided for ad-hoc queries. Only omit when executing a previously saved query by queryId. Use the keys and values endpoints to discover available fields before building filters.","properties":{"calculations":{"type":"array","description":"Aggregation calculations to compute (e.g. count, avg, p99). Each calculation produces aggregate values and optional time-series data. — item shape varies by setting: alias, key, keyType, operator | alias, key, keyType, operator"},"datasets":{"type":"array","description":"Datasets to query. Leave empty to query all available datasets."},"filterCombination":{"type":"string","description":"Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.","enum":["and","or","AND","OR"]},"filters":{"type":"array","description":"Filters to narrow query results. Use the keys and values endpoints to discover available fields before building filters. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. — item shape varies by setting: filterCombination, filters, kind | key, kind, operation, type"},"groupBys":{"type":"array","description":"Fields to group calculation results by. Only applicable when the query view is 'calculations'. Produces per-group aggregate values."},"havings":{"type":"array","description":"Post-aggregation filters applied to calculation results. Use to filter groups after aggregation (e.g. only groups where count > 100)."},"limit":{"type":"number","description":"Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases."},"needle":{"type":"object","description":"Full-text search expression applied across all event fields. Matches events containing the specified text."},"orderBy":{"type":"object","description":"Ordering for grouped calculation results. Only effective when a group-by is present."}}},"queryId":{"type":"string","description":"Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).","required":true},"timeframe":{"type":"object","description":"Timeframe for the query using Unix timestamps in milliseconds. 'from' must be earlier than 'to'. Narrower timeframes produce faster responses and more specific results.","required":true,"properties":{"from":{"type":"number","description":"Start timestamp for the query timeframe. Unix timestamp in milliseconds","required":true},"to":{"type":"number","description":"End timestamp for the query timeframe. Unix timestamp in milliseconds","required":true}}},"view":{"type":"string","description":"Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': agent-specific trace summaries.","enum":["traces","events","calculations","invocations","requests","agents"]}}},"example":{"chart":"","chartType":"","compare":"","distributionScale":"","dry":"","granularity":"","ignoreSeries":"","limit":"","offset":"","offsetBy":"","offsetDirection":"","parameters":{},"queryId":"","timeframe":{},"view":"calculations"}}}}}},"/client/v4/accounts/{account_id}/workers/observability/telemetry/values":{"post":{"tags":["Values"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/telemetry/values"},"summary":"List values","description":"List unique values found in your events.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"Type","required":true,"enum":["string","boolean","number"]},"datasets":{"type":"array","description":"Leave this empty to use the default datasets","required":true,"items":{"type":"string"}},"filters":{"type":"array","description":"Apply filters before listing values. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. — item shape varies by setting: filterCombination, filters, kind | key, kind, operation, type","items":{"type":"object","properties":{}}},"key":{"type":"string","description":"Key","required":true},"limit":{"type":"number","description":"Limit"},"needle":{"type":"object","description":"Full-text search expression to match events containing the specified text or pattern.","properties":{"isRegex":{"type":"boolean","description":"When true, treats the value as a regular expression (RE2 syntax).","enum":[true,false]},"matchCase":{"type":"boolean","description":"When true, performs a case-sensitive search. Defaults to case-insensitive.","enum":[true,false]},"value":{"type":"object","description":"The text or pattern to search for. — shape varies: string | number | boolean","required":true}}},"timeframe":{"type":"object","description":"Timeframe","required":true,"properties":{"from":{"type":"number","description":"From","required":true},"to":{"type":"number","description":"To","required":true}}}}},"example":{"type":"","datasets":[],"filters":[],"key":"","limit":"","needle":{},"timeframe":{}}}}}}},"/client/v4/accounts/{account_id}/workers/observability/usage":{"get":{"tags":["Usage"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"from","in":"query","description":"Unix timestamp in milliseconds for the start of the range.","required":true,"schema":{"type":"string","example":""}},{"name":"to","in":"query","description":"Unix timestamp in milliseconds for the end of the range.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/usage"},"summary":"Get event count","description":"Event counts broken down by dataset and service, bucketed by day, for up to 90 days. The top-level events field is the sum of all breakdown counts.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/observability/zones/{zone_id}/observability/tracing/rules":{"get":{"tags":["Observability"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"path","description":"Specify the zone ID.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/zones/{zone_id}/observability/tracing/rules"},"summary":"View zone trace rules","description":"Retrieve the ordered sampling overrides for a zone's managed Cloudflare Traces ruleset.","security":[{"bearerAuth":[]}]},"put":{"tags":["Observability"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"path","description":"Specify the zone ID.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/zones/{zone_id}/observability/tracing/rules"},"summary":"Replace zone trace rules","description":"Replace all sampling overrides in a zone's managed Cloudflare Traces ruleset. Rules are evaluated in the supplied order.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"rules":{"type":"array","description":"Trace rules in evaluation order.","required":true,"items":{"type":"object","properties":{"action":{"type":"string","description":"Action","required":true,"enum":["set_trace_settings"]},"action_parameters":{"type":"object","description":"Action parameters","required":true},"description":{"type":"string","description":"Description","required":true},"enabled":{"type":"boolean","description":"Enabled","required":true,"enum":[true,false]},"expression":{"type":"string","description":"A Rules language expression that selects requests.","required":true}}}}}},"example":{"rules":[]}}}}}},"/client/v4/accounts/{account_id}/workers/observability/zones/{zone_id}/observability/tracing/settings":{"get":{"tags":["Observability"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"path","description":"Specify the zone ID.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/zones/{zone_id}/observability/tracing/settings"},"summary":"View zone tracing settings","description":"Retrieve the zone-level Cloudflare Traces settings.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Observability"],"parameters":[{"name":"account_id","in":"path","description":"Account id","required":true,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"path","description":"Specify the zone ID.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/observability/zones/{zone_id}/observability/tracing/settings"},"summary":"Update zone tracing settings","description":"Update the zone-level Cloudflare Traces settings.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"destinations":{"type":"array","description":"OpenTelemetry destination identifiers that receive traces.","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Whether Cloudflare Traces is enabled for the zone.","enum":[true,false]},"forward_context":{"type":"boolean","description":"Whether trace context is sent externally or across a zone boundary.","enum":[true,false]},"persist":{"type":"boolean","description":"Whether traces are persisted in Cloudflare.","enum":[true,false]},"propagation_policy":{"type":"string","description":"When inbound trace context may be continued.","enum":["authenticated","unauthenticated"]},"sampling_ratio":{"type":"number","description":"The ratio of requests sampled for tracing, from 0 to 1."}}},"example":{"destinations":[],"enabled":"","forward_context":"","persist":"","propagation_policy":"","sampling_ratio":""}}}}}},"/client/v4/accounts/{account_id}/workers/placement/regions":{"get":{"tags":["Worker Placement"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/placement/regions"},"summary":"List Placement Regions","description":"Returns a list of available placement regions organized by cloud provider. These regions can be used to configure Smart Placement for Workers.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/scripts":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"tags","in":"query","description":"Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts"},"summary":"List Worker Scripts","description":"Fetch a list of uploaded workers.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/scripts-search":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"id","in":"query","description":"Worker ID (also called tag) to search for. Only exact matches are returned.","required":false,"schema":{"type":"string","example":""}},{"name":"name","in":"query","description":"Worker name to search for. Both exact and partial matches are returned.","required":false,"schema":{"type":"string","example":""}},{"name":"order_by","in":"query","description":"Property to sort results by. Results are sorted in ascending order.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["created_on","modified_on","name"]}}},{"name":"page","in":"query","description":"Current page.","required":false,"schema":{"type":"number","example":""}},{"name":"per_page","in":"query","description":"Items per page.","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts-search"},"summary":"Search Workers","description":"Search for Workers in an account.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}"},"summary":"Download Worker","description":"Fetch raw script content for your worker. Note this is the original script content, not JSON encoded.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}},{"name":"bindings_inherit","in":"query","description":"When set to \"strict\", the upload will fail if any inherit type bindings cannot be resolved against the previous version of the Worker. Without this, unresolvable inherit bindings are silently dropped.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["strict"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}"},"summary":"Upload Worker Module","description":"Upload a worker module. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"files":{"type":"string","format":"binary","description":"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as main_module or body_part by filename. — Possible Content-Type(s) are: application/javascript+module, text/javascript+module, application/javascript, text/javascript, text/x-python, text/x-python-requirement, application/wasm, text/plain, application/octet-stream, application/source-map. — set metadata.main_module to the uploaded file name (single-module upload; Cloudflare matches modules by Content-Disposition filename)","required":true},"metadata":{"type":"string","description":"JSON-encoded metadata about the uploaded parts and Worker configuration. — send as a JSON string (multipart part 'metadata'; keys: assets, bindings, body_part, cache_options, compatibility_date, compatibility_flags, exports, exports_reconciliation, keep_assets, keep_bindings, limits, logpush, main_module, migrations)","required":true}}},"example":{"files":"(binary)","metadata":""}}}}},"delete":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}},{"name":"force","in":"query","description":"If set to true, delete will not be stopped by associated service binding, durable object, or other binding. Any of these associated bindings/durable objects will be deleted along with the script.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}"},"summary":"Delete Worker Script","description":"Delete your worker. This call has no response body on a successful delete.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/assets-upload-session":{"post":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/assets-upload-session"},"summary":"Create Assets Upload Session","description":"Start uploading a collection of assets for use in a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"manifest":{"type":"object","description":"A manifest ([path]: {hash, size}) map of files to upload. As an example, /blog/hello-world.html would be a valid path key.","required":true,"properties":{}}}},"example":{"manifest":{}}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/content":{"put":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/content"},"summary":"Put Script Content (Script)","description":"Put script content without touching config or metadata.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"files":{"type":"string","format":"binary","description":"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as main_module or body_part by filename. — Possible Content-Type(s) are: application/javascript+module, text/javascript+module, application/javascript, text/javascript, text/x-python, text/x-python-requirement, application/wasm, text/plain, application/octet-stream, application/source-map. — set metadata.main_module to the uploaded file name (single-module upload; Cloudflare matches modules by Content-Disposition filename)","required":true},"metadata":{"type":"string","description":"JSON-encoded metadata about the uploaded parts and Worker configuration. — send as a JSON string (multipart part 'metadata'; keys: body_part, main_module)","required":true}}},"example":{"files":"(binary)","metadata":""}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/content/v2":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/content/v2"},"summary":"Get Script Content (Script V2)","description":"Fetch script content only.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments":{"get":{"tags":["Worker Deployments"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments"},"summary":"List Deployments","description":"List of Worker Deployments. The first deployment in the list is the latest deployment actively serving traffic.","security":[{"bearerAuth":[]}]},"post":{"tags":["Worker Deployments"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}},{"name":"force","in":"query","description":"If set to true, the deployment will be created even if normally blocked by something such rolling back to an older version when a secret has changed.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments"},"summary":"Create Deployment","description":"Deployments configure how [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions) are deployed to traffic. A deployment can consist of one or two versions of a Worker.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"annotations":{"type":"object","description":"Annotations","properties":{"workers/message":{"type":"string","description":"Human-readable message about the deployment. Truncated to 1000 bytes if longer."},"workers/triggered_by":{"type":"string","description":"Operation that triggered the creation of the deployment."}}},"author_email":{"type":"string","description":"Author email"},"created_on":{"type":"string","description":"Created on","required":true},"id":{"type":"string","description":"Id","required":true},"source":{"type":"string","description":"Source","required":true},"strategy":{"type":"string","description":"Strategy","required":true,"enum":["percentage"]},"versions":{"type":"array","description":"Versions","required":true,"items":{"type":"object","properties":{"percentage":{"type":"number","description":"Percentage","required":true},"version_id":{"type":"string","description":"Version id","required":true}}}}}},"example":{"annotations":{},"author_email":"","created_on":"","id":"","source":"api","strategy":"","versions":[]}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}":{"get":{"tags":["Worker Deployments"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"deployment_id","in":"path","description":"Deployment id","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}"},"summary":"Get Deployment","description":"Get information about a Worker Deployment.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Worker Deployments"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"deployment_id","in":"path","description":"Deployment id","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}"},"summary":"Delete Deployment","description":"Delete a Worker Deployment. The latest deployment, which is actively serving traffic, cannot be deleted. All other deployments can be deleted.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/schedules":{"get":{"tags":["Worker Cron Trigger"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/schedules"},"summary":"Get Cron Triggers","description":"Fetches Cron Triggers for a Worker.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Cron Trigger"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/schedules"},"summary":"Update Cron Triggers","description":"Updates Cron Triggers for a Worker. Request body is a bare JSON array (Array of ['cron'] objects) — send the raw array as the request body; declared body fields are intentionally empty (dispatch passes the raw array through).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/script-settings":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/script-settings"},"summary":"Get Script Settings (Script)","description":"Get script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). Includes Logpush and Tail Consumers.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/script-settings"},"summary":"Patch Script Settings (Script)","description":"Patch script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). Including but not limited to Logpush and Tail Consumers.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"logpush":{"type":"boolean","description":"Whether Logpush is turned on for the Worker.","enum":[true,false]},"observability":{"type":"object","description":"Observability settings for the Worker.","properties":{"enabled":{"type":"boolean","description":"Whether observability is enabled for the Worker.","required":true,"enum":[true,false]},"head_sampling_rate":{"type":"number","description":"The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1."},"logs":{"type":"object","description":"Log settings for the Worker."},"redact_query_string":{"type":"boolean","description":"Whether query strings are removed from request URLs in logs and traces.","enum":[true,false]},"traces":{"type":"object","description":"Trace settings for the Worker."}}},"tags":{"type":"array","description":"Tags associated with the Worker.","items":{"type":"string"}},"tail_consumers":{"type":"array","description":"List of Workers that will consume logs from the attached Worker.","items":{"type":"object","properties":{"environment":{"type":"string","description":"Optional environment if the Worker utilizes one."},"namespace":{"type":"string","description":"Optional dispatch namespace the script belongs to."},"service":{"type":"string","description":"Name of Worker that is to be the consumer.","required":true}}}}}},"example":{"logpush":"","observability":{},"tags":["my-team","my-public-api"],"tail_consumers":[]}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets"},"summary":"List script secrets","description":"List secrets bound to a script.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets"},"summary":"Add script secret","description":"Add a secret to a script by creating a new version with that secret. When changing more than one secret at a time, prefer the \"Patch multiple script secrets\" API instead of changing many secrets individually.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"The secret value to use."},"type":{"type":"string","description":"The kind of resource that the binding provides.","required":true,"enum":["secret_text","secret_key"]},"algorithm":{"type":"object","description":"Algorithm-specific key parameters. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm).","properties":{}},"format":{"type":"string","description":"Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).","enum":["raw","pkcs8","spki","jwk"]},"key_base64":{"type":"string","description":"Base64-encoded key data. Required if format is \"raw\", \"pkcs8\", or \"spki\"."},"key_jwk":{"type":"object","description":"Key data in [JSON Web Key](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#json_web_key) format. Required if format is \"jwk\".","properties":{}},"name":{"type":"string","description":"A JavaScript variable name for the binding.","required":true},"usages":{"type":"array","description":"Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages).","items":{"type":"string"}}}},"example":{"text":"My secret.","type":"","algorithm":{},"format":"raw","key_base64":"","key_jwk":{},"name":"myBinding","usages":["encrypt","decrypt"]}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets-bulk":{"patch":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets-bulk"},"summary":"Patch multiple script secrets","description":"Create, update, or delete multiple secrets on a script in a single operation using JSON Merge Patch (RFC 7396). This operation creates a single version with all changes included. Prefer this API instead of changing many secrets individually. Usage: - To create or update a secret, set its value to a secret object. - To delete a secret, set its value to null. - Secrets not included in the request are left unchanged.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"secrets":{"type":"object","description":"Map of secret names to secret values: - Set to a secret object to create or update. - Set to null to delete. - Omit to leave unchanged.","properties":{}},"version_tags":{"type":"object","description":"Optional version tags to apply to the new script version.","properties":{}}}},"example":{"secrets":{},"version_tags":{}}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}},{"name":"secret_name","in":"path","description":"A JavaScript variable name for the secret binding.","required":true,"schema":{"type":"string","example":""}},{"name":"url_encoded","in":"query","description":"Flag that indicates whether the secret name is URL encoded.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}"},"summary":"Get secret binding","description":"Get a given secret binding (value omitted) on a script.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}},{"name":"secret_name","in":"path","description":"A JavaScript variable name for the secret binding.","required":true,"schema":{"type":"string","example":""}},{"name":"url_encoded","in":"query","description":"Flag that indicates whether the secret name is URL encoded.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}"},"summary":"Delete script secret","description":"Remove a secret from a script by creating a new version without that secret. When changing more than one secret at a time, prefer the \"Patch multiple script secrets\" API instead of changing many secrets individually.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/settings":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/settings"},"summary":"Get Settings","description":"Get metadata and config, such as bindings or usage model.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/settings"},"summary":"Patch Settings","description":"Patch metadata or config, such as bindings or usage model.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"settings":{"type":"string","description":"Settings — send as a JSON string (multipart part 'settings'; keys: annotations, bindings, cache_options, compatibility_date, compatibility_flags, exports, exports_reconciliation, limits, logpush, migrations, observability, placement, tags, tail_consumers)"}}},"example":{"settings":""}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/subdomain":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/subdomain"},"summary":"Get Worker subdomain","description":"Get if the Worker is available on the workers.dev subdomain.","security":[{"bearerAuth":[]}]},"post":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/subdomain"},"summary":"Post Worker subdomain","description":"Enable or disable the Worker on the workers.dev subdomain.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"enabled":{"type":"boolean","description":"Whether the Worker should be available on the workers.dev subdomain.","required":true,"enum":[true,false]},"previews_enabled":{"type":"boolean","description":"Whether the Worker's Preview URLs should be available on the workers.dev subdomain.","enum":[true,false]}}},"example":{"enabled":true,"previews_enabled":""}}}}},"delete":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/subdomain"},"summary":"Delete Worker subdomain","description":"Disable all workers.dev subdomains for a Worker.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/tails":{"get":{"tags":["Worker Tail Logs"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/tails"},"summary":"List Tails","description":"Get list of tails currently deployed on a Worker.","security":[{"bearerAuth":[]}]},"post":{"tags":["Worker Tail Logs"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/tails"},"summary":"Start Tail","description":"Starts a tail that receives logs and exception from a Worker.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/tails/{id}":{"delete":{"tags":["Worker Tail Logs"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/tails/{id}"},"summary":"Delete Tail","description":"Deletes a tail from a Worker.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/usage-model":{"get":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/usage-model"},"summary":"Fetch Usage Model","description":"Fetches the Usage Model for a given Worker.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Script"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script, used in URLs and route configuration.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/usage-model"},"summary":"Update Usage Model","description":"Updates the Usage Model for a given Worker. Requires a Workers Paid subscription.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"usage_model":{"type":"string","description":"Usage model for the Worker invocations.","enum":["standard","bundled","unbound"]},"user_limits":{"type":"object","description":"User-defined resource limits for Workers with standard usage model.","properties":{"cpu_ms":{"type":"number","description":"The amount of CPU time this Worker can use in milliseconds."}}}}},"example":{"usage_model":"standard","user_limits":{}}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/versions":{"get":{"tags":["Worker Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script.","required":true,"schema":{"type":"string","example":""}},{"name":"deployable","in":"query","description":"Only return versions that can be used in a deployment. Ignores pagination.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}},{"name":"page","in":"query","description":"Current page.","required":false,"schema":{"type":"number","example":""}},{"name":"per_page","in":"query","description":"Items per-page.","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/versions"},"summary":"List Script Versions","description":"List of Worker Versions. The first version in the list is the latest version.","security":[{"bearerAuth":[]}]},"post":{"tags":["Worker Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script.","required":true,"schema":{"type":"string","example":""}},{"name":"bindings_inherit","in":"query","description":"When set to \"strict\", the upload will fail if any inherit type bindings cannot be resolved against the previous version of the Worker. Without this, unresolvable inherit bindings are silently dropped.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["strict"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/versions"},"summary":"Upload Version","description":"Upload a Worker Version without deploying to Cloudflare's network. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"files":{"type":"string","format":"binary","description":"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as main_module or body_part by filename. — Possible Content-Type(s) are: application/javascript+module, text/javascript+module, application/javascript, text/javascript, text/x-python, text/x-python-requirement, application/wasm, text/plain, application/octet-stream, application/source-map. — set metadata.main_module to the uploaded file name (single-module upload; Cloudflare matches modules by Content-Disposition filename)","required":true},"metadata":{"type":"string","description":"JSON-encoded metadata about the uploaded parts and Worker configuration. — send as a JSON string (multipart part 'metadata'; keys: annotations, bindings, cache_options, compatibility_date, compatibility_flags, exports, keep_bindings, main_module, package_dependencies, usage_model)","required":true}}},"example":{"files":"(binary)","metadata":""}}}}}},"/client/v4/accounts/{account_id}/workers/scripts/{script_name}/versions/{version_id}":{"get":{"tags":["Worker Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"script_name","in":"path","description":"Name of the script.","required":true,"schema":{"type":"string","example":""}},{"name":"version_id","in":"path","description":"Version id","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}/versions/{version_id}"},"summary":"Get Version Detail","description":"Retrieves detailed information about a specific version of a Workers script.","security":[{"bearerAuth":[]}]}},"/client/v4/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/content":{"get":{"tags":["Worker Environment"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"environment_name","in":"path","description":"Optional environment if the Worker utilizes one.","required":true,"schema":{"type":"string","example":""}},{"name":"service_name","in":"path","description":"Name of Worker to bind to.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/content"},"summary":"Get Script Content (Service Environment)","description":"Get script content from a worker with an environment.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Environment"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"environment_name","in":"path","description":"Optional environment if the Worker utilizes one.","required":true,"schema":{"type":"string","example":""}},{"name":"service_name","in":"path","description":"Name of Worker to bind to.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/content"},"summary":"Put Script Content (Service Environment)","description":"Put script content from a worker with an environment.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"files":{"type":"string","format":"binary","description":"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as main_module or body_part by filename. — Possible Content-Type(s) are: application/javascript+module, text/javascript+module, application/javascript, text/javascript, text/x-python, text/x-python-requirement, application/wasm, text/plain, application/octet-stream, application/source-map. — set metadata.main_module to the uploaded file name (single-module upload; Cloudflare matches modules by Content-Disposition filename)","required":true},"metadata":{"type":"string","description":"JSON-encoded metadata about the uploaded parts and Worker configuration. — send as a JSON string (multipart part 'metadata'; keys: body_part, main_module)","required":true}}},"example":{"files":"(binary)","metadata":""}}}}}},"/client/v4/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/settings":{"get":{"tags":["Worker Environment"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"environment_name","in":"path","description":"Optional environment if the Worker utilizes one.","required":true,"schema":{"type":"string","example":""}},{"name":"service_name","in":"path","description":"Name of Worker to bind to.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/settings"},"summary":"Get Script Settings (Service Environment)","description":"Get script settings from a worker with an environment.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Worker Environment"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"environment_name","in":"path","description":"Optional environment if the Worker utilizes one.","required":true,"schema":{"type":"string","example":""}},{"name":"service_name","in":"path","description":"Name of Worker to bind to.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/settings"},"summary":"Patch Script Settings (Service Environment)","description":"Patch script metadata, such as bindings.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"errors":{"type":"array","description":"Errors","required":true,"items":{"type":"object","properties":{"code":{"type":"number","description":"Code","required":true},"documentation_url":{"type":"string","description":"Documentation url"},"message":{"type":"string","description":"Message","required":true},"source":{"type":"object","description":"Source"}}}},"messages":{"type":"array","description":"Messages","required":true,"items":{"type":"object","properties":{"code":{"type":"number","description":"Code","required":true},"documentation_url":{"type":"string","description":"Documentation url"},"message":{"type":"string","description":"Message","required":true},"source":{"type":"object","description":"Source"}}}},"result":{"type":"object","description":"Result","required":true,"properties":{"logpush":{"type":"boolean","description":"Whether Logpush is turned on for the Worker.","enum":[true,false]},"observability":{"type":"object","description":"Observability settings for the Worker."},"tags":{"type":"array","description":"Tags associated with the Worker."},"tail_consumers":{"type":"array","description":"List of Workers that will consume logs from the attached Worker."}}},"success":{"type":"boolean","description":"Whether the API call was successful.","required":true,"enum":[true,false]}}},"example":{"errors":[],"messages":[],"result":{},"success":true}}}}}},"/client/v4/accounts/{account_id}/workers/subdomain":{"get":{"tags":["Worker Subdomain"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/subdomain"},"summary":"Get Subdomain","description":"Returns a Workers subdomain for an account.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Subdomain"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/subdomain"},"summary":"Create Subdomain","description":"Creates a Workers subdomain for an account.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"subdomain":{"type":"string","description":"Subdomain","required":true}}},"example":{"subdomain":"my-subdomain"}}}}},"delete":{"tags":["Worker Subdomain"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/subdomain"},"summary":"Delete Subdomain","description":"Deletes a Workers subdomain for an account.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/accounts/{account_id}/workers/workers":{"get":{"tags":["Workers"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"order","in":"query","description":"Sort direction.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"order_by","in":"query","description":"Property to sort results by.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["deployed_on","updated_on","created_on","name"]}}},{"name":"page","in":"query","description":"Current page.","required":false,"schema":{"type":"number","example":""}},{"name":"per_page","in":"query","description":"Items per-page.","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers"},"summary":"List Workers","description":"List all Workers for an account.","security":[{"bearerAuth":[]}]},"post":{"tags":["Workers"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers"},"summary":"Create Worker","description":"Create a new Worker.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"created_on":{"type":"string","description":"When the Worker was created.","required":true},"deployed_on":{"type":"string","description":"When the Worker's most recent deployment was created. null if the Worker has never been deployed."},"id":{"type":"string","description":"Immutable ID of the Worker.","required":true},"logpush":{"type":"boolean","description":"Whether logpush is enabled for the Worker.","required":true,"enum":[true,false]},"name":{"type":"string","description":"Name of the Worker.","required":true},"observability":{"type":"object","description":"Observability settings for the Worker.","required":true,"properties":{"enabled":{"type":"boolean","description":"Whether observability is enabled for the Worker.","enum":[true,false]},"head_sampling_rate":{"type":"number","description":"The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%)."},"logs":{"type":"object","description":"Log settings for the Worker."},"redact_query_string":{"type":"boolean","description":"Whether query strings are removed from request URLs in logs and traces.","enum":[true,false]},"traces":{"type":"object","description":"Trace settings for the Worker."}}},"references":{"type":"object","description":"Other resources that reference the Worker and depend on it existing.","required":true,"properties":{"dispatch_namespace_outbounds":{"type":"array","description":"Other Workers that reference the Worker as an outbound for a dispatch namespace.","required":true},"domains":{"type":"array","description":"Custom domains connected to the Worker.","required":true},"durable_objects":{"type":"array","description":"Other Workers that reference Durable Object classes implemented by the Worker.","required":true},"queues":{"type":"array","description":"Queues that send messages to the Worker.","required":true},"workers":{"type":"array","description":"Other Workers that reference the Worker using [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/).","required":true}}},"subdomain":{"type":"object","description":"Subdomain settings for the Worker.","required":true,"properties":{"enabled":{"type":"boolean","description":"Whether the *.workers.dev subdomain is enabled for the Worker.","enum":[true,false]},"preview_url_suffix":{"type":"string","description":"Prepend a version or preview prefix to this host suffix to form the *.workers.dev [preview URL](https://developers.cloudflare.com/workers/configuration/previews/) the Worker would serve on once previews are enabled, e.g. https://-my-worker.my-subdomain.workers.dev. Present whenever the account owns a workers.dev subdomain, regardless of whether previews_enabled is true, so presence does not imply preview URLs are currently live. Absent only when the account owns no workers.dev subdomain."},"previews_enabled":{"type":"boolean","description":"Whether [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) are enabled for the Worker.","enum":[true,false]},"url":{"type":"string","description":"The address the Worker would serve on once its *.workers.dev subdomain is enabled. Present whenever the account owns a workers.dev subdomain, regardless of whether enabled is true, so presence does not imply the Worker is currently live at this URL. Absent only when the account owns no workers.dev subdomain."}}},"tags":{"type":"array","description":"Tags associated with the Worker.","required":true,"items":{"type":"string"}},"tail_consumers":{"type":"array","description":"Other Workers that should consume logs from the Worker.","required":true,"items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the consumer Worker.","required":true}}}},"updated_on":{"type":"string","description":"When the Worker was most recently updated.","required":true}}},"example":{"created_on":"","deployed_on":"","id":"e8f70fdbc8b1fb0b8ddb1af166186758","logpush":"","name":"my-worker","observability":{},"references":{},"subdomain":{},"tags":["my-team","my-public-api"],"tail_consumers":[],"updated_on":""}}}}}},"/client/v4/accounts/{account_id}/workers/workers/{worker_id}":{"get":{"tags":["Workers"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}"},"summary":"Get Worker","description":"Get details about a specific Worker.","security":[{"bearerAuth":[]}]},"put":{"tags":["Workers"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}"},"summary":"Update Worker","description":"Perform a complete replacement of a Worker, where omitted properties are set to their default values. This is the exact same as the Create Worker endpoint, but operates on an existing Worker. To perform a partial update instead, use the Edit Worker endpoint.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"created_on":{"type":"string","description":"When the Worker was created.","required":true},"deployed_on":{"type":"string","description":"When the Worker's most recent deployment was created. null if the Worker has never been deployed."},"id":{"type":"string","description":"Immutable ID of the Worker.","required":true},"logpush":{"type":"boolean","description":"Whether logpush is enabled for the Worker.","required":true,"enum":[true,false]},"name":{"type":"string","description":"Name of the Worker.","required":true},"observability":{"type":"object","description":"Observability settings for the Worker.","required":true,"properties":{"enabled":{"type":"boolean","description":"Whether observability is enabled for the Worker.","enum":[true,false]},"head_sampling_rate":{"type":"number","description":"The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%)."},"logs":{"type":"object","description":"Log settings for the Worker."},"redact_query_string":{"type":"boolean","description":"Whether query strings are removed from request URLs in logs and traces.","enum":[true,false]},"traces":{"type":"object","description":"Trace settings for the Worker."}}},"references":{"type":"object","description":"Other resources that reference the Worker and depend on it existing.","required":true,"properties":{"dispatch_namespace_outbounds":{"type":"array","description":"Other Workers that reference the Worker as an outbound for a dispatch namespace.","required":true},"domains":{"type":"array","description":"Custom domains connected to the Worker.","required":true},"durable_objects":{"type":"array","description":"Other Workers that reference Durable Object classes implemented by the Worker.","required":true},"queues":{"type":"array","description":"Queues that send messages to the Worker.","required":true},"workers":{"type":"array","description":"Other Workers that reference the Worker using [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/).","required":true}}},"subdomain":{"type":"object","description":"Subdomain settings for the Worker.","required":true,"properties":{"enabled":{"type":"boolean","description":"Whether the *.workers.dev subdomain is enabled for the Worker.","enum":[true,false]},"preview_url_suffix":{"type":"string","description":"Prepend a version or preview prefix to this host suffix to form the *.workers.dev [preview URL](https://developers.cloudflare.com/workers/configuration/previews/) the Worker would serve on once previews are enabled, e.g. https://-my-worker.my-subdomain.workers.dev. Present whenever the account owns a workers.dev subdomain, regardless of whether previews_enabled is true, so presence does not imply preview URLs are currently live. Absent only when the account owns no workers.dev subdomain."},"previews_enabled":{"type":"boolean","description":"Whether [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) are enabled for the Worker.","enum":[true,false]},"url":{"type":"string","description":"The address the Worker would serve on once its *.workers.dev subdomain is enabled. Present whenever the account owns a workers.dev subdomain, regardless of whether enabled is true, so presence does not imply the Worker is currently live at this URL. Absent only when the account owns no workers.dev subdomain."}}},"tags":{"type":"array","description":"Tags associated with the Worker.","required":true,"items":{"type":"string"}},"tail_consumers":{"type":"array","description":"Other Workers that should consume logs from the Worker.","required":true,"items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the consumer Worker.","required":true}}}},"updated_on":{"type":"string","description":"When the Worker was most recently updated.","required":true}}},"example":{"created_on":"","deployed_on":"","id":"e8f70fdbc8b1fb0b8ddb1af166186758","logpush":"","name":"my-worker","observability":{},"references":{},"subdomain":{},"tags":["my-team","my-public-api"],"tail_consumers":[],"updated_on":""}}}}},"delete":{"tags":["Workers"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}"},"summary":"Delete Worker","description":"Delete a Worker and all its associated resources (versions, deployments, etc.).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"patch":{"tags":["Workers"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}"},"summary":"Edit Worker","description":"Perform a partial update on a Worker, where omitted properties are left unchanged from their current values.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"created_on":{"type":"string","description":"When the Worker was created.","required":true},"deployed_on":{"type":"string","description":"When the Worker's most recent deployment was created. null if the Worker has never been deployed."},"id":{"type":"string","description":"Immutable ID of the Worker.","required":true},"logpush":{"type":"boolean","description":"Whether logpush is enabled for the Worker.","required":true,"enum":[true,false]},"name":{"type":"string","description":"Name of the Worker.","required":true},"observability":{"type":"object","description":"Observability settings for the Worker.","required":true,"properties":{"enabled":{"type":"boolean","description":"Whether observability is enabled for the Worker.","enum":[true,false]},"head_sampling_rate":{"type":"number","description":"The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%)."},"logs":{"type":"object","description":"Log settings for the Worker."},"redact_query_string":{"type":"boolean","description":"Whether query strings are removed from request URLs in logs and traces.","enum":[true,false]},"traces":{"type":"object","description":"Trace settings for the Worker."}}},"references":{"type":"object","description":"Other resources that reference the Worker and depend on it existing.","required":true,"properties":{"dispatch_namespace_outbounds":{"type":"array","description":"Other Workers that reference the Worker as an outbound for a dispatch namespace.","required":true},"domains":{"type":"array","description":"Custom domains connected to the Worker.","required":true},"durable_objects":{"type":"array","description":"Other Workers that reference Durable Object classes implemented by the Worker.","required":true},"queues":{"type":"array","description":"Queues that send messages to the Worker.","required":true},"workers":{"type":"array","description":"Other Workers that reference the Worker using [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/).","required":true}}},"subdomain":{"type":"object","description":"Subdomain settings for the Worker.","required":true,"properties":{"enabled":{"type":"boolean","description":"Whether the *.workers.dev subdomain is enabled for the Worker.","enum":[true,false]},"preview_url_suffix":{"type":"string","description":"Prepend a version or preview prefix to this host suffix to form the *.workers.dev [preview URL](https://developers.cloudflare.com/workers/configuration/previews/) the Worker would serve on once previews are enabled, e.g. https://-my-worker.my-subdomain.workers.dev. Present whenever the account owns a workers.dev subdomain, regardless of whether previews_enabled is true, so presence does not imply preview URLs are currently live. Absent only when the account owns no workers.dev subdomain."},"previews_enabled":{"type":"boolean","description":"Whether [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) are enabled for the Worker.","enum":[true,false]},"url":{"type":"string","description":"The address the Worker would serve on once its *.workers.dev subdomain is enabled. Present whenever the account owns a workers.dev subdomain, regardless of whether enabled is true, so presence does not imply the Worker is currently live at this URL. Absent only when the account owns no workers.dev subdomain."}}},"tags":{"type":"array","description":"Tags associated with the Worker.","required":true,"items":{"type":"string"}},"tail_consumers":{"type":"array","description":"Other Workers that should consume logs from the Worker.","required":true,"items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the consumer Worker.","required":true}}}},"updated_on":{"type":"string","description":"When the Worker was most recently updated.","required":true}}},"example":{"created_on":"","deployed_on":"","id":"e8f70fdbc8b1fb0b8ddb1af166186758","logpush":"","name":"my-worker","observability":{},"references":{},"subdomain":{},"tags":["my-team","my-public-api"],"tail_consumers":[],"updated_on":""}}}}}},"/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions":{"get":{"tags":["Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}},{"name":"page","in":"query","description":"Current page.","required":false,"schema":{"type":"number","example":""}},{"name":"per_page","in":"query","description":"Items per-page.","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions"},"summary":"List Worker Versions","description":"List all versions for a Worker.","security":[{"bearerAuth":[]}]},"post":{"tags":["Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}},{"name":"deploy","in":"query","description":"If true, a deployment will be created that sends 100% of traffic to the new version.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions"},"summary":"Create Version","description":"Create a new version.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"annotations":{"type":"object","description":"Metadata about the version.","properties":{"workers/message":{"type":"string","description":"Human-readable message about the version. Truncated to 1000 bytes if longer."},"workers/tag":{"type":"string","description":"User-provided identifier for the version. Maximum 100 bytes."},"workers/triggered_by":{"type":"string","description":"Operation that triggered the creation of the version."}}},"assets":{"type":"object","description":"Configuration for assets within a Worker. [_headers](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) and [_redirects](https://developers.cloudflare.com/workers/static-assets/redirects/) files should be included as modules named _headers and _redirects with content type text/plain.","properties":{"config":{"type":"object","description":"Configuration for assets within a Worker."},"jwt":{"type":"string","description":"Token provided upon successful upload of all files from a registered manifest."}}},"author_email":{"type":"string","description":"Email of the user who created the version."},"author_id":{"type":"string","description":"Identifier of the user who created the version."},"bindings":{"type":"array","description":"List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. — item shape varies by setting: name, type | instance_name, name, namespace, type | name, namespace, type | name, namespace, type | dataset, name, type | name, type | name, type | database_id, id, name, type","items":{"type":"object","properties":{}}},"cache_options":{"type":"object","description":"Global CacheW configuration for the Worker. When caching is on, the platform provisions a cloudflare.app zone for the Worker. A type: worker entry in the exports map can override this value for a single entrypoint.","properties":{"cross_version_cache":{"type":"boolean","description":"Whether cached responses are shared across Worker version uploads. This is independent of enabled. It can stay true while caching is off, so the preference survives turning caching off and back on.","enum":[true,false]},"enabled":{"type":"boolean","description":"Whether caching is enabled for this Worker.","required":true,"enum":[true,false]}}},"compatibility_date":{"type":"string","description":"Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker."},"compatibility_flags":{"type":"array","description":"Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.","items":{"type":"string"}},"containers":{"type":"array","description":"List of containers attached to a Worker. Containers can only be attached to Durable Object classes of this Worker script.","items":{"type":"object","properties":{"class_name":{"type":"string","description":"Select which Durable Object class should get this container attached.","required":true}}}},"created_on":{"type":"string","description":"When the version was created.","required":true},"exports":{"type":"object","description":"Declarative exports for the version, including Durable Object classes (with their storage backend) and named Worker entrypoints. On reads, tombstoned lifecycle entries are omitted, so only live exports (created and expecting-transfer) are returned. exports and migrations are mutually exclusive on upload.","properties":{}},"exports_reconciliation":{"type":"object","description":"Summary of the declarative exports reconciliation that ran on this upload. Populated only when the uploaded metadata included an exports block. Durable Object entries drive reconciliation; type: worker entries do not contribute to this summary.","properties":{"created":{"type":"array","description":"Class names for which a new namespace was provisioned.","required":true},"deleted":{"type":"array","description":"Class names whose namespace was deleted by a deleted tombstone.","required":true},"info":{"type":"array","description":"Non-blocking info entries (stale tombstones, tombstone applied with class still in code). See exports_reconciliation_info.","required":true},"removable_entries":{"type":"array","description":"Source class names whose tombstone entry is now stale and safe to delete from exports (no remaining referencing scripts).","required":true},"renamed":{"type":"array","description":"Applied renamed tombstones.","required":true},"transfer_pending":{"type":"array","description":"Phase-1 transfer hints recorded on the target side.","required":true},"transferred":{"type":"array","description":"Committed transferred tombstones (phase-2).","required":true},"updated":{"type":"array","description":"Class names whose provisioned namespace was mutated in place.","required":true},"warnings":{"type":"array","description":"Non-blocking warnings. See exports_reconciliation_warning.","required":true}}},"id":{"type":"string","description":"Version identifier.","required":true},"limits":{"type":"object","description":"Resource limits enforced at runtime.","properties":{"cpu_ms":{"type":"number","description":"CPU time limit in milliseconds."},"subrequests":{"type":"number","description":"Subrequest limit per request."}}},"main_module":{"type":"string","description":"The name of the main module in the modules array (e.g. the name of the module that exports a fetch handler)."},"migration_tag":{"type":"string","description":"Durable Object migration tag. Set when the version is deployed. Omitted if the version has not been deployed or the Worker does not use Durable Objects."},"migrations":{"type":"object","description":"Migrations for Durable Objects associated with the version. Migrations are applied when the version is deployed. — shape varies: new_tag, old_tag, deleted_classes, new_classes, new_sqlite_classes | new_tag, old_tag, steps","properties":{}},"modules":{"type":"array","description":"Code, sourcemaps, and other content used at runtime. This includes [_headers](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) and [_redirects](https://developers.cloudflare.com/workers/static-assets/redirects/) files used to configure [Static Assets](https://developers.cloudflare.com/workers/static-assets/). _headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.","items":{"type":"object","properties":{"content_base64":{"type":"string","description":"The base64-encoded module content.","required":true},"content_type":{"type":"string","description":"The content type of the module.","required":true},"name":{"type":"string","description":"The name of the module.","required":true}}}},"number":{"type":"number","description":"The integer version number, starting from one.","required":true},"package_dependencies":{"type":"array","description":"The list of npm packages that were installed and used when this Worker version was built.","items":{"type":"object","properties":{"installedVersion":{"type":"string","description":"The exact version that was resolved and installed by the package manager.","required":true},"name":{"type":"string","description":"The npm package name.","required":true},"packageJsonVersion":{"type":"string","description":"The version constraint as written in package.json.","required":true}}}},"placement":{"type":"object","description":"Configuration for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). Specify mode='smart' for Smart Placement, or one of region/hostname/host.","properties":{}},"source":{"type":"string","description":"The client used to create the version."},"startup_time_ms":{"type":"number","description":"Time in milliseconds spent on [Worker startup](https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time)."},"urls":{"type":"array","description":"All routable URLs that always point to this version. Does not include alias URLs, since aliases can be updated to point to a different version.","required":true,"items":{"type":"string"}},"usage_model":{"type":"string","description":"Usage model for the version.","enum":["standard","bundled","unbound"]}}},"example":{"annotations":{},"assets":{},"author_email":"user@example.com","author_id":"408cbcdfd4dda4617efef40b04d168a1","bindings":[{"text":"my_data","type":"plain_text","name":"MY_ENV_VAR"}],"cache_options":{},"compatibility_date":"2021-01-01T00:00:00Z","compatibility_flags":["nodejs_compat"],"containers":[{"class_name":"MyDurableObject"}],"created_on":"","exports":{},"exports_reconciliation":{},"id":"","limits":{},"main_module":"index.js","migration_tag":"v1","migrations":{},"modules":[],"number":"","package_dependencies":[],"placement":{},"source":"wrangler","startup_time_ms":10,"urls":["https://9387e76d-my-worker.my-subdomain.workers.dev"],"usage_model":"standard"}}}}}},"/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions/latest":{"patch":{"tags":["Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}},{"name":"deploy","in":"query","description":"If true, a deployment will be created that sends 100% of traffic to the new version.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":[true,false]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions/latest"},"summary":"Patch Latest Version","description":"Only /versions/latest is supported. Creates a new version by applying a JSON Merge Patch (RFC 7396) to the latest version. Patching a specific version ID is not supported. Omitted fields are inherited from the latest version.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"annotations":{"type":"object","description":"Metadata about the version.","properties":{"workers/message":{"type":"string","description":"Human-readable message about the version. Truncated to 1000 bytes if longer."},"workers/tag":{"type":"string","description":"User-provided identifier for the version. Maximum 100 bytes."},"workers/triggered_by":{"type":"string","description":"Operation that triggered the creation of the version."}}},"assets":{"type":"object","description":"Configuration for assets within a Worker. [_headers](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) and [_redirects](https://developers.cloudflare.com/workers/static-assets/redirects/) files should be included as modules named _headers and _redirects with content type text/plain.","properties":{"config":{"type":"object","description":"Configuration for assets within a Worker."},"jwt":{"type":"string","description":"Token provided upon successful upload of all files from a registered manifest."}}},"author_email":{"type":"string","description":"Email of the user who created the version."},"author_id":{"type":"string","description":"Identifier of the user who created the version."},"bindings":{"type":"array","description":"List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. — item shape varies by setting: name, type | instance_name, name, namespace, type | name, namespace, type | name, namespace, type | dataset, name, type | name, type | name, type | database_id, id, name, type","items":{"type":"object","properties":{}}},"cache_options":{"type":"object","description":"Global CacheW configuration for the Worker. When caching is on, the platform provisions a cloudflare.app zone for the Worker. A type: worker entry in the exports map can override this value for a single entrypoint.","properties":{"cross_version_cache":{"type":"boolean","description":"Whether cached responses are shared across Worker version uploads. This is independent of enabled. It can stay true while caching is off, so the preference survives turning caching off and back on.","enum":[true,false]},"enabled":{"type":"boolean","description":"Whether caching is enabled for this Worker.","required":true,"enum":[true,false]}}},"compatibility_date":{"type":"string","description":"Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker."},"compatibility_flags":{"type":"array","description":"Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.","items":{"type":"string"}},"containers":{"type":"array","description":"List of containers attached to a Worker. Containers can only be attached to Durable Object classes of this Worker script.","items":{"type":"object","properties":{"class_name":{"type":"string","description":"Select which Durable Object class should get this container attached.","required":true}}}},"created_on":{"type":"string","description":"When the version was created.","required":true},"exports":{"type":"object","description":"Declarative exports for the version, including Durable Object classes (with their storage backend) and named Worker entrypoints. On reads, tombstoned lifecycle entries are omitted, so only live exports (created and expecting-transfer) are returned. exports and migrations are mutually exclusive on upload.","properties":{}},"exports_reconciliation":{"type":"object","description":"Summary of the declarative exports reconciliation that ran on this upload. Populated only when the uploaded metadata included an exports block. Durable Object entries drive reconciliation; type: worker entries do not contribute to this summary.","properties":{"created":{"type":"array","description":"Class names for which a new namespace was provisioned.","required":true},"deleted":{"type":"array","description":"Class names whose namespace was deleted by a deleted tombstone.","required":true},"info":{"type":"array","description":"Non-blocking info entries (stale tombstones, tombstone applied with class still in code). See exports_reconciliation_info.","required":true},"removable_entries":{"type":"array","description":"Source class names whose tombstone entry is now stale and safe to delete from exports (no remaining referencing scripts).","required":true},"renamed":{"type":"array","description":"Applied renamed tombstones.","required":true},"transfer_pending":{"type":"array","description":"Phase-1 transfer hints recorded on the target side.","required":true},"transferred":{"type":"array","description":"Committed transferred tombstones (phase-2).","required":true},"updated":{"type":"array","description":"Class names whose provisioned namespace was mutated in place.","required":true},"warnings":{"type":"array","description":"Non-blocking warnings. See exports_reconciliation_warning.","required":true}}},"id":{"type":"string","description":"Version identifier.","required":true},"limits":{"type":"object","description":"Resource limits enforced at runtime.","properties":{"cpu_ms":{"type":"number","description":"CPU time limit in milliseconds."},"subrequests":{"type":"number","description":"Subrequest limit per request."}}},"main_module":{"type":"string","description":"The name of the main module in the modules array (e.g. the name of the module that exports a fetch handler)."},"migration_tag":{"type":"string","description":"Durable Object migration tag. Set when the version is deployed. Omitted if the version has not been deployed or the Worker does not use Durable Objects."},"migrations":{"type":"object","description":"Migrations for Durable Objects associated with the version. Migrations are applied when the version is deployed. — shape varies: new_tag, old_tag, deleted_classes, new_classes, new_sqlite_classes | new_tag, old_tag, steps","properties":{}},"modules":{"type":"array","description":"Code, sourcemaps, and other content used at runtime. This includes [_headers](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) and [_redirects](https://developers.cloudflare.com/workers/static-assets/redirects/) files used to configure [Static Assets](https://developers.cloudflare.com/workers/static-assets/). _headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.","items":{"type":"object","properties":{"content_base64":{"type":"string","description":"The base64-encoded module content.","required":true},"content_type":{"type":"string","description":"The content type of the module.","required":true},"name":{"type":"string","description":"The name of the module.","required":true}}}},"number":{"type":"number","description":"The integer version number, starting from one.","required":true},"package_dependencies":{"type":"array","description":"The list of npm packages that were installed and used when this Worker version was built.","items":{"type":"object","properties":{"installedVersion":{"type":"string","description":"The exact version that was resolved and installed by the package manager.","required":true},"name":{"type":"string","description":"The npm package name.","required":true},"packageJsonVersion":{"type":"string","description":"The version constraint as written in package.json.","required":true}}}},"placement":{"type":"object","description":"Configuration for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). Specify mode='smart' for Smart Placement, or one of region/hostname/host.","properties":{}},"source":{"type":"string","description":"The client used to create the version."},"startup_time_ms":{"type":"number","description":"Time in milliseconds spent on [Worker startup](https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time)."},"urls":{"type":"array","description":"All routable URLs that always point to this version. Does not include alias URLs, since aliases can be updated to point to a different version.","required":true,"items":{"type":"string"}},"usage_model":{"type":"string","description":"Usage model for the version.","enum":["standard","bundled","unbound"]}}},"example":{"annotations":{},"assets":{},"author_email":"user@example.com","author_id":"408cbcdfd4dda4617efef40b04d168a1","bindings":[{"text":"my_data","type":"plain_text","name":"MY_ENV_VAR"}],"cache_options":{},"compatibility_date":"2021-01-01T00:00:00Z","compatibility_flags":["nodejs_compat"],"containers":[{"class_name":"MyDurableObject"}],"created_on":"","exports":{},"exports_reconciliation":{},"id":"","limits":{},"main_module":"index.js","migration_tag":"v1","migrations":{},"modules":[],"number":"","package_dependencies":[],"placement":{},"source":"wrangler","startup_time_ms":10,"urls":["https://9387e76d-my-worker.my-subdomain.workers.dev"],"usage_model":"standard"}}}}}},"/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}":{"get":{"tags":["Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"version_id","in":"path","description":"Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal \"latest\" to operate on the most recently created version.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}},{"name":"include","in":"query","description":"Whether to include the modules property of the version in the response, which contains code and sourcemap content and may add several megabytes to the response size.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["modules"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}"},"summary":"Get Version","description":"Get details about a specific version.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Versions"],"parameters":[{"name":"account_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"version_id","in":"path","description":"Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal \"latest\" to operate on the most recently created version.","required":true,"schema":{"type":"string","example":""}},{"name":"worker_id","in":"path","description":"Identifier for the Worker, which can be ID or name.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}"},"summary":"Delete Version","description":"Delete a version.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/workers/builds/deploy_hooks/{deploy_hook_uuid}":{"post":{"tags":["Deploy Hooks"],"parameters":[{"name":"deploy_hook_uuid","in":"path","description":"Deploy hook uuid","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/workers/builds/deploy_hooks/{deploy_hook_uuid}"},"summary":"Trigger deploy hook","description":"Trigger a build using a deploy hook. This endpoint does not require authentication - the deploy_hook_uuid acts as a secret token.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/client/v4/zones/{zone_id}/workers/routes":{"get":{"tags":["Worker Routes"],"parameters":[{"name":"zone_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/zones/{zone_id}/workers/routes"},"summary":"List Routes","description":"Returns routes for a zone.","security":[{"bearerAuth":[]}]},"post":{"tags":["Worker Routes"],"parameters":[{"name":"zone_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/zones/{zone_id}/workers/routes"},"summary":"Create Route","description":"Creates a route that maps a URL pattern to a Worker.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"id":{"type":"string","description":"Identifier.","required":true},"pattern":{"type":"string","description":"Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior).","required":true},"script":{"type":"string","description":"Name of the script to run if the route matches."}}},"example":{"id":"023e105f4ecef8ad9ca31a8372d0c353","pattern":"example.com/*","script":"my-workers-script"}}}}}},"/client/v4/zones/{zone_id}/workers/routes/{route_id}":{"get":{"tags":["Worker Routes"],"parameters":[{"name":"route_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/zones/{zone_id}/workers/routes/{route_id}"},"summary":"Get Route","description":"Returns information about a route, including URL pattern and Worker.","security":[{"bearerAuth":[]}]},"put":{"tags":["Worker Routes"],"parameters":[{"name":"route_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/zones/{zone_id}/workers/routes/{route_id}"},"summary":"Update Route","description":"Updates the URL pattern or Worker associated with a route.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"id":{"type":"string","description":"Identifier.","required":true},"pattern":{"type":"string","description":"Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior).","required":true},"script":{"type":"string","description":"Name of the script to run if the route matches."}}},"example":{"id":"023e105f4ecef8ad9ca31a8372d0c353","pattern":"example.com/*","script":"my-workers-script"}}}}},"delete":{"tags":["Worker Routes"],"parameters":[{"name":"route_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}},{"name":"zone_id","in":"path","description":"Identifier.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://developers.cloudflare.com/api/resources/workers/","api_endpoint":"https://api.cloudflare.com/client/v4/zones/{zone_id}/workers/routes/{route_id}"},"summary":"Delete Route","description":"Deletes a route.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}