Update Queue Consumer
PUT/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}
Updates the consumer for a queue, or creates one if it does not exist.
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)
Path Parameters
Update Queue Consumer
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/queues/$QUEUE_ID/consumers/$CONSUMER_ID \
-X PUT \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"script_name": "my-consumer-worker",
"type": "worker",
"dead_letter_queue": "example-queue"
}'{
"errors": [
{
"code": 7003,
"message": "No route for the URI",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"consumer_id": "023e105f4ecef8ad9ca31a8372d0c353",
"created_on": "2019-12-27T18:11:19.117Z",
"dead_letter_queue": "dead_letter_queue",
"queue_name": "example-queue",
"script_name": "my-consumer-worker",
"settings": {
"batch_size": 50,
"max_concurrency": 10,
"max_retries": 3,
"max_wait_time_ms": 5000,
"retry_delay": 10
},
"type": "worker"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 7003,
"message": "No route for the URI",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"consumer_id": "023e105f4ecef8ad9ca31a8372d0c353",
"created_on": "2019-12-27T18:11:19.117Z",
"dead_letter_queue": "dead_letter_queue",
"queue_name": "example-queue",
"script_name": "my-consumer-worker",
"settings": {
"batch_size": 50,
"max_concurrency": 10,
"max_retries": 3,
"max_wait_time_ms": 5000,
"retry_delay": 10
},
"type": "worker"
},
"success": true
}