Skip to content
API Reference

Create

POST/zones/{zone_id}/secrets
Path ParametersExpand Collapse
zone_id: string

A globally unique opaque identifier

minLength1
Header ParametersExpand Collapse
"X-Client-Request-ID": optional string
formatuuid
Body ParametersJSONExpand Collapse
data: SecretTokenFields { token, type } or SecretPasswordFields { password, type, username }
Accepts one of the following:
SecretTokenFields = object { token, type }
token: string
type: "token"
SecretPasswordFields = object { password, type, username }
password: string
type: "password"
username: string
entity_id: string

A globally unique opaque identifier

minLength1
name: string

A name for the entity to be displayed in UI

description: optional string

A description of the entity

maxLength128
metadata: optional unknown

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

zone_id: optional string

Optional zone ID. This field is provided for API compatibility but is ignored during processing. The zone ID is derived from the path parameter (/zones/{zone_id}/secrets) and takes precedence.

minLength1
ReturnsExpand Collapse
Secret = object { 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" or "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: optional string

A description of the entity

maxLength128
metadata: optional unknown

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

Create

curl https://api.keycard.ai/zones/$ZONE_ID/secrets \
    -H 'Content-Type: application/json' \
    -d '{
          "data": {
            "token": "token",
            "type": "token"
          },
          "entity_id": "x",
          "name": "name"
        }'
{
  "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": {}
}