curl --request POST \
--url https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
{
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions"
payload = { "permissions": [
{
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: [{id: '<string>', expires_at: '2023-11-07T05:31:56Z'}]})
};
fetch('https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions', 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://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions",
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([
'permissions' => [
[
'id' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions"
payload := strings.NewReader("{\n \"permissions\": [\n {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"permissions\": [\n {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": [\n {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"type": "<string>",
"working_hours": {},
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"profile_id": "<string>",
"is_direct_seller": true,
"company": {},
"client": {},
"organization": {}
}{
"message": "<string>",
"errors": {}
}Grant extra permissions to agent (organization)
Sets the extra permissions (each with an optional expiry date) of an agent account in the organization space on top of its profile; the list replaces the previous extra permissions.
curl --request POST \
--url https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
{
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions"
payload = { "permissions": [
{
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: [{id: '<string>', expires_at: '2023-11-07T05:31:56Z'}]})
};
fetch('https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions', 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://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions",
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([
'permissions' => [
[
'id' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions"
payload := strings.NewReader("{\n \"permissions\": [\n {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"permissions\": [\n {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/team/agent-organizations/{agentId}/add-permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": [\n {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"type": "<string>",
"working_hours": {},
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"profile_id": "<string>",
"is_direct_seller": true,
"company": {},
"client": {},
"organization": {}
}{
"message": "<string>",
"errors": {}
}agents.update
Conditions
- The caller must be a member (user, client or organization account) of the organization space; agent accounts cannot manage agent accounts.
- permissions must be present (an empty list is allowed) with at most 5 entries.
- Each id must be the group identifier of a permission that exists for this kind of agent account (company, client or organization according to the space), without duplicates; otherwise the call is refused.
- expires_at, when sent, must be a date later than now.
- The call replaces the whole set of direct permissions of the agent account: permissions not listed are removed, and an empty list removes them all.
- The agent account’s profile is not changed; the new permissions apply on top of it, each one until its expires_at when given.
- The agent account is not signed out.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the agent (27-character KSUID string). It must belong to the current space.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, username, first_name, last_name, type, working_hours, is_active, created_at, updated_at, profile_id, is_direct_seller.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: company, company.organization, client, organization.
Body
Complete list of extra permissions to set. Required but may be empty, with at most 5 entries. It replaces the extra permissions held until now.
5Show child attributes
Show child attributes
Response
Resource (only with response=resource).
Identifier of the agent account (27-character KSUID string).
Login name of the agent account, lowercase. Generated from the first and last name at creation; unique within its company, client account or organization.
First name of the agent account.
Last name of the agent account.
Kind of agent account: agent (company), client_agent or organization_agent.
Weekly schedule during which the agent account may work, keyed by day name (monday to sunday) with time ranges such as 09:00-12:00, plus optional dated exceptions; null when no schedule is set.
Whether the agent account can sign in. Set to false by deactivation.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Identifier of the access profile assigned to the agent account (27-character KSUID string).
True when the agent account is a seller of its company with no cash register (sells directly). Always false for client and organization agent accounts.
Short company the agent account belongs to, for company agent accounts. Only rendered when requested with the include parameter.
Short client account the agent account belongs to, for client agent accounts. Only rendered when requested with the include parameter.
Organization the agent account belongs to. Only rendered for organization agent accounts, and only when requested with the include parameter.