List Workers
workers.beta.workers.list(WorkerListParams**kwargs) -> SyncV4PagePaginationArray[Worker]
GET/accounts/{account_id}/workers/workers
List all Workers for an account.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Parameters
List Workers
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
page = client.workers.beta.workers.list(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
page = page.result[0]
print(page.id){
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"created_on": "2019-12-27T18:11:19.117Z",
"logpush": true,
"name": "my-worker",
"observability": {
"enabled": true,
"head_sampling_rate": 1,
"logs": {
"destinations": [
"string"
],
"enabled": true,
"head_sampling_rate": 1,
"invocation_logs": true,
"persist": true
},
"traces": {
"destinations": [
"string"
],
"enabled": true,
"head_sampling_rate": 1,
"persist": true
}
},
"references": {
"dispatch_namespace_outbounds": [
{
"namespace_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"namespace_name": "my-dispatch-namespace",
"worker_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"worker_name": "my-worker"
}
],
"domains": [
{
"id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"certificate_id": "certificate_id",
"hostname": "my-worker.example.com",
"zone_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"zone_name": "example.com"
}
],
"durable_objects": [
{
"namespace_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"namespace_name": "my-durable-object-namespace",
"worker_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"worker_name": "my-worker"
}
],
"queues": [
{
"queue_consumer_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"queue_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"queue_name": "my-queue"
}
],
"workers": [
{
"id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"name": "my-worker"
}
]
},
"subdomain": {
"enabled": true,
"previews_enabled": true
},
"tags": [
"my-team",
"my-public-api"
],
"tail_consumers": [
{
"name": "my-tail-consumer"
}
],
"updated_on": "2019-12-27T18:11:19.117Z",
"deployed_on": "2019-12-27T18:11:19.117Z"
}
],
"success": true,
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000,
"total_pages": 100
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"created_on": "2019-12-27T18:11:19.117Z",
"logpush": true,
"name": "my-worker",
"observability": {
"enabled": true,
"head_sampling_rate": 1,
"logs": {
"destinations": [
"string"
],
"enabled": true,
"head_sampling_rate": 1,
"invocation_logs": true,
"persist": true
},
"traces": {
"destinations": [
"string"
],
"enabled": true,
"head_sampling_rate": 1,
"persist": true
}
},
"references": {
"dispatch_namespace_outbounds": [
{
"namespace_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"namespace_name": "my-dispatch-namespace",
"worker_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"worker_name": "my-worker"
}
],
"domains": [
{
"id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"certificate_id": "certificate_id",
"hostname": "my-worker.example.com",
"zone_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"zone_name": "example.com"
}
],
"durable_objects": [
{
"namespace_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"namespace_name": "my-durable-object-namespace",
"worker_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"worker_name": "my-worker"
}
],
"queues": [
{
"queue_consumer_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"queue_id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"queue_name": "my-queue"
}
],
"workers": [
{
"id": "e8f70fdbc8b1fb0b8ddb1af166186758",
"name": "my-worker"
}
]
},
"subdomain": {
"enabled": true,
"previews_enabled": true
},
"tags": [
"my-team",
"my-public-api"
],
"tail_consumers": [
{
"name": "my-tail-consumer"
}
],
"updated_on": "2019-12-27T18:11:19.117Z",
"deployed_on": "2019-12-27T18:11:19.117Z"
}
],
"success": true,
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000,
"total_pages": 100
}
}