POST /zones/{zone_id}/waiting_rooms
Creates a new waiting room.
Servers
- https://api.cloudflare.com/client/v4
Path parameters
Name | Type | Required | Description |
---|---|---|---|
zone_id |
String | Yes |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
custom_page_html |
String | No |
Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge:
To view the full list of variables, look at the |
cookie_attributes |
Object | No |
Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. |
cookie_attributes.secure |
String | No |
Configures the Secure attribute on the waiting room cookie. Value Possible values:
Default value: "auto" |
cookie_attributes.samesite |
String | No |
Configures the SameSite attribute on the waiting room cookie. Value Possible values:
Default value: "auto" |
session_duration |
Integer | No |
Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. Default value: 5 |
description |
String | No |
A note that you can use to add more details about the waiting room. |
cookie_suffix |
String | No |
Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If |
suspended |
Boolean | No |
Suspends or allows traffic going to the waiting room. If set to Default value: false |
additional_routes[] |
Array | No |
Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. |
additional_routes[].host |
String | No |
The hostname to which this waiting room will be applied (no wildcards). The hostname must be the primary domain, subdomain, or custom hostname (if using SSL for SaaS) of this zone. Please do not include the scheme (http:// or https://). |
additional_routes[].path |
String | No |
Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. Default value: "/" |
default_template_language |
String | No |
The language of the default page template. If no default_template_language is provided, then Possible values:
Default value: "en-US" |
enabled_origin_commands[] |
Array | No |
A list of enabled origin commands. |
json_response_enabled |
Boolean | No |
Only available for the Waiting Room Advanced subscription. If
An example cURL to a waiting room could be: curl -X GET "https://example.com/waitingroom" If { "cfWaitingRoom": { "inWaitingRoom": true, "waitTimeKnown": true, "waitTime": 10, "waitTime25Percentile": 0, "waitTime50Percentile": 0, "waitTime75Percentile": 0, "waitTimeFormatted": "10 minutes", "queueIsFull": false, "queueAll": false, "lastUpdated": "2020-08-03T23:46:00.000Z", "refreshIntervalSeconds": 20, "queueingMethod": "fifo", "isFIFOQueue": true, "isRandomQueue": false, "isPassthroughQueue": false, "isRejectQueue": false, "isEventActive": false, "isEventPrequeueing": false, "timeUntilEventStart": 0, "timeUntilEventStartFormatted": "unavailable", "timeUntilEventEnd": 0, "timeUntilEventEndFormatted": "unavailable", "shuffleAtEventStart": false } } If { "cfWaitingRoom": { "inWaitingRoom": true, "waitTimeKnown": true, "waitTime": 10, "waitTime25Percentile": 5, "waitTime50Percentile": 10, "waitTime75Percentile": 15, "waitTimeFormatted": "5 minutes to 15 minutes", "queueIsFull": false, "queueAll": false, "lastUpdated": "2020-08-03T23:46:00.000Z", "refreshIntervalSeconds": 20, "queueingMethod": "random", "isFIFOQueue": false, "isRandomQueue": true, "isPassthroughQueue": false, "isRejectQueue": false, "isEventActive": true, "isEventPrequeueing": false, "timeUntilEventStart": 0, "timeUntilEventStartFormatted": "unavailable", "timeUntilEventEnd": 15, "timeUntilEventEndFormatted": "15 minutes", "shuffleAtEventStart": true } } Default value: false |
disable_session_renewal |
Boolean | No |
Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If Default value: false |
host |
String | Yes |
The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. |
queueing_method |
String | No |
Sets the queueing method used by the waiting room. Changing this parameter from the default queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if
Possible values:
Default value: "fifo" |
new_users_per_minute |
Integer | Yes |
Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. |
path |
String | No |
Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. Default value: "/" |
name |
String | Yes |
A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. |
queueing_status_code |
Integer | No |
HTTP status code returned to a user while in the queue. Possible values:
Default value: 200 |
total_active_users |
Integer | Yes |
Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. |
turnstile_action |
String | No |
Which action to take when a bot is detected using Turnstile. Possible values:
Default value: "log" |
turnstile_mode |
String | No |
Which Turnstile widget type to use for detecting bot traffic. See
the Turnstile documentation
for the definitions of these widget types. Set to Possible values:
Default value: "invisible" |
queue_all |
Boolean | No |
If queue_all is Default value: false |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.