Skip to content
API Reference

List

client.Zones.Secrets.List(ctx, zoneID, params) (*[]Secret, error)
GET/zones/{zone_id}/secrets
ParametersExpand Collapse
zoneID string

A globally unique opaque identifier

minLength1
params ZoneSecretListParams
EntityID param.Field[string]optional

Query param: The entity to list all secrets for

Type param.Field[ZoneSecretListParamsType]optional

Query param: The type of secrets to list

const ZoneSecretListParamsTypeToken ZoneSecretListParamsType = "token"
const ZoneSecretListParamsTypePassword ZoneSecretListParamsType = "password"
XClientRequestID param.Field[string]optional

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

formatuuid
ReturnsExpand Collapse
type ZoneSecretListResponse []Secret
ID string

A globally unique opaque identifier

minLength1
CreatedAt Time
formatdate-time
EntityID string

A globally unique opaque identifier

minLength1
Name string

A name for the entity to be displayed in UI

Type SecretType
Accepts one of the following:
const SecretTypeToken SecretType = "token"
const SecretTypePassword SecretType = "password"
UpdatedAt Time
formatdate-time
Version int64
minimum1
ZoneID string

A globally unique opaque identifier

minLength1
Description stringoptional

A description of the entity

maxLength128
Metadata anyoptional

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

List

package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
)

func main() {
  client := keycard.NewClient(

  )
  secrets, err := client.Zones.Secrets.List(
    context.TODO(),
    "x",
    keycard.ZoneSecretListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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": {}
  }
]