Search + K

Command Palette

Search for a command to run...

Sign In

Create new target

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

Parameters

path Path Parameters

Name Type
account_id required
type InfraAccountTag = string

Request Body

application/json required
{ hostname: string;ip: InfraIPInfo

The IPv4/IPv6 address that identifies where to reach a target

interface InfraIPInfo {
ipv4?: { ip_addr?: string;virtual_network_id?: string; };
ipv6?: { ip_addr?: string;virtual_network_id?: string; };
}
; }

Responses

200 application/json

Successfully created the target

type InfraApiResponseSingle = interface InfraApiResponseCommon {
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; };
}
[]
;
success: true;
}
& {}
& { result?: InfraTarget
interface InfraTarget {
created_at: string;
hostname: string;
id: InfraTargetId;
ip: InfraIPInfo;
modified_at: string;
}
; }

Client Errors

4XX application/json

Failed to create the target

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;
}