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
AuthorizationBearerAuthenticate 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
namestringRequiredAgent name (must not be empty).
greetingstringOptionalOpening message the agent says when the call starts.
promptstringOptionalSystem prompt that defines the agent behavior.
farewellstringOptionalClosing message said at the end of the call.
voiceIdstringOptionalVoice identifier for the agent. Get available values from List voices.
outputVariablesarrayOptionalVariables to capture during the call. See below.
outputVariables[].namestringRequiredVariable name.
outputVariables[].descriptionstringOptionalWhat the variable represents.
outputVariables[].typestringOptionalVariable data type (e.g.
string).outputVariables[].valuestringOptionalDefault value.
outputVariables[].enumstring[]OptionalAllowed values, if restricted to a set.
outputVariables[].idstringOptionalOptional variable identifier.
Response
Returns 201 Created.
Use the returned slug to further configure the agent with Edit agent.
Errors
400Invalid request body (e.g. missing
name).403No company is associated with the API key.