Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/docs/waf/tools/ip-access-rules/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ import { TabItem, Tabs } from "~/components";

</TabItem> <TabItem label="API">

Use the Cloudflare API to programmatically create IP Access rules. For more information, refer to [Get IP Access rules](/api/resources/firewall/subresources/access_rules/methods/create/).
Use the Cloudflare API to programmatically create IP Access rules. For more information, refer to [Create An IP Access Rule](/api/resources/firewall/subresources/access_rules/methods/create/).

</TabItem> </Tabs>
2 changes: 1 addition & 1 deletion src/content/docs/waf/tools/lists/lists-api/endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar:

---

To invoke a [Lists API](/api/resources/rules/subresources/lists/methods/list/) operation, append the endpoint to the Cloudflare API base URL:
To invoke a [Lists API](/api/resources/rules/subresources/lists/) operation, append the endpoint to the Cloudflare API base URL:

`https://api.cloudflare.com/client/v4/`

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/waf/tools/lists/lists-api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar:
order: 7
---

The [Lists API](/api/resources/rules/subresources/lists/methods/list/) provides an interface for programmatically managing the following types of lists:
The [Lists API](/api/resources/rules/subresources/lists/) provides an interface for programmatically managing the following types of lists:

- [Custom lists](/waf/tools/lists/custom-lists/): Contain one or more strings of the same type (such as IP addresses or hostnames) that you can reference collectively, by name, in rule expressions.

Expand Down
254 changes: 213 additions & 41 deletions src/content/docs/waf/tools/lists/lists-api/json-object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,112 @@ head:
- tag: title
content: List JSON object
description: Reference information on the JSON object used in Lists API calls.

---

import { Type } from "~/components";

## List object structure and properties

A JSON response for the [Lists API](/api/resources/rules/subresources/lists/methods/list/) has this structure:
A JSON response for the [Lists API](/api/resources/rules/subresources/lists/) has this structure:

```json
{
"id": "2c0fc9fa937b11eaa1b71c4d701ab86e",
"name": "my_list_name",
"description": "List description.",
"kind": "(ip|hostname|asn|redirect)",
"num_items": 10,
"num_referencing_filters": 2,
"created_on": "2021-01-01T08:00:00Z",
"modified_on": "2021-01-10T14:00:00Z"
"id": "2c0fc9fa937b11eaa1b71c4d701ab86e",
"name": "my_list_name",
"description": "List description.",
"kind": "(ip|hostname|asn|redirect)",
"num_items": 10,
"num_referencing_filters": 2,
"created_on": "2021-01-01T08:00:00Z",
"modified_on": "2021-01-10T14:00:00Z"
}
```

This table summarizes the object properties:


{/* prettier-ignore */}
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
<th>Constraints</th>
</tr>
</thead>
<tbody style="vertical-align:top">
<tr>
<td>
<code>id</code><br />
<Type text="String" />
</td>
<td>A UUIDv4 identifier generated by Cloudflare.</td>
<td>
<p>Unique, read only.</p>
<p>Length: 32 characters.</p>
</td>
</tr>
<tr>
<td>
<code>name</code><br />
<Type text="String" />
</td>
<td>An informative name for the list.</td>
<td>
<p>Maximum length: 50 characters.</p>
<p>Only alphanumeric and underscore (<code>\_</code>) characters are valid.</p>
<p>A valid name satisfies this regular expression: <code>^[a-zA-Z0-9_]+$</code>.</p>
</td>
</tr>
<tr>
<td>
<code>description</code><br />
<Type text="String" />
</td>
<td>An informative summary of the list.</td>
<td>Maximum length: 500 characters.</td>
</tr>
<tr>
<td>
<code>kind</code><br />
<Type text="String" />
</td>
<td>The type of data in the list.</td>
<td>Valid values: <code>ip</code>, <code>hostname</code>, <code>asn</code>, <code>redirect</code>.</td>
</tr>
<tr>
<td>
<code>num_items</code><br />
<Type text="Number" />
</td>
<td>The number of items in the list.</td>
<td>Read only.</td>
</tr>
<tr>
<td>
<code>num_referencing_filters</code><br />
<Type text="Number" />
</td>
<td>The number of filters that reference this list.</td>
<td>Read only.</td>
</tr>
<tr>
<td>
<code>created_on</code><br />
<Type text="String" />
</td>
<td>The <a href='https://datatracker.ietf.org/doc/html/rfc3339'>RFC 3339</a> timestamp the list was created.</td>
<td>Read only.</td>
</tr>
<tr>
<td>
<code>modified_on</code><br />
<Type text="String" />
</td>
<td>The <a href='https://datatracker.ietf.org/doc/html/rfc3339'>RFC 3339</a> timestamp when the list was last modified.</td>
<td>Read only.</td>
</tr>
</tbody>
</table>

## List item object structure and properties

Expand All @@ -41,11 +124,11 @@ A fully populated JSON object for an IP address list item has the following stru

```json
{
"id": "7c5dae5552338874e5053f2534d2767a",
"ip": "10.0.0.1/32",
"comment": "CF DNS server",
"created_on": "2021-10-01T05:20:00.12345Z",
"modified_on": "2021-10-01T05:20:00.12345Z"
"id": "7c5dae5552338874e5053f2534d2767a",
"ip": "10.0.0.1/32",
"comment": "CF DNS server",
"created_on": "2021-10-01T05:20:00.12345Z",
"modified_on": "2021-10-01T05:20:00.12345Z"
}
```

Expand All @@ -55,12 +138,12 @@ A fully populated JSON object for a hostname list item has the following structu

```json
{
"id": "7c5dae5552338874e5053f2534d2767a",
"hostname": {
"url_hostname": "*.example.com"
},
"created_on": "2021-10-11T12:39:02Z",
"modified_on": "2021-10-11T12:39:02Z"
"id": "7c5dae5552338874e5053f2534d2767a",
"hostname": {
"url_hostname": "*.example.com"
},
"created_on": "2021-10-11T12:39:02Z",
"modified_on": "2021-10-11T12:39:02Z"
}
```

Expand All @@ -70,11 +153,11 @@ A fully populated JSON object for an ASN list item has the following structure:

```json
{
"id": "7c5dae5552338874e5053f2534d2767a",
"asn": 13335,
"comment": "My provider's ASN",
"created_on": "2021-10-11T12:39:02Z",
"modified_on": "2021-10-11T12:39:02Z"
"id": "7c5dae5552338874e5053f2534d2767a",
"asn": 13335,
"comment": "My provider's ASN",
"created_on": "2021-10-11T12:39:02Z",
"modified_on": "2021-10-11T12:39:02Z"
}
```

Expand All @@ -84,25 +167,114 @@ A fully populated JSON object for a Bulk Redirect List item has the following st

```json
{
"id": "7c5dae5552338874e5053f2534d2767a",
"redirect": {
"source_url": "https://example.com/blog",
"target_url": "https://example.com/blog/latest",
"status_code": 301,
"include_subdomains": false,
"subpath_matching": false,
"preserve_query_string": false,
"preserve_path_suffix": true
},
"created_on": "2021-10-11T12:39:02Z",
"modified_on": "2021-10-11T12:39:02Z"
"id": "7c5dae5552338874e5053f2534d2767a",
"redirect": {
"source_url": "https://example.com/blog",
"target_url": "https://example.com/blog/latest",
"status_code": 301,
"include_subdomains": false,
"subpath_matching": false,
"preserve_query_string": false,
"preserve_path_suffix": true
},
"created_on": "2021-10-11T12:39:02Z",
"modified_on": "2021-10-11T12:39:02Z"
}
```

### Properties reference

The JSON object properties for a list item are defined as follows:

{/* prettier-ignore */}
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
<th>Constraints</th>
</tr>
</thead>
<tbody style="vertical-align:top">
<tr>
<td>
<code>id</code><br />
<Type text="String" />
</td>
<td>A UUIDv4 identifier generated by Cloudflare.</td>
<td>
<p>Unique, read only.</p>
<p>Length: 32 characters.</p>
</td>
</tr>
<tr>
<td>
<code>ip</code><br />
<Type text="String" />
</td>
<td>An IP address or CIDR range.</td>
<td>
<p>Applies only to custom lists with IP addresses (IP lists).</p>
<p>
Any of these formats can exist in the same custom list with IP addresses:
<ul>
<li>IPv4 address</li>
<li>IPv6 (up to <code>/64</code>) address</li>
<li>IPv4 ranges as <code>/32</code> through <code>/2</code> CIDRs</li>
<li>IPv6 ranges as <code>/64</code> through <code>/4</code> CIDRs</li>
</ul>
</p>
</td>
</tr>
<tr>
<td>
<code>comment</code><br />
<Type text="String" />
</td>
<td>An informative summary of the item.</td>
<td><p>Maximum length: 500 characters.</p></td>
</tr>
<tr>
<td>
<code>redirect</code><br />
<Type text="Object" />
</td>
<td>An object that contains the definition of a URL redirect. Refer to <a href="/rules/url-forwarding/bulk-redirects/reference/parameters/">URL redirect parameters</a> for details.</td>
<td><p>Applies only to Bulk Redirect Lists.</p></td>
</tr>
<tr>
<td>
<code>hostname</code><br />
<Type text="Object" />
</td>
<td>An object containing a <code>url_hostname</code> property with a hostname value. Refer to <a href="/waf/tools/lists/custom-lists/#lists-with-hostnames">Lists with hostnames</a> for details on the supported hostname values.</td>
<td><p>Applies only to custom lists with hostnames.</p></td>
</tr>
<tr>
<td>
<code>asn</code><br />
<Type text="Integer" />
</td>
<td>An ASN value.</td>
<td>Applies only to custom lists with ASNs.</td>
</tr>
<tr>
<td>
<code>created_on</code><br />
<Type text="String" />
</td>
<td>The <a href='https://datatracker.ietf.org/doc/html/rfc3339'>RFC 3339</a> timestamp when the list was created.</td>
<td>Read only.</td>
</tr>
<tr>
<td>
<code>modified_on</code><br />
<Type text="String" />
</td>
<td>The <a href='https://datatracker.ietf.org/doc/html/rfc3339'>RFC 3339</a> timestamp when the item was last modified.</td>
<td>Read only.</td>
</tr>
</tbody>
</table>


For a detailed specification, refer to the [Lists API](/api/resources/rules/subresources/lists/methods/list/) documentation.
For a detailed specification, refer to the [Lists API](/api/resources/rules/subresources/lists/) documentation.
Loading