Skip to main content
POST
https://api.getmalakai.com/
agents
/
user
curl --request POST \
  --url 'agents/user' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: multipart/form-data' \
  -F 'agent_name="Support Agent"' \
  -F 'voice_id="voice_xyz789"' \
  -F 'language="en-US"' \
  -F 'goals="Resolve customer support tickets."' \
  -F 'img_url=@/path/to/your/avatar.png'
{
  "status": "success",
  "message": "Agent created successfully",
  "data": {
    "agent_id": "agent_*****",
    "agent_name": "Support Agent",
    "voice_id": "voice_xyz789",
    "language": "en-US",
    "goals": "Resolve customer support tickets.",
    "img_url": "https://your-cdn.com/agents/avatar-*****.png",
    "created_at": "2024-11-11T14:01:08.087Z"
  }
}

Headers

Authorization
string
required
Your API key for authentication. Prefix with Bearer .

Body

This endpoint accepts multipart/form-data.
agent_name
string
required
The name for the new agent.
voice_id
string
required
The ID of the voice model the agent will use.
language
string
The primary language for the agent’s conversation (e.g., ‘en-US’).
conversation
string
A prompt or script defining the agent’s conversational flow or personality.
template_id
string
An optional ID of a pre-configured agent template to use as a base.
opening_message
string
The initial message the agent will use to start a conversation.
qualification_scenario
string
A prompt defining how the agent should qualify leads or handle specific scenarios.
goals
string
A description of the objectives or goals the agent should aim to achieve.
background
string
Background information or context for the agent (e.g., company info, product details).
example_scenario
string
An example conversation or scenario to guide the agent’s behavior and tone.
img_url
file
The agent’s avatar image file. This should be sent as a binary file.
negative_prompt
string
Instructions on what the agent should avoid saying or doing.
curl --request POST \
  --url 'agents/user' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: multipart/form-data' \
  -F 'agent_name="Support Agent"' \
  -F 'voice_id="voice_xyz789"' \
  -F 'language="en-US"' \
  -F 'goals="Resolve customer support tickets."' \
  -F 'img_url=@/path/to/your/avatar.png'

Response

On success, the response will contain the details of the newly created agent, including its unique ID.
status
string
Confirms the request was successful.
message
string
A human-readable message about the request’s outcome.
data
object
An object containing the details of the newly created agent.
data.agent_id
string
The unique identifier for the newly created agent.
data.agent_name
string
The name assigned to the agent.
data.img_url
string
The URL where the uploaded agent avatar can be accessed.
{
  "status": "success",
  "message": "Agent created successfully",
  "data": {
    "agent_id": "agent_*****",
    "agent_name": "Support Agent",
    "voice_id": "voice_xyz789",
    "language": "en-US",
    "goals": "Resolve customer support tickets.",
    "img_url": "https://your-cdn.com/agents/avatar-*****.png",
    "created_at": "2024-11-11T14:01:08.087Z"
  }
}