Skip to main content

Agents

Create agent

Creates a new agent in your company. When you use a Specific agents key, the new agent is automatically added to that key's allowed list, so you can manage it right away.

Authentication​

AuthorizationBearer

Authenticate server-side requests with a Fonema API key. Create one in the API keys section of the Dashboard and send it in the Authorization header as Bearer <token>. Keep keys out of client-side code and public repositories.

Body​

namestringRequired
Agent name (must not be empty).
greetingstringOptional
Opening message the agent says when the call starts.
promptstringOptional
System prompt that defines the agent behavior.
farewellstringOptional
Closing message said at the end of the call.
voiceIdstringOptional

Voice identifier for the agent. Get available values from List voices.

outputVariablesarrayOptional
Variables to capture during the call. See below.
outputVariables[].namestringRequired
Variable name.
outputVariables[].descriptionstringOptional
What the variable represents.
outputVariables[].typestringOptional
Variable data type (e.g. string).
outputVariables[].valuestringOptional
Default value.
outputVariables[].enumstring[]Optional
Allowed values, if restricted to a set.
outputVariables[].idstringOptional
Optional variable identifier.

Response​

Returns 201 Created.

Use the returned slug to further configure the agent with Edit agent.

Errors​

400
Invalid request body (e.g. missing name).
403
No company is associated with the API key.