curl --request POST \
--url https://app.flextell.ai/api/v1/salespeople \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"set_password": true,
"password": "<string>",
"password_confirmation": "<string>",
"phone": "<string>",
"language": [],
"avatar_url": "<string>",
"is_active": true,
"active_lead_cap": 50,
"is_lead_cap_unlimited": true,
"treatment_ids": [
2
],
"work_hours": [
{
"enabled": true,
"open": "<string>",
"close": "<string>"
}
]
}
'import requests
url = "https://app.flextell.ai/api/v1/salespeople"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"set_password": True,
"password": "<string>",
"password_confirmation": "<string>",
"phone": "<string>",
"language": [],
"avatar_url": "<string>",
"is_active": True,
"active_lead_cap": 50,
"is_lead_cap_unlimited": True,
"treatment_ids": [2],
"work_hours": [
{
"enabled": True,
"open": "<string>",
"close": "<string>"
}
]
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
set_password: true,
password: '<string>',
password_confirmation: '<string>',
phone: '<string>',
language: [],
avatar_url: '<string>',
is_active: true,
active_lead_cap: 50,
is_lead_cap_unlimited: true,
treatment_ids: [2],
work_hours: [{enabled: true, open: '<string>', close: '<string>'}]
})
};
fetch('https://app.flextell.ai/api/v1/salespeople', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.flextell.ai/api/v1/salespeople",
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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'set_password' => true,
'password' => '<string>',
'password_confirmation' => '<string>',
'phone' => '<string>',
'language' => [
],
'avatar_url' => '<string>',
'is_active' => true,
'active_lead_cap' => 50,
'is_lead_cap_unlimited' => true,
'treatment_ids' => [
2
],
'work_hours' => [
[
'enabled' => true,
'open' => '<string>',
'close' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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 := "https://app.flextell.ai/api/v1/salespeople"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"set_password\": true,\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\",\n \"phone\": \"<string>\",\n \"language\": [],\n \"avatar_url\": \"<string>\",\n \"is_active\": true,\n \"active_lead_cap\": 50,\n \"is_lead_cap_unlimited\": true,\n \"treatment_ids\": [\n 2\n ],\n \"work_hours\": [\n {\n \"enabled\": true,\n \"open\": \"<string>\",\n \"close\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
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("https://app.flextell.ai/api/v1/salespeople")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"set_password\": true,\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\",\n \"phone\": \"<string>\",\n \"language\": [],\n \"avatar_url\": \"<string>\",\n \"is_active\": true,\n \"active_lead_cap\": 50,\n \"is_lead_cap_unlimited\": true,\n \"treatment_ids\": [\n 2\n ],\n \"work_hours\": [\n {\n \"enabled\": true,\n \"open\": \"<string>\",\n \"close\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/salespeople")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"set_password\": true,\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\",\n \"phone\": \"<string>\",\n \"language\": [],\n \"avatar_url\": \"<string>\",\n \"is_active\": true,\n \"active_lead_cap\": 50,\n \"is_lead_cap_unlimited\": true,\n \"treatment_ids\": [\n 2\n ],\n \"work_hours\": [\n {\n \"enabled\": true,\n \"open\": \"<string>\",\n \"close\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Create a salesperson
curl --request POST \
--url https://app.flextell.ai/api/v1/salespeople \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"set_password": true,
"password": "<string>",
"password_confirmation": "<string>",
"phone": "<string>",
"language": [],
"avatar_url": "<string>",
"is_active": true,
"active_lead_cap": 50,
"is_lead_cap_unlimited": true,
"treatment_ids": [
2
],
"work_hours": [
{
"enabled": true,
"open": "<string>",
"close": "<string>"
}
]
}
'import requests
url = "https://app.flextell.ai/api/v1/salespeople"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"set_password": True,
"password": "<string>",
"password_confirmation": "<string>",
"phone": "<string>",
"language": [],
"avatar_url": "<string>",
"is_active": True,
"active_lead_cap": 50,
"is_lead_cap_unlimited": True,
"treatment_ids": [2],
"work_hours": [
{
"enabled": True,
"open": "<string>",
"close": "<string>"
}
]
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
set_password: true,
password: '<string>',
password_confirmation: '<string>',
phone: '<string>',
language: [],
avatar_url: '<string>',
is_active: true,
active_lead_cap: 50,
is_lead_cap_unlimited: true,
treatment_ids: [2],
work_hours: [{enabled: true, open: '<string>', close: '<string>'}]
})
};
fetch('https://app.flextell.ai/api/v1/salespeople', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.flextell.ai/api/v1/salespeople",
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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'set_password' => true,
'password' => '<string>',
'password_confirmation' => '<string>',
'phone' => '<string>',
'language' => [
],
'avatar_url' => '<string>',
'is_active' => true,
'active_lead_cap' => 50,
'is_lead_cap_unlimited' => true,
'treatment_ids' => [
2
],
'work_hours' => [
[
'enabled' => true,
'open' => '<string>',
'close' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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 := "https://app.flextell.ai/api/v1/salespeople"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"set_password\": true,\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\",\n \"phone\": \"<string>\",\n \"language\": [],\n \"avatar_url\": \"<string>\",\n \"is_active\": true,\n \"active_lead_cap\": 50,\n \"is_lead_cap_unlimited\": true,\n \"treatment_ids\": [\n 2\n ],\n \"work_hours\": [\n {\n \"enabled\": true,\n \"open\": \"<string>\",\n \"close\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
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("https://app.flextell.ai/api/v1/salespeople")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"set_password\": true,\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\",\n \"phone\": \"<string>\",\n \"language\": [],\n \"avatar_url\": \"<string>\",\n \"is_active\": true,\n \"active_lead_cap\": 50,\n \"is_lead_cap_unlimited\": true,\n \"treatment_ids\": [\n 2\n ],\n \"work_hours\": [\n {\n \"enabled\": true,\n \"open\": \"<string>\",\n \"close\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/salespeople")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"set_password\": true,\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\",\n \"phone\": \"<string>\",\n \"language\": [],\n \"avatar_url\": \"<string>\",\n \"is_active\": true,\n \"active_lead_cap\": 50,\n \"is_lead_cap_unlimited\": true,\n \"treatment_ids\": [\n 2\n ],\n \"work_hours\": [\n {\n \"enabled\": true,\n \"open\": \"<string>\",\n \"close\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Yetkilendirmeler
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Gövde
Salesperson's name.
255Salesperson's email address.
255Whether an explicit password is provided. When false, a random password is generated and a reset link is sent.
Salesperson's password. Required when set_password is true.
8Salesperson's password confirmation. Must match the password field.
8Salesperson's phone number.
20Salesperson's language preferences.
A language preference value.
Turkish, English, Other Salesperson's avatar URL.
1000Salesperson's active status.
Maximum number of active leads the salesperson may hold at once. Ignored when is_lead_cap_unlimited is true.
0 <= x <= 100Whether the salesperson may hold an unlimited number of active leads. When true, active_lead_cap is not enforced.
An array of treatment IDs the salesperson handles.
A treatment ID.
x >= 1The weekly working hours, exactly one row per day from monday to sunday.
7 elementsShow child attributes
Show child attributes
Yanıt
The response is of type object.