Update a role and its permissions
curl --request PUT \
--url https://app.flextell.ai/api/v1/roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"permissions": []
}
'import requests
url = "https://app.flextell.ai/api/v1/roles/{id}"
payload = {
"name": "<string>",
"permissions": []
}
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>', permissions: []})
};
fetch('https://app.flextell.ai/api/v1/roles/{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/roles/{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>',
'permissions' => [
]
]),
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/roles/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": []\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/roles/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/roles/{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 \"permissions\": []\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"is_system": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"permissions_count": 123,
"permissions": [
{
"id": 123,
"name": "<string>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}Kullanıcılar ve roller
Update a role and its permissions
PUT
/
v1
/
roles
/
{id}
Update a role and its permissions
curl --request PUT \
--url https://app.flextell.ai/api/v1/roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"permissions": []
}
'import requests
url = "https://app.flextell.ai/api/v1/roles/{id}"
payload = {
"name": "<string>",
"permissions": []
}
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>', permissions: []})
};
fetch('https://app.flextell.ai/api/v1/roles/{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/roles/{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>',
'permissions' => [
]
]),
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/roles/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": []\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/roles/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/roles/{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 \"permissions\": []\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"is_system": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"permissions_count": 123,
"permissions": [
{
"id": 123,
"name": "<string>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}Yetkilendirmeler
oauth2bearer
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 role identifier
Gövde
application/json
The name of the role.
Maximum string length:
255An array of permission names assigned to the role. An empty array removes every permission.
The permission name.
Mevcut seçenekler:
View:AuthenticationLog, View:ActivityLog, View:AIReport, Create:AIReport, Delete:AIReport, ViewAllAIReports:AIReport, Download:AIReport, View:AIReportSchedule, Create:AIReportSchedule, Update:AIReportSchedule, Delete:AIReportSchedule, View:AgentPrompt, Create:AgentPrompt, Update:AgentPrompt, Delete:AgentPrompt, PublishRevision:AgentPrompt, View:LlmTokenUsage, View:Appointment, Create:Appointment, Update:Appointment, Delete:Appointment, ViewAllAppointments:Appointment, BulkReschedule:Appointment, Cancel:Appointment, RevertCancel:Appointment, View:Holiday, Create:Holiday, Update:Holiday, Delete:Holiday, View:AppointmentReminder, Update:AppointmentReminder, Delete:AppointmentReminder, Approve:AppointmentReminder, Reject:AppointmentReminder, Send:AppointmentReminder, View:RescheduleBatchItem, View:ProformaInvoice, Download:ProformaInvoice, Pay:ProformaInvoice, View:BillingPayment, View:BillingUsage, View:TenantBillingSetting, Update:TenantBillingSetting, View:BillingQuotaPackage, Purchase:BillingQuotaPackage, View:ReferralCode, View:ChannelBlacklist, ViewAllChannelBlacklists:ChannelBlacklist, Create:ChannelBlacklist, Update:ChannelBlacklist, Delete:ChannelBlacklist, Unblock:ChannelBlacklist, View:MessageTemplate, Create:MessageTemplate, Update:MessageTemplate, Delete:MessageTemplate, View:Channel, Create:Channel, Update:Channel, Delete:Channel, QueryStatus:Channel, GenerateLink:Channel, CopyLink:Channel, View:FlexyChatFeedback, Update:FlexyChatFeedback, Delete:FlexyChatFeedback, View:Conversation, ViewAllConversations:Conversation, Create:Conversation, Archive:Conversation, Delete:Conversation, Export:Conversation, ManageTags:Conversation, ManageAiSuggestions:Conversation, ToggleAgent:Conversation, Send:Message, Update:Message, Delete:Message, View:QuickReply, Create:QuickReply, Update:QuickReply, Delete:QuickReply, View:Announcement, View:Note, ViewAllNotes:Note, Create:Note, Update:Note, Delete:Note, View:Occupation, Create:Occupation, Update:Occupation, Delete:Occupation, View:Tag, Create:Tag, Update:Tag, Delete:Tag, View:TenantInfo, Update:TenantInfo, View:DataErasureRequests, Create:DataErasureRequests, Cancel:DataErasureRequests, Retry:DataErasureRequests, CopyLink:DataErasureRequests, View:RecycleBin, Restore:RecycleBin, Purge:RecycleBin, View:Credit, Update:Credit, Delete:Credit, View:CreditUsage, View:Customer, ViewAllCustomers:Customer, Create:Customer, Update:Customer, Merge:Customer, Delete:Customer, View:CustomerIdentity, Create:CustomerIdentity, Update:CustomerIdentity, Delete:CustomerIdentity, View:CustomerForm, Update:CustomerForm, Delete:CustomerForm, FillOnBehalf:CustomerForm, Download:CustomerForm, View:FormTemplate, Create:FormTemplate, Update:FormTemplate, Delete:FormTemplate, GenerateLink:FormTemplate, View:Account, Create:Account, Update:Account, Delete:Account, View:AccountTransaction, Create:AccountTransaction, Update:AccountTransaction, Delete:AccountTransaction, View:CustomerTransaction, Create:CustomerTransaction, Update:CustomerTransaction, Delete:CustomerTransaction, View:CustomerBalances, Export:CustomerBalances, View:Assistant, Create:Assistant, Update:Assistant, Delete:Assistant, View:User, Create:User, Update:User, Delete:User, Invite:User, View:Client, Create:Client, Update:Client, Delete:Client, UpdateScopes:Client, Revoke:Client, Activate:Client, View:Imports, Update:ImportSource, Install:ImportSource, Uninstall:ImportSource, Start:ImportSource, Cancel:ImportSource, View:ImportJobDetails, View:Integrations, Create:Integration, Update:Integration, View:IntegrationConnection, Create:IntegrationConnection, Update:IntegrationConnection, Delete:IntegrationConnection, View:ProductBrand, Create:ProductBrand, Update:ProductBrand, Delete:ProductBrand, View:ProductCategory, Create:ProductCategory, Update:ProductCategory, Delete:ProductCategory, View:Product, Create:Product, Update:Product, Delete:Product, View:StockMovement, View:Warehouse, Create:Warehouse, Update:Warehouse, Delete:Warehouse, View:StockOverview, Create:StockMovement, Count:StockMovement, Transfer:StockMovement, Adjust:StockMovement, View:Invoice, Create:Invoice, Delete:Invoice, Cancel:Invoice, RevertCancel:Invoice, Send:Invoice, SendEmail:Invoice, Archive:Invoice, QueryStatus:Invoice, Download:Invoice, View:InvoiceAccount, Create:InvoiceAccount, Update:InvoiceAccount, Delete:InvoiceAccount, View:Lead, Create:Lead, Update:Lead, Delete:Lead, Convert:Lead, ViewAllLeads:Lead, Assign:Lead, AutoAssignLeads:Lead, ReceiveLeads:Lead, View:LeadReferenceSource, Create:LeadReferenceSource, Update:LeadReferenceSource, Delete:LeadReferenceSource, View:Pipeline, Create:Pipeline, Update:Pipeline, Delete:Pipeline, Activate:Pipeline, View:MailboxPage, View:Offer, Create:Offer, Update:Offer, Delete:Offer, Replicate:Offer, ViewAllOffers:Offer, Convert:Offer, View:OfferTemplate, Create:OfferTemplate, Update:OfferTemplate, Delete:OfferTemplate, View:PanelTicket, Create:PanelTicket, Update:PanelTicket, View:Role, Create:Role, Update:Role, Delete:Role, View:Sale, ViewAllSales:Sale, Create:Sale, Update:Sale, Delete:Sale, Pay:Sale, CreateDocument:Sale, DeductStock:Sale, Export:Sale, View:ProductSet, Create:ProductSet, Update:ProductSet, Delete:ProductSet, View:GeneralSettings, Update:GeneralSettings, View:AppointmentSettings, Update:AppointmentSettings, View:NotificationSettings, Update:NotificationSettings, View:ChatSettings, Update:ChatSettings, View:SupportSettings, Update:SupportSettings, View:AccountingSettings, Update:AccountingSettings, View:SalesSettings, Update:SalesSettings, Manage:SetupWizard, View:File, Create:File, Delete:File, Reorder:File, Download:File, View:Ticket, ViewAllTickets:Ticket, Create:Ticket, Update:Ticket, Delete:Ticket, View:Doctor, Create:Doctor, Update:Doctor, Delete:Doctor, View:Salesperson, Create:Salesperson, CreateUnavailablePeriod:Salesperson, Update:Salesperson, Delete:Salesperson, View:Treatment, Create:Treatment, Update:Treatment, Delete:Treatment, GenerateDescription:Treatment, View:TreatmentGroup, Create:TreatmentGroup, Update:TreatmentGroup, Delete:TreatmentGroup, View:Room, Create:Room, Update:Room, Delete:Room