curl --request GET \
--url https://external.pleo.io/v2/employees \
--header 'Authorization: Bearer <token>'import requests
url = "https://external.pleo.io/v2/employees"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://external.pleo.io/v2/employees', 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://external.pleo.io/v2/employees",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://external.pleo.io/v2/employees"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://external.pleo.io/v2/employees")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v2/employees")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"firstName": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isDeleted": true,
"lastName": "<string>",
"avatar": {
"url": "<string>"
},
"code": "<string>",
"jobTitle": "<string>",
"phone": "<string>",
"role": "<string>"
}
],
"pagination": {
"currentRequestPagination": {
"parameters": {},
"after": "<string>",
"before": "<string>",
"limit": 123,
"offset": 123,
"sortingKeys": [
"<string>"
],
"sortingOrder": [
"ASC"
]
},
"hasNextPage": true,
"hasPreviousPage": true,
"endCursor": "<string>",
"startCursor": "<string>",
"total": 123
}
}Search for employees
Use this endpoint to search for multiple employees. By default only active employees are returned; set the includeDeleted query parameter to true to also include deleted employees, which are flagged with isDeleted=true.
curl --request GET \
--url https://external.pleo.io/v2/employees \
--header 'Authorization: Bearer <token>'import requests
url = "https://external.pleo.io/v2/employees"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://external.pleo.io/v2/employees', 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://external.pleo.io/v2/employees",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://external.pleo.io/v2/employees"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://external.pleo.io/v2/employees")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v2/employees")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"firstName": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isDeleted": true,
"lastName": "<string>",
"avatar": {
"url": "<string>"
},
"code": "<string>",
"jobTitle": "<string>",
"phone": "<string>",
"role": "<string>"
}
],
"pagination": {
"currentRequestPagination": {
"parameters": {},
"after": "<string>",
"before": "<string>",
"limit": 123,
"offset": 123,
"sortingKeys": [
"<string>"
],
"sortingOrder": [
"ASC"
]
},
"hasNextPage": true,
"hasPreviousPage": true,
"endCursor": "<string>",
"startCursor": "<string>",
"total": 123
}
}Authorizations
Query Parameters
Enter the company ID of the employees you are searching for. This is not a mandatory parameter; hence, if you do not know the company ID, the response message contains details of all employees to which you have access. If you are searching for employees at the organisation level, ensure that the access token used for authentication has the correct permissions.
Set to true to also return deleted employees. Deleted employees are returned alongside active employees and can be identified by the isDeleted field in the response. The email of a deleted employee is returned with a prefix of the form xxxxxx (for example __abc123__jane@example.com), so searching by the original email will not match deleted employees. Defaults to false, in which case only active employees are returned.
Was this page helpful?