Skip to content
Start here

Waiting Rooms

List waiting rooms for account or zone
client.WaitingRooms.List(ctx, params) (*V4PagePaginationArray[WaitingRoom], error)
GET/{accounts_or_zones}/{account_or_zone_id}/waiting_rooms
Waiting room details
client.WaitingRooms.Get(ctx, waitingRoomID, query) (*WaitingRoom, error)
GET/zones/{zone_id}/waiting_rooms/{waiting_room_id}
Create waiting room
client.WaitingRooms.New(ctx, params) (*WaitingRoom, error)
POST/zones/{zone_id}/waiting_rooms
Update waiting room
client.WaitingRooms.Update(ctx, waitingRoomID, params) (*WaitingRoom, error)
PUT/zones/{zone_id}/waiting_rooms/{waiting_room_id}
Patch waiting room
client.WaitingRooms.Edit(ctx, waitingRoomID, params) (*WaitingRoom, error)
PATCH/zones/{zone_id}/waiting_rooms/{waiting_room_id}
Delete waiting room
client.WaitingRooms.Delete(ctx, waitingRoomID, body) (*WaitingRoomDeleteResponse, error)
DELETE/zones/{zone_id}/waiting_rooms/{waiting_room_id}
ModelsExpand Collapse
type AdditionalRoutes struct{…}
Host stringoptional

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://).

Path stringoptional

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.

One of the following:
One of the following:
type Query struct{…}
Host string

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.

Name string

A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.

NewUsersPerMinute int64

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.

maximum2147483647
minimum200
TotalActiveUsers int64

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.

maximum2147483647
minimum200
AdditionalRoutes []AdditionalRoutesoptional

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.

Host stringoptional

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://).

Path stringoptional

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.

CustomPageHTML stringoptional

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:

  1. {{waitTimeKnown}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is true.
  2. {{waitTimeFormatted}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use:
  3. {{waitTime}} Number of minutes of estimated wait for a user.
  4. {{waitTimeHours}} Number of hours of estimated wait for a user (Math.floor(waitTime/60)).
  5. {{waitTimeHourMinutes}} Number of minutes above the waitTimeHours value (waitTime%60).
  6. {{queueIsFull}} Changes to true when no more people can be added to the queue.

To view the full list of variables, look at the cfWaitingRoom object described under the json_response_enabled property in other Waiting Room API calls.

DefaultTemplateLanguage QueryDefaultTemplateLanguageoptional

The language of the default page template. If no default_template_language is provided, then en-US (English) will be used.

One of the following:
const QueryDefaultTemplateLanguageEnUs QueryDefaultTemplateLanguage = "en-US"
const QueryDefaultTemplateLanguageEsEs QueryDefaultTemplateLanguage = "es-ES"
const QueryDefaultTemplateLanguageDeDe QueryDefaultTemplateLanguage = "de-DE"
const QueryDefaultTemplateLanguageFrFr QueryDefaultTemplateLanguage = "fr-FR"
const QueryDefaultTemplateLanguageItIt QueryDefaultTemplateLanguage = "it-IT"
const QueryDefaultTemplateLanguageJaJp QueryDefaultTemplateLanguage = "ja-JP"
const QueryDefaultTemplateLanguageKoKr QueryDefaultTemplateLanguage = "ko-KR"
const QueryDefaultTemplateLanguagePtBr QueryDefaultTemplateLanguage = "pt-BR"
const QueryDefaultTemplateLanguageZhCn QueryDefaultTemplateLanguage = "zh-CN"
const QueryDefaultTemplateLanguageZhTw QueryDefaultTemplateLanguage = "zh-TW"
const QueryDefaultTemplateLanguageNlNl QueryDefaultTemplateLanguage = "nl-NL"
const QueryDefaultTemplateLanguagePlPl QueryDefaultTemplateLanguage = "pl-PL"
const QueryDefaultTemplateLanguageIDID QueryDefaultTemplateLanguage = "id-ID"
const QueryDefaultTemplateLanguageTrTr QueryDefaultTemplateLanguage = "tr-TR"
const QueryDefaultTemplateLanguageArEg QueryDefaultTemplateLanguage = "ar-EG"
const QueryDefaultTemplateLanguageRuRu QueryDefaultTemplateLanguage = "ru-RU"
const QueryDefaultTemplateLanguageFaIr QueryDefaultTemplateLanguage = "fa-IR"
const QueryDefaultTemplateLanguageBgBg QueryDefaultTemplateLanguage = "bg-BG"
const QueryDefaultTemplateLanguageHrHr QueryDefaultTemplateLanguage = "hr-HR"
const QueryDefaultTemplateLanguageCsCz QueryDefaultTemplateLanguage = "cs-CZ"
const QueryDefaultTemplateLanguageDaDK QueryDefaultTemplateLanguage = "da-DK"
const QueryDefaultTemplateLanguageFiFi QueryDefaultTemplateLanguage = "fi-FI"
const QueryDefaultTemplateLanguageLtLt QueryDefaultTemplateLanguage = "lt-LT"
const QueryDefaultTemplateLanguageMsMy QueryDefaultTemplateLanguage = "ms-MY"
const QueryDefaultTemplateLanguageNbNo QueryDefaultTemplateLanguage = "nb-NO"
const QueryDefaultTemplateLanguageRoRo QueryDefaultTemplateLanguage = "ro-RO"
const QueryDefaultTemplateLanguageElGr QueryDefaultTemplateLanguage = "el-GR"
const QueryDefaultTemplateLanguageHeIl QueryDefaultTemplateLanguage = "he-IL"
const QueryDefaultTemplateLanguageHiIn QueryDefaultTemplateLanguage = "hi-IN"
const QueryDefaultTemplateLanguageHuHu QueryDefaultTemplateLanguage = "hu-HU"
const QueryDefaultTemplateLanguageSrBa QueryDefaultTemplateLanguage = "sr-BA"
const QueryDefaultTemplateLanguageSkSk QueryDefaultTemplateLanguage = "sk-SK"
const QueryDefaultTemplateLanguageSlSi QueryDefaultTemplateLanguage = "sl-SI"
const QueryDefaultTemplateLanguageSvSe QueryDefaultTemplateLanguage = "sv-SE"
const QueryDefaultTemplateLanguageTlPh QueryDefaultTemplateLanguage = "tl-PH"
const QueryDefaultTemplateLanguageThTh QueryDefaultTemplateLanguage = "th-TH"
const QueryDefaultTemplateLanguageUkUA QueryDefaultTemplateLanguage = "uk-UA"
const QueryDefaultTemplateLanguageViVn QueryDefaultTemplateLanguage = "vi-VN"
Description stringoptional

A note that you can use to add more details about the waiting room.

DisableSessionRenewal booloptional

Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If true, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If false, a user's session cookie will be automatically renewed on every request.

EnabledOriginCommands []QueryEnabledOriginCommandoptional

A list of enabled origin commands.

JsonResponseEnabled booloptional

Only available for the Waiting Room Advanced subscription. If true, requests to the waiting room with the header Accept: application/json will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property cfWaitingRoom which is an object containing the following fields:

  1. inWaitingRoom: Boolean indicating if the user is in the waiting room (always true).
  2. waitTimeKnown: Boolean indicating if the current estimated wait times are accurate. If false, they are not available.
  3. waitTime: Valid only when waitTimeKnown is true. Integer indicating the current estimated time in minutes the user will wait in the waiting room. When queueingMethod is random, this is set to waitTime50Percentile.
  4. waitTime25Percentile: Valid only when queueingMethod is random and waitTimeKnown is true. Integer indicating the current estimated maximum wait time for the 25% of users that gain entry the fastest (25th percentile).
  5. waitTime50Percentile: Valid only when queueingMethod is random and waitTimeKnown is true. Integer indicating the current estimated maximum wait time for the 50% of users that gain entry the fastest (50th percentile). In other words, half of the queued users are expected to let into the origin website before waitTime50Percentile and half are expected to be let in after it.
  6. waitTime75Percentile: Valid only when queueingMethod is random and waitTimeKnown is true. Integer indicating the current estimated maximum wait time for the 75% of users that gain entry the fastest (75th percentile).
  7. waitTimeFormatted: String displaying the waitTime formatted in English for users. If waitTimeKnown is false, waitTimeFormatted will display unavailable.
  8. queueIsFull: Boolean indicating if the waiting room's queue is currently full and not accepting new users at the moment.
  9. queueAll: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website.
  10. lastUpdated: String displaying the timestamp as an ISO 8601 string of the user's last attempt to leave the waiting room and be let into the origin website. The user is able to make another attempt after refreshIntervalSeconds past this time. If the user makes a request too soon, it will be ignored and lastUpdated will not change.
  11. refreshIntervalSeconds: Integer indicating the number of seconds after lastUpdated until the user is able to make another attempt to leave the waiting room and be let into the origin website. When the queueingMethod is reject, there is no specified refresh time —_it will always be zero.
  12. queueingMethod: The queueing method currently used by the waiting room. It is either fifo, random, passthrough, or reject.
  13. isFIFOQueue: Boolean indicating if the waiting room uses a FIFO (First-In-First-Out) queue.
  14. isRandomQueue: Boolean indicating if the waiting room uses a Random queue where users gain access randomly.
  15. isPassthroughQueue: Boolean indicating if the waiting room uses a passthrough queue. Keep in mind that when passthrough is enabled, this JSON response will only exist when queueAll is true or isEventPrequeueing is true because in all other cases requests will go directly to the origin.
  16. isRejectQueue: Boolean indicating if the waiting room uses a reject queue.
  17. isEventActive: Boolean indicating if an event is currently occurring. Events are able to change a waiting room's behavior during a specified period of time. For additional information, look at the event properties prequeue_start_time, event_start_time, and event_end_time in the documentation for creating waiting room events. Events are considered active between these start and end times, as well as during the prequeueing period if it exists.
  18. isEventPrequeueing: Valid only when isEventActive is true. Boolean indicating if an event is currently prequeueing users before it starts.
  19. timeUntilEventStart: Valid only when isEventPrequeueing is true. Integer indicating the number of minutes until the event starts.
  20. timeUntilEventStartFormatted: String displaying the timeUntilEventStart formatted in English for users. If isEventPrequeueing is false, timeUntilEventStartFormatted will display unavailable.
  21. timeUntilEventEnd: Valid only when isEventActive is true. Integer indicating the number of minutes until the event ends.
  22. timeUntilEventEndFormatted: String displaying the timeUntilEventEnd formatted in English for users. If isEventActive is false, timeUntilEventEndFormatted will display unavailable.
  23. shuffleAtEventStart: Valid only when isEventActive is true. Boolean indicating if the users in the prequeue are shuffled randomly when the event starts.
  24. turnstile: Empty when turnstile isn't enabled. String displaying an html tag to display the Turnstile widget. Please add the {{{turnstile}}} tag to the custom_html template to ensure the Turnstile widget appears.
  25. infiniteQueue: Boolean indicating whether the response is for a user in the infinite queue.

An example cURL to a waiting room could be:

curl -X GET "https://example.com/waitingroom" \
	-H "Accept: application/json"

If json_response_enabled is true and the request hits the waiting room, an example JSON response when queueingMethod is fifo and no event is active could be:

{
	"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 json_response_enabled is true and the request hits the waiting room, an example JSON response when queueingMethod is random and an event is active could be:

{
	"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
	}
}
Path stringoptional

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.

QueueAll booloptional

If queue_all is true, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable.

QueueingMethod QueryQueueingMethodoptional

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 queue_all is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:

  1. fifo (default): First-In-First-Out queue where customers gain access in the order they arrived.
  2. random: Random queue where customers gain access randomly, regardless of arrival time.
  3. passthrough: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with suspended) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.
  4. reject: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses reject, and its events override this with fifo, random, or passthrough. When this queueing method is enabled and neither queueAll is enabled nor an event is prequeueing, the waiting room page will not refresh automatically.
One of the following:
const QueryQueueingMethodFifo QueryQueueingMethod = "fifo"
const QueryQueueingMethodRandom QueryQueueingMethod = "random"
const QueryQueueingMethodPassthrough QueryQueueingMethod = "passthrough"
const QueryQueueingMethodReject QueryQueueingMethod = "reject"
QueueingStatusCode QueryQueueingStatusCodeoptional

HTTP status code returned to a user while in the queue.

One of the following:
const QueryQueueingStatusCode200 QueryQueueingStatusCode = 200
const QueryQueueingStatusCode202 QueryQueueingStatusCode = 202
const QueryQueueingStatusCode429 QueryQueueingStatusCode = 429
SessionDuration int64optional

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.

maximum30
minimum1
Suspended booloptional

Suspends or allows traffic going to the waiting room. If set to true, the traffic will not go to the waiting room.

TurnstileAction QueryTurnstileActionoptional

Which action to take when a bot is detected using Turnstile. log will have no impact on queueing behavior, simply keeping track of how many bots are detected in Waiting Room Analytics. infinite_queue will send bots to a false queueing state, where they will never reach your origin. infinite_queue requires Advanced Waiting Room.

One of the following:
const QueryTurnstileActionLog QueryTurnstileAction = "log"
const QueryTurnstileActionInfiniteQueue QueryTurnstileAction = "infinite_queue"
TurnstileMode QueryTurnstileModeoptional

Which Turnstile widget type to use for detecting bot traffic. See the Turnstile documentation for the definitions of these widget types. Set to off to disable the Turnstile integration entirely. Setting this to anything other than off or invisible requires Advanced Waiting Room.

One of the following:
const QueryTurnstileModeOff QueryTurnstileMode = "off"
const QueryTurnstileModeInvisible QueryTurnstileMode = "invisible"
const QueryTurnstileModeVisibleNonInteractive QueryTurnstileMode = "visible_non_interactive"
const QueryTurnstileModeVisibleManaged QueryTurnstileMode = "visible_managed"
type WaitingRoom struct{…}
ID stringoptional
AdditionalRoutes []AdditionalRoutesoptional

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.

Host stringoptional

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://).

Path stringoptional

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.

CreatedOn Timeoptional
formatdate-time
CustomPageHTML stringoptional

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:

  1. {{waitTimeKnown}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is true.
  2. {{waitTimeFormatted}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use:
  3. {{waitTime}} Number of minutes of estimated wait for a user.
  4. {{waitTimeHours}} Number of hours of estimated wait for a user (Math.floor(waitTime/60)).
  5. {{waitTimeHourMinutes}} Number of minutes above the waitTimeHours value (waitTime%60).
  6. {{queueIsFull}} Changes to true when no more people can be added to the queue.

To view the full list of variables, look at the cfWaitingRoom object described under the json_response_enabled property in other Waiting Room API calls.

DefaultTemplateLanguage WaitingRoomDefaultTemplateLanguageoptional

The language of the default page template. If no default_template_language is provided, then en-US (English) will be used.

One of the following:
const WaitingRoomDefaultTemplateLanguageEnUs WaitingRoomDefaultTemplateLanguage = "en-US"
const WaitingRoomDefaultTemplateLanguageEsEs WaitingRoomDefaultTemplateLanguage = "es-ES"
const WaitingRoomDefaultTemplateLanguageDeDe WaitingRoomDefaultTemplateLanguage = "de-DE"
const WaitingRoomDefaultTemplateLanguageFrFr WaitingRoomDefaultTemplateLanguage = "fr-FR"
const WaitingRoomDefaultTemplateLanguageItIt WaitingRoomDefaultTemplateLanguage = "it-IT"
const WaitingRoomDefaultTemplateLanguageJaJp WaitingRoomDefaultTemplateLanguage = "ja-JP"
const WaitingRoomDefaultTemplateLanguageKoKr WaitingRoomDefaultTemplateLanguage = "ko-KR"
const WaitingRoomDefaultTemplateLanguagePtBr WaitingRoomDefaultTemplateLanguage = "pt-BR"
const WaitingRoomDefaultTemplateLanguageZhCn WaitingRoomDefaultTemplateLanguage = "zh-CN"
const WaitingRoomDefaultTemplateLanguageZhTw WaitingRoomDefaultTemplateLanguage = "zh-TW"
const WaitingRoomDefaultTemplateLanguageNlNl WaitingRoomDefaultTemplateLanguage = "nl-NL"
const WaitingRoomDefaultTemplateLanguagePlPl WaitingRoomDefaultTemplateLanguage = "pl-PL"
const WaitingRoomDefaultTemplateLanguageIDID WaitingRoomDefaultTemplateLanguage = "id-ID"
const WaitingRoomDefaultTemplateLanguageTrTr WaitingRoomDefaultTemplateLanguage = "tr-TR"
const WaitingRoomDefaultTemplateLanguageArEg WaitingRoomDefaultTemplateLanguage = "ar-EG"
const WaitingRoomDefaultTemplateLanguageRuRu WaitingRoomDefaultTemplateLanguage = "ru-RU"
const WaitingRoomDefaultTemplateLanguageFaIr WaitingRoomDefaultTemplateLanguage = "fa-IR"
const WaitingRoomDefaultTemplateLanguageBgBg WaitingRoomDefaultTemplateLanguage = "bg-BG"
const WaitingRoomDefaultTemplateLanguageHrHr WaitingRoomDefaultTemplateLanguage = "hr-HR"
const WaitingRoomDefaultTemplateLanguageCsCz WaitingRoomDefaultTemplateLanguage = "cs-CZ"
const WaitingRoomDefaultTemplateLanguageDaDK WaitingRoomDefaultTemplateLanguage = "da-DK"
const WaitingRoomDefaultTemplateLanguageFiFi WaitingRoomDefaultTemplateLanguage = "fi-FI"
const WaitingRoomDefaultTemplateLanguageLtLt WaitingRoomDefaultTemplateLanguage = "lt-LT"
const WaitingRoomDefaultTemplateLanguageMsMy WaitingRoomDefaultTemplateLanguage = "ms-MY"
const WaitingRoomDefaultTemplateLanguageNbNo WaitingRoomDefaultTemplateLanguage = "nb-NO"
const WaitingRoomDefaultTemplateLanguageRoRo WaitingRoomDefaultTemplateLanguage = "ro-RO"
const WaitingRoomDefaultTemplateLanguageElGr WaitingRoomDefaultTemplateLanguage = "el-GR"
const WaitingRoomDefaultTemplateLanguageHeIl WaitingRoomDefaultTemplateLanguage = "he-IL"
const WaitingRoomDefaultTemplateLanguageHiIn WaitingRoomDefaultTemplateLanguage = "hi-IN"
const WaitingRoomDefaultTemplateLanguageHuHu WaitingRoomDefaultTemplateLanguage = "hu-HU"
const WaitingRoomDefaultTemplateLanguageSrBa WaitingRoomDefaultTemplateLanguage = "sr-BA"
const WaitingRoomDefaultTemplateLanguageSkSk WaitingRoomDefaultTemplateLanguage = "sk-SK"
const WaitingRoomDefaultTemplateLanguageSlSi WaitingRoomDefaultTemplateLanguage = "sl-SI"
const WaitingRoomDefaultTemplateLanguageSvSe WaitingRoomDefaultTemplateLanguage = "sv-SE"
const WaitingRoomDefaultTemplateLanguageTlPh WaitingRoomDefaultTemplateLanguage = "tl-PH"
const WaitingRoomDefaultTemplateLanguageThTh WaitingRoomDefaultTemplateLanguage = "th-TH"
const WaitingRoomDefaultTemplateLanguageUkUA WaitingRoomDefaultTemplateLanguage = "uk-UA"
const WaitingRoomDefaultTemplateLanguageViVn WaitingRoomDefaultTemplateLanguage = "vi-VN"
Description stringoptional

A note that you can use to add more details about the waiting room.

DisableSessionRenewal booloptional

Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If true, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If false, a user's session cookie will be automatically renewed on every request.

EnabledOriginCommands []WaitingRoomEnabledOriginCommandoptional

A list of enabled origin commands.

Host stringoptional

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.

JsonResponseEnabled booloptional

Only available for the Waiting Room Advanced subscription. If true, requests to the waiting room with the header Accept: application/json will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property cfWaitingRoom which is an object containing the following fields:

  1. inWaitingRoom: Boolean indicating if the user is in the waiting room (always true).
  2. waitTimeKnown: Boolean indicating if the current estimated wait times are accurate. If false, they are not available.
  3. waitTime: Valid only when waitTimeKnown is true. Integer indicating the current estimated time in minutes the user will wait in the waiting room. When queueingMethod is random, this is set to waitTime50Percentile.
  4. waitTime25Percentile: Valid only when queueingMethod is random and waitTimeKnown is true. Integer indicating the current estimated maximum wait time for the 25% of users that gain entry the fastest (25th percentile).
  5. waitTime50Percentile: Valid only when queueingMethod is random and waitTimeKnown is true. Integer indicating the current estimated maximum wait time for the 50% of users that gain entry the fastest (50th percentile). In other words, half of the queued users are expected to let into the origin website before waitTime50Percentile and half are expected to be let in after it.
  6. waitTime75Percentile: Valid only when queueingMethod is random and waitTimeKnown is true. Integer indicating the current estimated maximum wait time for the 75% of users that gain entry the fastest (75th percentile).
  7. waitTimeFormatted: String displaying the waitTime formatted in English for users. If waitTimeKnown is false, waitTimeFormatted will display unavailable.
  8. queueIsFull: Boolean indicating if the waiting room's queue is currently full and not accepting new users at the moment.
  9. queueAll: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website.
  10. lastUpdated: String displaying the timestamp as an ISO 8601 string of the user's last attempt to leave the waiting room and be let into the origin website. The user is able to make another attempt after refreshIntervalSeconds past this time. If the user makes a request too soon, it will be ignored and lastUpdated will not change.
  11. refreshIntervalSeconds: Integer indicating the number of seconds after lastUpdated until the user is able to make another attempt to leave the waiting room and be let into the origin website. When the queueingMethod is reject, there is no specified refresh time —_it will always be zero.
  12. queueingMethod: The queueing method currently used by the waiting room. It is either fifo, random, passthrough, or reject.
  13. isFIFOQueue: Boolean indicating if the waiting room uses a FIFO (First-In-First-Out) queue.
  14. isRandomQueue: Boolean indicating if the waiting room uses a Random queue where users gain access randomly.
  15. isPassthroughQueue: Boolean indicating if the waiting room uses a passthrough queue. Keep in mind that when passthrough is enabled, this JSON response will only exist when queueAll is true or isEventPrequeueing is true because in all other cases requests will go directly to the origin.
  16. isRejectQueue: Boolean indicating if the waiting room uses a reject queue.
  17. isEventActive: Boolean indicating if an event is currently occurring. Events are able to change a waiting room's behavior during a specified period of time. For additional information, look at the event properties prequeue_start_time, event_start_time, and event_end_time in the documentation for creating waiting room events. Events are considered active between these start and end times, as well as during the prequeueing period if it exists.
  18. isEventPrequeueing: Valid only when isEventActive is true. Boolean indicating if an event is currently prequeueing users before it starts.
  19. timeUntilEventStart: Valid only when isEventPrequeueing is true. Integer indicating the number of minutes until the event starts.
  20. timeUntilEventStartFormatted: String displaying the timeUntilEventStart formatted in English for users. If isEventPrequeueing is false, timeUntilEventStartFormatted will display unavailable.
  21. timeUntilEventEnd: Valid only when isEventActive is true. Integer indicating the number of minutes until the event ends.
  22. timeUntilEventEndFormatted: String displaying the timeUntilEventEnd formatted in English for users. If isEventActive is false, timeUntilEventEndFormatted will display unavailable.
  23. shuffleAtEventStart: Valid only when isEventActive is true. Boolean indicating if the users in the prequeue are shuffled randomly when the event starts.
  24. turnstile: Empty when turnstile isn't enabled. String displaying an html tag to display the Turnstile widget. Please add the {{{turnstile}}} tag to the custom_html template to ensure the Turnstile widget appears.
  25. infiniteQueue: Boolean indicating whether the response is for a user in the infinite queue.

An example cURL to a waiting room could be:

curl -X GET "https://example.com/waitingroom" \
	-H "Accept: application/json"

If json_response_enabled is true and the request hits the waiting room, an example JSON response when queueingMethod is fifo and no event is active could be:

{
	"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 json_response_enabled is true and the request hits the waiting room, an example JSON response when queueingMethod is random and an event is active could be:

{
	"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
	}
}
ModifiedOn Timeoptional
formatdate-time
Name stringoptional

A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.

NewUsersPerMinute int64optional

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.

maximum2147483647
minimum200
NextEventPrequeueStartTime stringoptional

An ISO 8601 timestamp that marks when the next event will begin queueing.

NextEventStartTime stringoptional

An ISO 8601 timestamp that marks when the next event will start.

Path stringoptional

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.

QueueAll booloptional

If queue_all is true, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable.

QueueingMethod WaitingRoomQueueingMethodoptional

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 queue_all is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:

  1. fifo (default): First-In-First-Out queue where customers gain access in the order they arrived.
  2. random: Random queue where customers gain access randomly, regardless of arrival time.
  3. passthrough: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with suspended) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.
  4. reject: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses reject, and its events override this with fifo, random, or passthrough. When this queueing method is enabled and neither queueAll is enabled nor an event is prequeueing, the waiting room page will not refresh automatically.
One of the following:
const WaitingRoomQueueingMethodFifo WaitingRoomQueueingMethod = "fifo"
const WaitingRoomQueueingMethodRandom WaitingRoomQueueingMethod = "random"
const WaitingRoomQueueingMethodPassthrough WaitingRoomQueueingMethod = "passthrough"
const WaitingRoomQueueingMethodReject WaitingRoomQueueingMethod = "reject"
QueueingStatusCode WaitingRoomQueueingStatusCodeoptional

HTTP status code returned to a user while in the queue.

One of the following:
const WaitingRoomQueueingStatusCode200 WaitingRoomQueueingStatusCode = 200
const WaitingRoomQueueingStatusCode202 WaitingRoomQueueingStatusCode = 202
const WaitingRoomQueueingStatusCode429 WaitingRoomQueueingStatusCode = 429
SessionDuration int64optional

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.

maximum30
minimum1
Suspended booloptional

Suspends or allows traffic going to the waiting room. If set to true, the traffic will not go to the waiting room.

TotalActiveUsers int64optional

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.

maximum2147483647
minimum200
TurnstileAction WaitingRoomTurnstileActionoptional

Which action to take when a bot is detected using Turnstile. log will have no impact on queueing behavior, simply keeping track of how many bots are detected in Waiting Room Analytics. infinite_queue will send bots to a false queueing state, where they will never reach your origin. infinite_queue requires Advanced Waiting Room.

One of the following:
const WaitingRoomTurnstileActionLog WaitingRoomTurnstileAction = "log"
const WaitingRoomTurnstileActionInfiniteQueue WaitingRoomTurnstileAction = "infinite_queue"
TurnstileMode WaitingRoomTurnstileModeoptional

Which Turnstile widget type to use for detecting bot traffic. See the Turnstile documentation for the definitions of these widget types. Set to off to disable the Turnstile integration entirely. Setting this to anything other than off or invisible requires Advanced Waiting Room.

One of the following:
const WaitingRoomTurnstileModeOff WaitingRoomTurnstileMode = "off"
const WaitingRoomTurnstileModeInvisible WaitingRoomTurnstileMode = "invisible"
const WaitingRoomTurnstileModeVisibleNonInteractive WaitingRoomTurnstileMode = "visible_non_interactive"
const WaitingRoomTurnstileModeVisibleManaged WaitingRoomTurnstileMode = "visible_managed"

Waiting RoomsPage

Create a custom waiting room page preview
client.WaitingRooms.Page.Preview(ctx, params) (*PagePreviewResponse, error)
POST/zones/{zone_id}/waiting_rooms/preview

Waiting RoomsEvents

List events
client.WaitingRooms.Events.List(ctx, waitingRoomID, params) (*V4PagePaginationArray[Event], error)
GET/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events
Event details
client.WaitingRooms.Events.Get(ctx, waitingRoomID, eventID, query) (*Event, error)
GET/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}
Create event
client.WaitingRooms.Events.New(ctx, waitingRoomID, params) (*Event, error)
POST/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events
Update event
client.WaitingRooms.Events.Update(ctx, waitingRoomID, eventID, params) (*Event, error)
PUT/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}
Patch event
client.WaitingRooms.Events.Edit(ctx, waitingRoomID, eventID, params) (*Event, error)
PATCH/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}
Delete event
client.WaitingRooms.Events.Delete(ctx, waitingRoomID, eventID, body) (*EventDeleteResponse, error)
DELETE/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}
ModelsExpand Collapse
type Event struct{…}
ID stringoptional
CreatedOn Timeoptional
formatdate-time
CustomPageHTML stringoptional

If set, the event will override the waiting room's custom_page_html property while it is active. If null, the event will inherit it.

Description stringoptional

A note that you can use to add more details about the event.

DisableSessionRenewal booloptional

If set, the event will override the waiting room's disable_session_renewal property while it is active. If null, the event will inherit it.

EventEndTime stringoptional

An ISO 8601 timestamp that marks the end of the event.

EventStartTime stringoptional

An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before event_end_time.

ModifiedOn Timeoptional
formatdate-time
Name stringoptional

A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.

NewUsersPerMinute int64optional

If set, the event will override the waiting room's new_users_per_minute property while it is active. If null, the event will inherit it. This can only be set if the event's total_active_users property is also set.

maximum2147483647
minimum200
PrequeueStartTime stringoptional

An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before event_start_time.

QueueingMethod stringoptional

If set, the event will override the waiting room's queueing_method property while it is active. If null, the event will inherit it.

SessionDuration int64optional

If set, the event will override the waiting room's session_duration property while it is active. If null, the event will inherit it.

maximum30
minimum1
ShuffleAtEventStart booloptional

If enabled, users in the prequeue will be shuffled randomly at the event_start_time. Requires that prequeue_start_time is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the queueing_method during the event respects ordering such as fifo, or else the shuffling may be unnecessary.

Suspended booloptional

Suspends or allows an event. If set to true, the event is ignored and traffic will be handled based on the waiting room configuration.

TotalActiveUsers int64optional

If set, the event will override the waiting room's total_active_users property while it is active. If null, the event will inherit it. This can only be set if the event's new_users_per_minute property is also set.

maximum2147483647
minimum200
TurnstileAction EventTurnstileActionoptional

If set, the event will override the waiting room's turnstile_action property while it is active. If null, the event will inherit it.

One of the following:
const EventTurnstileActionLog EventTurnstileAction = "log"
const EventTurnstileActionInfiniteQueue EventTurnstileAction = "infinite_queue"
TurnstileMode EventTurnstileModeoptional

If set, the event will override the waiting room's turnstile_mode property while it is active. If null, the event will inherit it.

One of the following:
const EventTurnstileModeOff EventTurnstileMode = "off"
const EventTurnstileModeInvisible EventTurnstileMode = "invisible"
const EventTurnstileModeVisibleNonInteractive EventTurnstileMode = "visible_non_interactive"
const EventTurnstileModeVisibleManaged EventTurnstileMode = "visible_managed"

Waiting RoomsEventsDetails

Preview active event details
client.WaitingRooms.Events.Details.Get(ctx, waitingRoomID, eventID, query) (*EventDetailGetResponse, error)
GET/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}/details
ModelsExpand Collapse
type EventQuery struct{…}
EventEndTime string

An ISO 8601 timestamp that marks the end of the event.

EventStartTime string

An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before event_end_time.

Name string

A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.

CustomPageHTML stringoptional

If set, the event will override the waiting room's custom_page_html property while it is active. If null, the event will inherit it.

Description stringoptional

A note that you can use to add more details about the event.

DisableSessionRenewal booloptional

If set, the event will override the waiting room's disable_session_renewal property while it is active. If null, the event will inherit it.

NewUsersPerMinute int64optional

If set, the event will override the waiting room's new_users_per_minute property while it is active. If null, the event will inherit it. This can only be set if the event's total_active_users property is also set.

maximum2147483647
minimum200
PrequeueStartTime stringoptional

An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before event_start_time.

QueueingMethod stringoptional

If set, the event will override the waiting room's queueing_method property while it is active. If null, the event will inherit it.

SessionDuration int64optional

If set, the event will override the waiting room's session_duration property while it is active. If null, the event will inherit it.

maximum30
minimum1
ShuffleAtEventStart booloptional

If enabled, users in the prequeue will be shuffled randomly at the event_start_time. Requires that prequeue_start_time is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the queueing_method during the event respects ordering such as fifo, or else the shuffling may be unnecessary.

Suspended booloptional

Suspends or allows an event. If set to true, the event is ignored and traffic will be handled based on the waiting room configuration.

TotalActiveUsers int64optional

If set, the event will override the waiting room's total_active_users property while it is active. If null, the event will inherit it. This can only be set if the event's new_users_per_minute property is also set.

maximum2147483647
minimum200
TurnstileAction EventQueryTurnstileActionoptional

If set, the event will override the waiting room's turnstile_action property while it is active. If null, the event will inherit it.

One of the following:
const EventQueryTurnstileActionLog EventQueryTurnstileAction = "log"
const EventQueryTurnstileActionInfiniteQueue EventQueryTurnstileAction = "infinite_queue"
TurnstileMode EventQueryTurnstileModeoptional

If set, the event will override the waiting room's turnstile_mode property while it is active. If null, the event will inherit it.

One of the following:
const EventQueryTurnstileModeOff EventQueryTurnstileMode = "off"
const EventQueryTurnstileModeInvisible EventQueryTurnstileMode = "invisible"
const EventQueryTurnstileModeVisibleNonInteractive EventQueryTurnstileMode = "visible_non_interactive"
const EventQueryTurnstileModeVisibleManaged EventQueryTurnstileMode = "visible_managed"

Waiting RoomsRules

List Waiting Room Rules
client.WaitingRooms.Rules.Get(ctx, waitingRoomID, query) (*SinglePage[WaitingRoomRule], error)
GET/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules
Create Waiting Room Rule
client.WaitingRooms.Rules.New(ctx, waitingRoomID, params) (*SinglePage[WaitingRoomRule], error)
POST/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules
Replace Waiting Room Rules
client.WaitingRooms.Rules.Update(ctx, waitingRoomID, params) (*SinglePage[WaitingRoomRule], error)
PUT/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules
Patch Waiting Room Rule
client.WaitingRooms.Rules.Edit(ctx, waitingRoomID, ruleID, params) (*SinglePage[WaitingRoomRule], error)
PATCH/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}
Delete Waiting Room Rule
client.WaitingRooms.Rules.Delete(ctx, waitingRoomID, ruleID, body) (*SinglePage[WaitingRoomRule], error)
DELETE/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}
ModelsExpand Collapse
type WaitingRoomRule struct{…}
ID stringoptional

The ID of the rule.

Action WaitingRoomRuleActionoptional

The action to take when the expression matches.

Description stringoptional

The description of the rule.

Enabled booloptional

When set to true, the rule is enabled.

Expression stringoptional

Criteria defining when there is a match for the current rule.

LastUpdated Timeoptional
formatdate-time
Version stringoptional

The version of the rule.

Waiting RoomsStatuses

Get waiting room status
client.WaitingRooms.Statuses.Get(ctx, waitingRoomID, query) (*StatusGetResponse, error)
GET/zones/{zone_id}/waiting_rooms/{waiting_room_id}/status

Waiting RoomsSettings

Get zone-level Waiting Room settings
client.WaitingRooms.Settings.Get(ctx, query) (*SettingGetResponse, error)
GET/zones/{zone_id}/waiting_rooms/settings
Update zone-level Waiting Room settings
client.WaitingRooms.Settings.Update(ctx, params) (*SettingUpdateResponse, error)
PUT/zones/{zone_id}/waiting_rooms/settings
Patch zone-level Waiting Room settings
client.WaitingRooms.Settings.Edit(ctx, params) (*SettingEditResponse, error)
PATCH/zones/{zone_id}/waiting_rooms/settings
ModelsExpand Collapse
type Setting struct{…}
SearchEngineCrawlerBypass bool

Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone. Verified search engine crawlers will not be tracked or counted by the waiting room system, and will not appear in waiting room analytics.