curl --request PUT \
--url https://app.flextell.ai/api/v1/salespeople/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"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/{id}"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'email' => 'jsmith@example.com',
'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/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\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("PUT", 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.put("https://app.flextell.ai/api/v1/salespeople/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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 \"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{
"success": "<string>",
"data": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"language": [
"<unknown>"
],
"avatar_url": "<string>",
"is_active": true,
"active_lead_cap": 123,
"is_lead_cap_unlimited": true,
"sales_cap": 123,
"work_hours": [
{
"day": "<string>",
"day_label": "<string>",
"enabled": true,
"open": "<string>",
"close": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"active_lead_count": "<string>",
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"treatments": [
{
"id": 123,
"group_id": 123,
"name": "<string>",
"invoice_name": "<string>",
"keywords": [
"<unknown>"
],
"price": "<string>",
"tax_rate": 123,
"description": "<string>",
"session": 123,
"is_active": "<string>",
"extra_info": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"group": {
"id": 123,
"name": "<string>",
"is_active": true
},
"users": [
{
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
}
],
"sessions": [
{
"id": 123,
"session_order": 123,
"session_type": "control",
"next_gap_days": 123,
"offset_days": 123,
"products": [
{
"id": 123,
"product_id": 123,
"min_quantity": 123,
"product": {
"id": 123,
"name": "<string>",
"full_name": "<string>",
"brand": {
"id": 123,
"name": "<string>"
},
"unit_code": {
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}
]
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Update a salesperson
curl --request PUT \
--url https://app.flextell.ai/api/v1/salespeople/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"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/{id}"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'email' => 'jsmith@example.com',
'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/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\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("PUT", 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.put("https://app.flextell.ai/api/v1/salespeople/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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 \"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{
"success": "<string>",
"data": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"language": [
"<unknown>"
],
"avatar_url": "<string>",
"is_active": true,
"active_lead_cap": 123,
"is_lead_cap_unlimited": true,
"sales_cap": 123,
"work_hours": [
{
"day": "<string>",
"day_label": "<string>",
"enabled": true,
"open": "<string>",
"close": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"active_lead_count": "<string>",
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"treatments": [
{
"id": 123,
"group_id": 123,
"name": "<string>",
"invoice_name": "<string>",
"keywords": [
"<unknown>"
],
"price": "<string>",
"tax_rate": 123,
"description": "<string>",
"session": 123,
"is_active": "<string>",
"extra_info": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"group": {
"id": 123,
"name": "<string>",
"is_active": true
},
"users": [
{
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
}
],
"sessions": [
{
"id": 123,
"session_order": 123,
"session_type": "control",
"next_gap_days": 123,
"offset_days": 123,
"products": [
{
"id": 123,
"product_id": 123,
"min_quantity": 123,
"product": {
"id": 123,
"name": "<string>",
"full_name": "<string>",
"brand": {
"id": 123,
"name": "<string>"
},
"unit_code": {
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}
]
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
],
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"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.
Yol Parametreleri
The salesperson identifier
Gövde
Salesperson's name.
255Salesperson's email address.
255Salesperson'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