| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/api/resources/queues/subresources/consumers/methods/update | [Back] [Original] |
Updates the consumer for a queue, or creates one if it does not exist.
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYThe previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Queues WriteWorkers Scripts WriteRequest body for creating or updating a consumer
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platforms maximum (recommended).
Response body representing a consumer
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platforms maximum (recommended).
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
}{
"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
}| Web Proxy Viewer | New URL | Original Page |