Create Agent
curl --request POST \
--url http://localhost:8080/api/v1/agents \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"email": "jsmith@example.com",
"roles": [
"<string>"
],
"last_name": "<string>",
"send_welcome_email": true,
"teams": [
"<string>"
],
"enabled": true,
"new_password": "<string>"
}
'import requests
url = "http://localhost:8080/api/v1/agents"
payload = {
"first_name": "<string>",
"email": "jsmith@example.com",
"roles": ["<string>"],
"last_name": "<string>",
"send_welcome_email": True,
"teams": ["<string>"],
"enabled": True,
"new_password": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: '<string>',
email: 'jsmith@example.com',
roles: ['<string>'],
last_name: '<string>',
send_welcome_email: true,
teams: ['<string>'],
enabled: true,
new_password: '<string>'
})
};
fetch('http://localhost:8080/api/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => '<string>',
'email' => 'jsmith@example.com',
'roles' => [
'<string>'
],
'last_name' => '<string>',
'send_welcome_email' => true,
'teams' => [
'<string>'
],
'enabled' => true,
'new_password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/api/v1/agents"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"roles\": [\n \"<string>\"\n ],\n \"last_name\": \"<string>\",\n \"send_welcome_email\": true,\n \"teams\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"new_password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/agents")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"roles\": [\n \"<string>\"\n ],\n \"last_name\": \"<string>\",\n \"send_welcome_email\": true,\n \"teams\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"new_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/agents")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"roles\": [\n \"<string>\"\n ],\n \"last_name\": \"<string>\",\n \"send_welcome_email\": true,\n \"teams\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"new_password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 1,
"created_at": "2025-08-28T10:00:00Z",
"updated_at": "2025-08-28T10:00:00Z",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"type": "agent",
"availability_status": "online",
"phone_number_country_code": "US",
"phone_number": "1234567890",
"avatar_url": "/avatars/agent1.jpg",
"enabled": true,
"last_active_at": "2025-08-28T10:00:00Z",
"last_login_at": "2025-08-28T10:00:00Z",
"roles": [
"admin"
],
"permissions": [
"conversations:read"
],
"custom_attributes": {},
"teams": [
{
"id": 1,
"name": "Support Team",
"emoji": "🛠️"
}
],
"api_key": "<string>",
"api_key_last_used_at": "2023-11-07T05:31:56Z"
}
}Agents & Teams
Create Agent
POST
/
api
/
v1
/
agents
Create Agent
curl --request POST \
--url http://localhost:8080/api/v1/agents \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"email": "jsmith@example.com",
"roles": [
"<string>"
],
"last_name": "<string>",
"send_welcome_email": true,
"teams": [
"<string>"
],
"enabled": true,
"new_password": "<string>"
}
'import requests
url = "http://localhost:8080/api/v1/agents"
payload = {
"first_name": "<string>",
"email": "jsmith@example.com",
"roles": ["<string>"],
"last_name": "<string>",
"send_welcome_email": True,
"teams": ["<string>"],
"enabled": True,
"new_password": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: '<string>',
email: 'jsmith@example.com',
roles: ['<string>'],
last_name: '<string>',
send_welcome_email: true,
teams: ['<string>'],
enabled: true,
new_password: '<string>'
})
};
fetch('http://localhost:8080/api/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => '<string>',
'email' => 'jsmith@example.com',
'roles' => [
'<string>'
],
'last_name' => '<string>',
'send_welcome_email' => true,
'teams' => [
'<string>'
],
'enabled' => true,
'new_password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/api/v1/agents"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"roles\": [\n \"<string>\"\n ],\n \"last_name\": \"<string>\",\n \"send_welcome_email\": true,\n \"teams\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"new_password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/agents")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"roles\": [\n \"<string>\"\n ],\n \"last_name\": \"<string>\",\n \"send_welcome_email\": true,\n \"teams\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"new_password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/agents")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"roles\": [\n \"<string>\"\n ],\n \"last_name\": \"<string>\",\n \"send_welcome_email\": true,\n \"teams\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"new_password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 1,
"created_at": "2025-08-28T10:00:00Z",
"updated_at": "2025-08-28T10:00:00Z",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"type": "agent",
"availability_status": "online",
"phone_number_country_code": "US",
"phone_number": "1234567890",
"avatar_url": "/avatars/agent1.jpg",
"enabled": true,
"last_active_at": "2025-08-28T10:00:00Z",
"last_login_at": "2025-08-28T10:00:00Z",
"roles": [
"admin"
],
"permissions": [
"conversations:read"
],
"custom_attributes": {},
"teams": [
{
"id": 1,
"name": "Support Team",
"emoji": "🛠️"
}
],
"api_key": "<string>",
"api_key_last_used_at": "2023-11-07T05:31:56Z"
}
}Authorizations
basicAuthtokenAuth
Basic authentication using base64 encoded API key and secret. Format: Authorization: Basic <base64(api_key:api_secret)>
Body
application/json
Agent creation details
Agent's first name
Agent's email address
Roles assigned to the agent
Agent's last name
Only used during agent creation to send welcome email
Team IDs to assign agent to
Whether agent is enabled
Agent's availability status
Available options:
online, away, away_manual, offline, away_and_reassigning Agent's new password, Optional
Was this page helpful?
⌘I

