Agents
Reactivate an agent
Reactivates a previously deactivated agent of the caller’s team.
Effects:
- The agent re-occupies a license seat (the team must have a free seat available).
- The agent’s access is restored without data loss; the agent stays in the original office with the original seat type.
Constraints:
- The caller must have team-agent management permission (MANAGE_TEAM_AGENT or MANAGE_TEAM_AGENT_DEPARTMENT).
- The target agent must belong to the caller’s team and must currently be deactivated.
- When the team has no free seat, the call fails with SEAT_INSUFFICIENT (310111); additional seats must be purchased in the Lofty UI first.
POST
/
v2.0
/
agents
/
{agentId}
/
reactivate
Reactivate an agent
curl --request POST \
--url https://api.lofty.com/v2.0/agents/{agentId}/reactivate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.lofty.com/v2.0/agents/{agentId}/reactivate"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.lofty.com/v2.0/agents/{agentId}/reactivate', 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.lofty.com/v2.0/agents/{agentId}/reactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v2.0/agents/{agentId}/reactivate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lofty.com/v2.0/agents/{agentId}/reactivate")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v2.0/agents/{agentId}/reactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {}
}"<string>""<string>"Path Parameters
User ID of the agent to reactivate.
Required range:
x >= 1Response
Always returned once authentication passes, whether the call succeeded or not. On success the body is {"success":true}. On failure the body is {"code":,"message":<description>} instead - the HTTP status stays 200, so check code (absent/0 means success) rather than the status to detect errors. Failure codes: invalid agent id (20012), agent already active (990112), insufficient seats (310111), or not authorized (1900012).
⌘I
Reactivate an agent
curl --request POST \
--url https://api.lofty.com/v2.0/agents/{agentId}/reactivate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.lofty.com/v2.0/agents/{agentId}/reactivate"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.lofty.com/v2.0/agents/{agentId}/reactivate', 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.lofty.com/v2.0/agents/{agentId}/reactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v2.0/agents/{agentId}/reactivate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lofty.com/v2.0/agents/{agentId}/reactivate")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v2.0/agents/{agentId}/reactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {}
}"<string>""<string>"