Create AI agent

View as MarkdownOpen in Claude
Creates a custom AI Agent in your SignalWire project. The new agent becomes a reusable Fabric resource for conversational calls and can be reached through resource addresses or assigned as a call handler. Use a [Dialogflow Agent](/docs/apis/rest/ai-agents/ai-agents-dialogflow/list-dialogflow-agents) for an existing Dialogflow integration, or [Create call flow](/docs/apis/rest/call-flows/create-call-flow) for visual, deterministic call logic. #### Permissions The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_, _Messaging_, _Fax_, or _Video_. [Learn more about API scopes](/docs/platform/your-signalwire-api-space).

Authentication

AuthorizationBasic
SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ```

Request

This endpoint expects an object.
promptobjectRequired

Defines the AI agent’s personality, goals, behaviors, and instructions for handling conversations. The prompt establishes how the agent should interact with callers, what information it should gather, and how it should respond to various scenarios. It is recommended to write prompts using markdown formatting.

See ai.prompt in the SWML reference.

namestringRequired
Name of the AI Agent.
hintslist of stringsOptional

Hints help the AI agent understand certain words or phrases better. Words that can commonly be misinterpreted can be added to the hints to help the AI speak more accurately.

See ai.hints in the SWML reference.

languageslist of objectsOptional

An array of JSON objects defining supported languages in the conversation. Mutually exclusive with multilingual: if both are set, multilingual is used and this array is ignored.

See ai.languages in the SWML reference.

paramsobjectOptional

A JSON object containing parameters as key-value pairs.

See ai.params in the SWML reference.

post_promptobjectOptional

The final set of instructions and configuration settings to send to the agent.

See ai.post_prompt in the SWML reference.

pronouncelist of objectsOptional

An array of JSON objects to clarify the AI’s pronunciation of words or expressions.

See ai.pronounce in the SWML reference.

SWAIGobjectOptional

An array of JSON objects to create user-defined functions/endpoints that can be executed during the dialogue.

See ai.SWAIG in the SWML reference.

Response

The request has succeeded and a new resource has been created as a result.
idstringformat: "uuid"
Unique ID of the AIAgent.
project_idstringformat: "uuid"
Unique ID of the Project.
display_namestring
Display name of the AIAgent Fabric Resource
typeenum
Type of the Fabric Resource
created_atdatetime
Date and time when the resource was created.
updated_atdatetime
Date and time when the resource was updated.
ai_agentobject
AIAgent data.

Errors

401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error