Skip to content
Docs
User Agents

List user agents

List user agents

client.zones.userAgents.list(stringzoneID, UserAgentListParams { after, before, expand, limit } query?, RequestOptionsoptions?): UserAgentListResponse { items, pagination }
GET/zones/{zoneId}/user-agents

Returns a list of user agents in the specified zone. User agents represent client software (browsers, desktop apps, CLI tools) registered via OAuth 2.0 Dynamic Client Registration.

ParametersExpand Collapse
zoneID: string
query: UserAgentListParams { after, before, expand, limit }
after?: string

Cursor for forward pagination

minLength1
maxLength255
before?: string

Cursor for backward pagination

minLength1
maxLength255
expand?: "total_count" | Array<"total_count">
Accepts one of the following:
"total_count"
"total_count"
Array<"total_count">
"total_count"
limit?: number

Maximum number of items to return

minimum1
maximum100
ReturnsExpand Collapse
UserAgentListResponse { items, pagination }
items: Array<UserAgent { id, created_at, identifier, 5 more } >
id: string

Unique identifier of the user agent

created_at: string

Entity creation timestamp

formatdate-time
identifier: string

User agent identifier (serves as OAuth client_id). Format: ua:{sha256_hash}

name: string

Human-readable name

minLength1
maxLength255
organization_id: string

Organization that owns this user agent

slug: string

URL-safe identifier, unique within the zone

minLength1
maxLength63
updated_at: string

Entity update timestamp

formatdate-time
zone_id: string

Zone this user agent belongs to

List user agents

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const userAgents = await client.zones.userAgents.list('zoneId');

console.log(userAgents.items);
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "identifier": "identifier",
      "name": "x",
      "organization_id": "organization_id",
      "slug": "slug",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id"
    }
  ],
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "identifier": "identifier",
      "name": "x",
      "organization_id": "organization_id",
      "slug": "slug",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id"
    }
  ],
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}