---
title: UA Rules
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

[Firewall](https://developers.cloudflare.com/api/typescript/resources/firewall)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# UA Rules

##### [List User Agent Blocking rules](https://developers.cloudflare.com/api/typescript/resources/firewall/subresources/ua%5Frules/methods/list)

client.firewall.uaRules.list(UARuleListParams { zone\_id, description, page, 3 more } params, RequestOptionsoptions?): V4PagePaginationArray<[UARuleListResponse](https://developers.cloudflare.com/api/typescript/resources/firewall#%28resource%29%20firewall.ua%5Frules%20%3E%20%28model%29%20ua%5Frule%5Flist%5Fresponse%20%3E%20%28schema%29) { id, configuration, description, 2 more } \>

GET/zones/{zone\_id}/firewall/ua\_rules

##### [Get a User Agent Blocking rule](https://developers.cloudflare.com/api/typescript/resources/firewall/subresources/ua%5Frules/methods/get)

client.firewall.uaRules.get(stringuaRuleID, UARuleGetParams { zone\_id } params, RequestOptionsoptions?): [UARuleGetResponse](https://developers.cloudflare.com/api/typescript/resources/firewall#%28resource%29%20firewall.ua%5Frules%20%3E%20%28model%29%20ua%5Frule%5Fget%5Fresponse%20%3E%20%28schema%29) { id, configuration, description, 2 more } 

GET/zones/{zone\_id}/firewall/ua\_rules/{ua\_rule\_id}

##### [Create a User Agent Blocking rule](https://developers.cloudflare.com/api/typescript/resources/firewall/subresources/ua%5Frules/methods/create)

client.firewall.uaRules.create(UARuleCreateParams { zone\_id, configuration, mode, 2 more } params, RequestOptionsoptions?): [UARuleCreateResponse](https://developers.cloudflare.com/api/typescript/resources/firewall#%28resource%29%20firewall.ua%5Frules%20%3E%20%28model%29%20ua%5Frule%5Fcreate%5Fresponse%20%3E%20%28schema%29) { id, configuration, description, 2 more } 

POST/zones/{zone\_id}/firewall/ua\_rules

##### [Update a User Agent Blocking rule](https://developers.cloudflare.com/api/typescript/resources/firewall/subresources/ua%5Frules/methods/update)

client.firewall.uaRules.update(stringuaRuleID, UARuleUpdateParams { zone\_id, configuration, mode, 2 more } params, RequestOptionsoptions?): [UARuleUpdateResponse](https://developers.cloudflare.com/api/typescript/resources/firewall#%28resource%29%20firewall.ua%5Frules%20%3E%20%28model%29%20ua%5Frule%5Fupdate%5Fresponse%20%3E%20%28schema%29) { id, configuration, description, 2 more } 

PUT/zones/{zone\_id}/firewall/ua\_rules/{ua\_rule\_id}

##### [Delete a User Agent Blocking rule](https://developers.cloudflare.com/api/typescript/resources/firewall/subresources/ua%5Frules/methods/delete)

client.firewall.uaRules.delete(stringuaRuleID, UARuleDeleteParams { zone\_id } params, RequestOptionsoptions?): [UARuleDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/firewall#%28resource%29%20firewall.ua%5Frules%20%3E%20%28model%29%20ua%5Frule%5Fdelete%5Fresponse%20%3E%20%28schema%29) { id, configuration, description, 2 more } 

DELETE/zones/{zone\_id}/firewall/ua\_rules/{ua\_rule\_id}

##### ModelsExpand Collapse 

UARuleListResponse { id, configuration, description, 2 more } 

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

configuration?: Configuration { target, value } 

The configuration object for the current rule.

target?: string

The configuration target for this rule. You must set the target to `ua` for User Agent Blocking rules.

value?: string

The exact user agent string to match. This value will be compared to the received `User-Agent` HTTP header value.

description?: string

An informative summary of the rule.

maxLength1024

mode?: "block" | "challenge" | "js\_challenge" | "managed\_challenge"

The action to apply to a matched request.

maxLength12

One of the following:

"block"

"challenge"

"js\_challenge"

"managed\_challenge"

paused?: boolean

When true, indicates that the rule is currently paused.

UARuleGetResponse { id, configuration, description, 2 more } 

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

configuration?: Configuration { target, value } 

The configuration object for the current rule.

target?: string

The configuration target for this rule. You must set the target to `ua` for User Agent Blocking rules.

value?: string

The exact user agent string to match. This value will be compared to the received `User-Agent` HTTP header value.

description?: string

An informative summary of the rule.

maxLength1024

mode?: "block" | "challenge" | "js\_challenge" | "managed\_challenge"

The action to apply to a matched request.

maxLength12

One of the following:

"block"

"challenge"

"js\_challenge"

"managed\_challenge"

paused?: boolean

When true, indicates that the rule is currently paused.

UARuleCreateResponse { id, configuration, description, 2 more } 

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

configuration?: Configuration { target, value } 

The configuration object for the current rule.

target?: string

The configuration target for this rule. You must set the target to `ua` for User Agent Blocking rules.

value?: string

The exact user agent string to match. This value will be compared to the received `User-Agent` HTTP header value.

description?: string

An informative summary of the rule.

maxLength1024

mode?: "block" | "challenge" | "js\_challenge" | "managed\_challenge"

The action to apply to a matched request.

maxLength12

One of the following:

"block"

"challenge"

"js\_challenge"

"managed\_challenge"

paused?: boolean

When true, indicates that the rule is currently paused.

UARuleUpdateResponse { id, configuration, description, 2 more } 

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

configuration?: Configuration { target, value } 

The configuration object for the current rule.

target?: string

The configuration target for this rule. You must set the target to `ua` for User Agent Blocking rules.

value?: string

The exact user agent string to match. This value will be compared to the received `User-Agent` HTTP header value.

description?: string

An informative summary of the rule.

maxLength1024

mode?: "block" | "challenge" | "js\_challenge" | "managed\_challenge"

The action to apply to a matched request.

maxLength12

One of the following:

"block"

"challenge"

"js\_challenge"

"managed\_challenge"

paused?: boolean

When true, indicates that the rule is currently paused.

UARuleDeleteResponse { id, configuration, description, 2 more } 

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

configuration?: Configuration { target, value } 

The configuration object for the current rule.

target?: string

The configuration target for this rule. You must set the target to `ua` for User Agent Blocking rules.

value?: string

The exact user agent string to match. This value will be compared to the received `User-Agent` HTTP header value.

description?: string

An informative summary of the rule.

maxLength1024

mode?: "block" | "challenge" | "js\_challenge" | "managed\_challenge"

The action to apply to a matched request.

maxLength12

One of the following:

"block"

"challenge"

"js\_challenge"

"managed\_challenge"

paused?: boolean

When true, indicates that the rule is currently paused.