Create Agent

Endpoint

POST https://www.tabbly.io/api/create-agent

Description

This endpoint allows you to create an AI voice agent that can be reached via a phone number to handle calls using AI-powered capabilities.

Headers

Content-Type

application/json

Specifies the format of the request body

Accept

application/json

Indicates the format of the expected response

X-Requested-With

XMLHttpRequest

Identifies the request as an AJAX request

Request Body Parameters

Parameter
Type
Required
Description

api_key

String

Yes

Your Tabbly API authentication key

agent_name

String

Yes

The name of your voice agent

custom_first_line

String

Yes

The initial greeting your agent will say when answering calls

stt_language

String

Yes

The language code for speech-to-text processing (e.g., "en" for English)

voice_id

Integer

Yes

The ID of the voice to be used by the agent

phone_number

String

Yes

The phone number in E.164 format (e.g., +918035736739)

prompt_text

String

Yes

Instructions that define the agent's behavior and knowledge

enable_calendar_booking

String

No

Enable calendar booking functionality ("yes" or "no")

Example Request

curl --location 'https://www.tabbly.io/api/create-agent' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Requested-With: XMLHttpRequest' \
--data '{
    "api_key": "e3bc225e22a4b84b",
    "agent_name": "My Voice Agent",
    "custom_first_line": "Hello, how can I help you today?",
    "stt_language": "en",
    "voice_id": 150,
    "phone_number": "+918035736739",
    "prompt_text": "You are a helpful assistant.",
    "enable_calendar_booking": "no"
}'

Example Response

{
    "success": true,
    "message": "Voice agent created successfully",
    "agent_id": "ag_12345abcde",
    "phone_number": "+918035736739",
    "status": "active"
}

Response Parameters

Parameter
Type
Description

success

Boolean

Indicates if the operation was successful

message

string

A description of the operation result

agent

string

Unique identifier for the created agent

phone_number

string

The assigned phone number for the agent

status

string

Current status of the agent eg: Active

Error Codes

HTTP Status
Error Code
Description

400

invalid_parameters

Missing or invalid parameters

401

unauthorized

Invalid API key

409

phone_number_in_use

The requested phone number is already in use

429

rate_limit_exceeded

Too many requests

500

server_error

Internal server error

Notes

  • The voice_id parameter corresponds to specific voices available in the Tabbly platform.

  • The stt_language should match the language your agent will be communicating in.

  • For prompt_text, you can provide detailed instructions about how your agent should respond to specific situations.

  • Phone numbers must be in E.164 format with country code (e.g., +1XXXXXXXXXX).

Would you like more information about any specific aspect of this API?

Last updated