Skip to main content
POST
Create an agent

Authorizations

X-API-Key
string
header
required

[Production] API key for production authentication

Body

application/json

The agent to create.

localeReferenceId
string
required

The reference identifier for the locale of the agent, in UUID format.

name
string
required

The name of the agent. It can contain CognigyScript. The maximum is 200 bytes, not counting CognigyScript, and 64 KiB stored. The API trims whitespace around the name. The name can't contain the characters \ / : * ? " < > | or ¥ outside CognigyScript. The name must be unique in the project, ignoring case.

projectId
string
required

The unique identifier for the project that the agent belongs to.

agentType
enum<string>

The modality that the agent is authored for: text or voice. The default is voice. The configuration UI uses it to decide which sections to show. The runtime doesn't use it and takes the modality from the channel of each turn.

Available options:
text,
voice
Example:

"voice"

description
string

The description of the agent. Optional. The maximum is 1000 bytes.

guardrails
object

The safety instructions and data privacy settings of the agent. Every safety toggle is on by default. If you omit safetySettings, or the whole block, all four toggles are on. If you send safetySettings and omit a toggle, that toggle is on. Only an explicit false turns a toggle off.

hooks
object

The hooks that the platform runs for the agent. Optional. You can set at most one pre-turn hook.

image
string

The avatar of the agent, either as a URL or as a base64 data URI. Optional.

imageOptimizedFormat
boolean

true if the avatar is stored in the Cognigy optimized image format; false otherwise.

instructions
string

The instructions that tell the agent how to behave. They can contain CognigyScript. The maximum is 5000 characters, not counting CognigyScript, and 256 KiB stored.

knowledge
object

The knowledge settings of the agent.

largeLanguageModelReferenceId
string

The reference identifier for the large language model (LLM) that the agent uses, in UUID format. The model can't be a voice-to-voice (realtime) model. To set a realtime model, use voiceLargeLanguageModelReferenceId.

llmConfig
object

The overrides for the LLM parameters of the agent. A parameter that you don't set falls back to the default of the LLM Gateway config set.

personaReferenceId
string

The reference identifier for the brand persona of the agent, in UUID format. Optional.

realtimeVoice
string

The gpt-live-1 voice that the agent uses for voice sessions. The allowed values are alloy, ash, ballad, beacon, bossa, cedar, cinder, coral, delta, echo, gleam, marin, meridian, quartz, ripple, sage, shimmer, stone, tempo, verse, vesper, and willow. The default is marin.

role
string

The short role of the agent, for example "Customer support specialist". The role opens the default system prompt. Optional. It can contain CognigyScript. Whitespace around the role is trimmed. The maximum is 100 characters, not counting CognigyScript, and 64 KiB stored.

skillReferenceIds
string[]

The reference identifiers for the skills of the agent, in UUID format.

toolReferenceIds
string[]

The reference identifiers for the tools that you attach directly to the agent, in UUID format. The list can't contain duplicates.

voiceDelegationTurns
integer

Deprecated and ignored: the voice delegate treats everything said since the previous hand-off as the current request. Still accepted from 1 to 5 and stored. The default is 2.

voiceLargeLanguageModelReferenceId
string

The reference identifier for the realtime voice-to-voice (V2V) large language model (LLM) that the agent uses for voice sessions, in UUID format. The model must be a voice-to-voice model. Text turns never use it.

Response

Returns the created agent.

agentType
enum<string>

The modality that the agent was authored for: text or voice. The configuration UI uses it to decide which sections to show. The runtime doesn't use it and takes the modality from the channel of each turn. An agent that was stored without a type returns text.

Available options:
text,
voice
Example:

"voice"

createdAt
integer

The time when the agent was created, as a Unix timestamp in seconds.

createdBy
string

The unique identifier for the user who created the agent.

Example:

"507f1f77bcf86cd799439011"

description
string

The description of the agent.

disabledToolReferenceIds
string[]

The reference identifiers for the tools that are available to the agent but switched off, in UUID format. The runtime doesn't offer these tools to the large language model (LLM), and the tools keep their settings.

guardrails
object

The safety instructions and data privacy settings of the agent.

hooks
object

The hooks that the platform runs for the agent.

id
string

The unique identifier for the agent.

Example:

"507f1f77bcf86cd799439011"

image
string

The avatar of the agent, either as a URL or as a base64 data URI.

imageOptimizedFormat
boolean

true if the avatar is stored in the Cognigy optimized image format; false otherwise.

instructions
string

The instructions that tell the agent how to behave.

knowledge
object

The knowledge settings of the agent.

largeLanguageModelReferenceId
string

The reference identifier for the large language model (LLM) that the agent uses, in UUID format.

lastChangedAt
integer

The time when the agent was last changed, as a Unix timestamp in seconds.

lastChangedBy
string

The unique identifier for the user who last changed the agent.

Example:

"507f1f77bcf86cd799439011"

llmConfig
object

The overrides for the LLM parameters of the agent. A parameter that you don't set falls back to the default of the LLM Gateway config set.

localeReferenceId
string

The reference identifier for the locale of the agent, in UUID format.

name
string

The name of the agent.

organisationId
string

The unique identifier for the organization that the agent belongs to.

Example:

"507f1f77bcf86cd799439011"

personaReferenceId
string

The reference identifier for the brand persona of the agent, in UUID format. The value is empty if the agent has no brand persona.

projectId
string

The unique identifier for the project that the agent belongs to.

Example:

"507f1f77bcf86cd799439011"

realtimeVoice
string

The gpt-live-1 voice that the agent uses for voice sessions. If the field is absent, the default voice marin applies.

referenceId
string

The reference identifier for the agent, in UUID format. The API generates it when the agent is created.

role
string

The short role of the agent, for example "Customer support specialist". The role opens the default system prompt.

skillReferenceIds
string[]

The reference identifiers for the skills of the agent, in UUID format.

toolReferenceIds
string[]

The reference identifiers for the tools that you attach directly to the agent, in UUID format.

voiceDelegationTurns
integer

Deprecated and ignored: the voice delegate treats everything said since the previous hand-off as the current request. The stored value, from 1 to 5, is still returned. If the field is absent, the default 2 applies.

voiceLargeLanguageModelReferenceId
string

The reference identifier for the realtime voice-to-voice (V2V) large language model (LLM) that the agent uses for voice sessions, in UUID format. Text turns never use it.

voicePromptTemplate
string

The realtime voice prompt template of the agent. If the agent has no template of its own, the field is absent and the product default applies.