Skip to main content
POST
Create a secret

Scoping

Secrets belong to the account (workspace) that owns this agent, not the agent itself. Any other agent in the same account can be granted access to the same secret. The agentId in the path only determines which account the secret is created under and which agent gets initial access; it does not scope lookups.
PolyAI does not enforce an expiry on secrets. If you need to rotate credentials on a schedule (e.g. an annual refresh policy), call Update a secret; PolyAI does not track or enforce rotation cadence itself.

Authorizations

X-API-KEY
string
header
required

Path Parameters

agentId
string
required

Body

application/json
name
string
required

Display name of the secret

Minimum string length: 1
value
string
required

Secret value

Minimum string length: 1
description
string

Description of the secret

Response

201 - application/json

Created secret

name
string
required

Display name of the secret

description
string

Description of the secret

createdAt
string

ISO 8601 timestamp of creation

lastUpdated
string

ISO 8601 timestamp of last update

Last modified on September 2, 2026