Skip to content
Start here

Get registration

client.ZeroTrust.Devices.Registrations.Get(ctx, registrationID, params) (*DeviceRegistrationGetResponse, error)
GET/accounts/{account_id}/devices/registrations/{registration_id}

Fetches a single WARP registration.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
ParametersExpand Collapse
registrationID string
params DeviceRegistrationGetParams
AccountID param.Field[string]

Path param

Include param.Field[string]Optional

Query param: Comma-separated list of additional information that should be included in the registration response. Supported values are: “policy”.

ReturnsExpand Collapse
type DeviceRegistrationGetResponse struct{…}

A WARP configuration tied to a single user. Multiple registrations can be created from a single WARP device.

ID string

The ID of the registration.

CreatedAt string

The RFC3339 timestamp when the registration was created.

Device DeviceRegistrationGetResponseDevice

Device details embedded inside of a registration.

ID string

The ID of the device.

Name string

The name of the device.

ClientVersion stringOptional

Version of the WARP client.

Key string

The public key used to connect to the Cloudflare network.

LastSeenAt string

The RFC3339 timestamp when the registration was last seen.

UpdatedAt string

The RFC3339 timestamp when the registration was last updated.

DeletedAt stringOptional

The RFC3339 timestamp when the registration was deleted.

KeyType stringOptional

The type of encryption key used by the WARP client for the active key. Currently ‘curve25519’ for WireGuard and ‘secp256r1’ for MASQUE.

Policy DeviceRegistrationGetResponsePolicyOptional

The device settings profile assigned to this registration.

ID string

The ID of the device settings profile.

Default bool

Whether the device settings profile is the default profile for the account.

Deleted bool

Whether the device settings profile was deleted.

Name string

The name of the device settings profile.

UpdatedAt string

The RFC3339 timestamp of when the device settings profile last changed for the registration.

RevokedAt stringOptional

The RFC3339 timestamp when the registration was revoked.

TunnelType stringOptional

Type of the tunnel - wireguard or masque.

User DeviceRegistrationGetResponseUserOptional
ID stringOptional

UUID.

maxLength36
Email stringOptional

The contact email address of the user.

maxLength90
Name stringOptional

The enrolled device user’s name.

VirtualIPV4 stringOptional

The virtual IPv4 address assigned to the network interface of the tunnel for this registration.

VirtualIPV6 stringOptional

The virtual IPv6 address assigned to the network interface of the tunnel for this registration.

Get registration

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  registration, err := client.ZeroTrust.Devices.Registrations.Get(
    context.TODO(),
    "registration_id",
    zero_trust.DeviceRegistrationGetParams{
      AccountID: cloudflare.F("account_id"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", registration.ID)
}
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "id": "11ffb86f-3f0c-4306-b4a2-e62f872b166a",
    "created_at": "2025-02-14T13:17:00Z",
    "device": {
      "id": "32aa0404-78f1-49a4-99e0-97f575081356",
      "name": "My Device",
      "client_version": "1.0.0"
    },
    "key": "U+QTP50RsWfeLGHF4tlGDnmGeuwtsz46KCHr5OyhWq00Rsdfl45mgnQAuEJ6CO0YrkyTl9FUf5iB0bwYR3g4EEFEHhtu6jFaqfMrBMBSz6itv9HQXkaR9OieKQ==",
    "last_seen_at": "2025-02-14T13:17:00Z",
    "updated_at": "2025-02-14T13:17:00Z",
    "deleted_at": "2025-02-14T13:17:00Z",
    "key_type": "secp256r1",
    "policy": {
      "id": "11ffb86f-3f0c-4306-b4a2-e62f872b166a",
      "default": true,
      "deleted": true,
      "name": "name",
      "updated_at": "2025-02-14T13:17:00Z"
    },
    "revoked_at": "2025-02-14T13:17:00Z",
    "tunnel_type": "masque",
    "user": {
      "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "email": "user@example.com",
      "name": "John Appleseed"
    },
    "virtual_ipv4": "100.96.0.1",
    "virtual_ipv6": "2606:4700:0cf1:1000::1"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "id": "11ffb86f-3f0c-4306-b4a2-e62f872b166a",
    "created_at": "2025-02-14T13:17:00Z",
    "device": {
      "id": "32aa0404-78f1-49a4-99e0-97f575081356",
      "name": "My Device",
      "client_version": "1.0.0"
    },
    "key": "U+QTP50RsWfeLGHF4tlGDnmGeuwtsz46KCHr5OyhWq00Rsdfl45mgnQAuEJ6CO0YrkyTl9FUf5iB0bwYR3g4EEFEHhtu6jFaqfMrBMBSz6itv9HQXkaR9OieKQ==",
    "last_seen_at": "2025-02-14T13:17:00Z",
    "updated_at": "2025-02-14T13:17:00Z",
    "deleted_at": "2025-02-14T13:17:00Z",
    "key_type": "secp256r1",
    "policy": {
      "id": "11ffb86f-3f0c-4306-b4a2-e62f872b166a",
      "default": true,
      "deleted": true,
      "name": "name",
      "updated_at": "2025-02-14T13:17:00Z"
    },
    "revoked_at": "2025-02-14T13:17:00Z",
    "tunnel_type": "masque",
    "user": {
      "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "email": "user@example.com",
      "name": "John Appleseed"
    },
    "virtual_ipv4": "100.96.0.1",
    "virtual_ipv6": "2606:4700:0cf1:1000::1"
  },
  "success": true
}