Create
client.zones.secrets.create(stringzoneID, SecretCreateParams { data, entity_id, name, 4 more } params, RequestOptionsoptions?): Secret { id, created_at, entity_id, 7 more }
POST/zones/{zone_id}/secrets
Parameters
zoneID: string
A globally unique opaque identifier
minLength1
Returns
Create
import KeycardAPI from '@keycardai/api';
const client = new KeycardAPI();
const secret = await client.zones.secrets.create('x', {
data: { token: 'token', type: 'token' },
entity_id: 'x',
name: 'name',
});
console.log(secret.id);{
"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": {}
}