Search + K

Command Palette

Search for a command to run...

Sign In

List all targets

GET /accounts/{account_id}/infrastructure/targets
Copy endpoint
https://api.cloudflare.com/client/v4

Lists and sorts an account’s targets. Filters are optional and are ANDed together.

Parameters

path Path Parameters

Name Type
account_id required
type InfraAccountTag = string

query Query Parameters

Name Type
hostname

Hostname of a target

string | null
hostname_contains

Partial match to the hostname of a target

string | null
virtual_network_id

Private virtual network identifier of the target

string | null
ip_v4

IPv4 address of the target

string | null
ip_v6

IPv6 address of the target

string | null
created_before

Date and time at which the target was created before (inclusive)

string | null
created_after

Date and time at which the target was created after (inclusive)

string | null
modified_before

Date and time at which the target was modified before (inclusive)

string | null
modified_after

Date and time at which the target was modified after (inclusive)

string | null
ips

Filters for targets that have any of the following IP addresses. Specify ips multiple times in query parameter to build list of candidates.

string[]
target_ids

Filters for targets that have any of the following UUIDs. Specify target_ids multiple times in query parameter to build list of candidates.

string[]
ip_like

Filters for targets whose IP addresses look like the specified string. Supports * as a wildcard character

string | null
ipv4_start

Defines an IPv4 filter range's starting value (inclusive). Requires ipv4_end to be specified as well.

string | null
ipv4_end

Defines an IPv4 filter range's ending value (inclusive). Requires ipv4_start to be specified as well.

string | null
ipv6_start

Defines an IPv6 filter range's starting value (inclusive). Requires ipv6_end to be specified as well.

string | null
ipv6_end

Defines an IPv6 filter range's ending value (inclusive). Requires ipv6_start to be specified as well.

string | null
page

Current page in the response

number
per_page

Max amount of entries returned per page

number
order

The field to sort by.

"hostname" | "created_at"
direction

The sorting direction.

type InfraSortingDirection = "asc" | "desc"

Responses

200 application/json

Successfully retrieved all targets in the account

type InfraApiResponseCollection = never & { result?: InfraTargetArray
type InfraTargetArray = InfraTarget[]
; }

Client Errors

4XX application/json

Failed to retrieve all targets in the account

interface InfraApiResponseCommonFailure {
errors: InfraMessages
type InfraMessages = {
code: number;
documentation_url?: string;
message: string;
source?: { pointer?: string; };
}
[]
;
messages: InfraMessages
type InfraMessages = {
code: number;
documentation_url?: string;
message: string;
source?: { pointer?: string; };
}
[]
;
result: null;
success: false;
}