Skip to content
Docs
Secrets

List

List

client.zones.secrets.list(stringzoneID, SecretListParams { entity_id, type, xClientRequestID } params?, RequestOptionsoptions?): SecretListResponse { id, created_at, entity_id, 7 more }
GET/zones/{zone_id}/secrets
ParametersExpand Collapse
zoneID: string

A globally unique opaque identifier

minLength1
params: SecretListParams { entity_id, type, xClientRequestID }
entity_id?: string

Query param: The entity to list all secrets for

type?: "token" | "password"

Query param: The type of secrets to list

Accepts one of the following:
"token"
"password"
xClientRequestID?: string

Header param: Unique request identifier specified by the originating caller and passed along by proxies.

formatuuid
ReturnsExpand Collapse
SecretListResponse = Array<Secret { id, created_at, entity_id, 7 more } >
id: string

A globally unique opaque identifier

minLength1
created_at: string
formatdate-time
entity_id: string

A globally unique opaque identifier

minLength1
name: string

A name for the entity to be displayed in UI

type: "token" | "password"
Accepts one of the following:
"token"
"password"
updated_at: string
formatdate-time
version: number
minimum1
zone_id: string

A globally unique opaque identifier

minLength1
description?: string

A description of the entity

maxLength128
metadata?: unknown

A JSON object containing arbitrary metadata. Metadata will not be encrypted.

List

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const secrets = await client.zones.secrets.list('x');

console.log(secrets);
[
  {
    "id": "x",
    "created_at": "2019-12-27T18:11:19.117Z",
    "entity_id": "x",
    "name": "name",
    "type": "token",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "version": 1,
    "zone_id": "x",
    "description": "description",
    "metadata": {}
  }
]
Returns Examples
[
  {
    "id": "x",
    "created_at": "2019-12-27T18:11:19.117Z",
    "entity_id": "x",
    "name": "name",
    "type": "token",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "version": 1,
    "zone_id": "x",
    "description": "description",
    "metadata": {}
  }
]