---
title: UA Rules
---

[Skip to content](#_top)

[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_rules/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#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)>) {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_rules/methods/get)

client.firewall.uaRules.get(stringuaRuleID, UARuleGetParams {zone\_id } params, RequestOptionsoptions?): [UARuleGetResponse](<https://developers.cloudflare.com/api/typescript/resources/firewall#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)>) {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_rules/methods/create)

client.firewall.uaRules.create(UARuleCreateParams {zone\_id, configuration, mode, 2 more } params, RequestOptionsoptions?): [UARuleCreateResponse](<https://developers.cloudflare.com/api/typescript/resources/firewall#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)>) {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_rules/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#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)>) {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_rules/methods/delete)

client.firewall.uaRules.delete(stringuaRuleID, UARuleDeleteParams {zone\_id } params, RequestOptionsoptions?): [UARuleDeleteResponse](<https://developers.cloudflare.com/api/typescript/resources/firewall#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)>) {id, configuration, description, 2 more }

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

##### ModelsExpand Collapse

<details>

<summary>

UARuleListResponse {id, configuration, description, 2 more }

</summary>

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

configuration?: Configuration {target, value }

The configuration object for the current rule.

</summary>

target?: string

The configuration target for this rule. You must set the target to <code>ua</code> for User Agent Blocking rules.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20target">Link to this property</a>

value?: string

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

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20configuration">Link to this property</a>

description?: string

An informative summary of the rule.

maxLength1024

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

<details>

<summary>

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

The action to apply to a matched request.

maxLength12

</summary>

One of the following:

"block"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

"challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

"js\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%202">Link to this property</a>

"managed\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

paused?: boolean

When true, indicates that the rule is currently paused.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)%20%3E%20(property)%20paused">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_list_response%20%3E%20(schema)>)

<details>

<summary>

UARuleGetResponse {id, configuration, description, 2 more }

</summary>

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

configuration?: Configuration {target, value }

The configuration object for the current rule.

</summary>

target?: string

The configuration target for this rule. You must set the target to <code>ua</code> for User Agent Blocking rules.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20target">Link to this property</a>

value?: string

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

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20configuration">Link to this property</a>

description?: string

An informative summary of the rule.

maxLength1024

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

<details>

<summary>

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

The action to apply to a matched request.

maxLength12

</summary>

One of the following:

"block"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

"challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

"js\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%202">Link to this property</a>

"managed\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

paused?: boolean

When true, indicates that the rule is currently paused.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)%20%3E%20(property)%20paused">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_get_response%20%3E%20(schema)>)

<details>

<summary>

UARuleCreateResponse {id, configuration, description, 2 more }

</summary>

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

configuration?: Configuration {target, value }

The configuration object for the current rule.

</summary>

target?: string

The configuration target for this rule. You must set the target to <code>ua</code> for User Agent Blocking rules.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20target">Link to this property</a>

value?: string

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

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20configuration">Link to this property</a>

description?: string

An informative summary of the rule.

maxLength1024

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

<details>

<summary>

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

The action to apply to a matched request.

maxLength12

</summary>

One of the following:

"block"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

"challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

"js\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%202">Link to this property</a>

"managed\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

paused?: boolean

When true, indicates that the rule is currently paused.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)%20%3E%20(property)%20paused">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_create_response%20%3E%20(schema)>)

<details>

<summary>

UARuleUpdateResponse {id, configuration, description, 2 more }

</summary>

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

configuration?: Configuration {target, value }

The configuration object for the current rule.

</summary>

target?: string

The configuration target for this rule. You must set the target to <code>ua</code> for User Agent Blocking rules.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20target">Link to this property</a>

value?: string

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

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20configuration">Link to this property</a>

description?: string

An informative summary of the rule.

maxLength1024

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

<details>

<summary>

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

The action to apply to a matched request.

maxLength12

</summary>

One of the following:

"block"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

"challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

"js\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%202">Link to this property</a>

"managed\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

paused?: boolean

When true, indicates that the rule is currently paused.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)%20%3E%20(property)%20paused">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_update_response%20%3E%20(schema)>)

<details>

<summary>

UARuleDeleteResponse {id, configuration, description, 2 more }

</summary>

id?: string

The unique identifier of the User Agent Blocking rule.

maxLength32

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

configuration?: Configuration {target, value }

The configuration object for the current rule.

</summary>

target?: string

The configuration target for this rule. You must set the target to <code>ua</code> for User Agent Blocking rules.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20target">Link to this property</a>

value?: string

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

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20configuration%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20configuration">Link to this property</a>

description?: string

An informative summary of the rule.

maxLength1024

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

<details>

<summary>

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

The action to apply to a matched request.

maxLength12

</summary>

One of the following:

"block"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

"challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

"js\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%202">Link to this property</a>

"managed\_challenge"

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

paused?: boolean

When true, indicates that the rule is currently paused.

<a href="#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)%20%3E%20(property)%20paused">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.ua_rules%20%3E%20(model)%20ua_rule_delete_response%20%3E%20(schema)>)