Update several Users
Updates up to 100 Users in one call. Each User is updated on its own: a row that fails is reported with its errors and does not prevent the others from being updated. The whole call is rejected, with no User updated, only when the payload itself is invalid, a UID is unknown, or the caller cannot manage Users.
PATCH
/
v1
/
users
/
batch_update
Update several Users
curl --request PATCH \
--url https://api.siit.io/v1/users/batch_update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"uid": "<string>",
"birthday_date": "2023-12-25",
"city": "<string>",
"country": "<string>",
"employee_number": "<string>",
"first_name": "<string>",
"hire_date": "2023-12-25",
"job_leave_date": "2023-12-25",
"job_start_date": "2023-12-25",
"job_title": "<string>",
"last_name": "<string>",
"last_working_date": "2023-12-25",
"metadata": {},
"preferred_language": "<string>",
"probation_end_date": "2023-12-25",
"work_phone": "<string>",
"department": "<string>",
"legal_entity": "<string>",
"office_location": "<string>",
"report_to": "<string>",
"teams": [
"<string>"
]
}
]
}
'import requests
url = "https://api.siit.io/v1/users/batch_update"
payload = { "items": [
{
"uid": "<string>",
"birthday_date": "2023-12-25",
"city": "<string>",
"country": "<string>",
"employee_number": "<string>",
"first_name": "<string>",
"hire_date": "2023-12-25",
"job_leave_date": "2023-12-25",
"job_start_date": "2023-12-25",
"job_title": "<string>",
"last_name": "<string>",
"last_working_date": "2023-12-25",
"metadata": {},
"preferred_language": "<string>",
"probation_end_date": "2023-12-25",
"work_phone": "<string>",
"department": "<string>",
"legal_entity": "<string>",
"office_location": "<string>",
"report_to": "<string>",
"teams": ["<string>"]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
uid: '<string>',
birthday_date: '2023-12-25',
city: '<string>',
country: '<string>',
employee_number: '<string>',
first_name: '<string>',
hire_date: '2023-12-25',
job_leave_date: '2023-12-25',
job_start_date: '2023-12-25',
job_title: '<string>',
last_name: '<string>',
last_working_date: '2023-12-25',
metadata: {},
preferred_language: '<string>',
probation_end_date: '2023-12-25',
work_phone: '<string>',
department: '<string>',
legal_entity: '<string>',
office_location: '<string>',
report_to: '<string>',
teams: ['<string>']
}
]
})
};
fetch('https://api.siit.io/v1/users/batch_update', 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.siit.io/v1/users/batch_update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'uid' => '<string>',
'birthday_date' => '2023-12-25',
'city' => '<string>',
'country' => '<string>',
'employee_number' => '<string>',
'first_name' => '<string>',
'hire_date' => '2023-12-25',
'job_leave_date' => '2023-12-25',
'job_start_date' => '2023-12-25',
'job_title' => '<string>',
'last_name' => '<string>',
'last_working_date' => '2023-12-25',
'metadata' => [
],
'preferred_language' => '<string>',
'probation_end_date' => '2023-12-25',
'work_phone' => '<string>',
'department' => '<string>',
'legal_entity' => '<string>',
'office_location' => '<string>',
'report_to' => '<string>',
'teams' => [
'<string>'
]
]
]
]),
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.siit.io/v1/users/batch_update"
payload := strings.NewReader("{\n \"items\": [\n {\n \"uid\": \"<string>\",\n \"birthday_date\": \"2023-12-25\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"employee_number\": \"<string>\",\n \"first_name\": \"<string>\",\n \"hire_date\": \"2023-12-25\",\n \"job_leave_date\": \"2023-12-25\",\n \"job_start_date\": \"2023-12-25\",\n \"job_title\": \"<string>\",\n \"last_name\": \"<string>\",\n \"last_working_date\": \"2023-12-25\",\n \"metadata\": {},\n \"preferred_language\": \"<string>\",\n \"probation_end_date\": \"2023-12-25\",\n \"work_phone\": \"<string>\",\n \"department\": \"<string>\",\n \"legal_entity\": \"<string>\",\n \"office_location\": \"<string>\",\n \"report_to\": \"<string>\",\n \"teams\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.siit.io/v1/users/batch_update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"uid\": \"<string>\",\n \"birthday_date\": \"2023-12-25\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"employee_number\": \"<string>\",\n \"first_name\": \"<string>\",\n \"hire_date\": \"2023-12-25\",\n \"job_leave_date\": \"2023-12-25\",\n \"job_start_date\": \"2023-12-25\",\n \"job_title\": \"<string>\",\n \"last_name\": \"<string>\",\n \"last_working_date\": \"2023-12-25\",\n \"metadata\": {},\n \"preferred_language\": \"<string>\",\n \"probation_end_date\": \"2023-12-25\",\n \"work_phone\": \"<string>\",\n \"department\": \"<string>\",\n \"legal_entity\": \"<string>\",\n \"office_location\": \"<string>\",\n \"report_to\": \"<string>\",\n \"teams\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siit.io/v1/users/batch_update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"uid\": \"<string>\",\n \"birthday_date\": \"2023-12-25\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"employee_number\": \"<string>\",\n \"first_name\": \"<string>\",\n \"hire_date\": \"2023-12-25\",\n \"job_leave_date\": \"2023-12-25\",\n \"job_start_date\": \"2023-12-25\",\n \"job_title\": \"<string>\",\n \"last_name\": \"<string>\",\n \"last_working_date\": \"2023-12-25\",\n \"metadata\": {},\n \"preferred_language\": \"<string>\",\n \"probation_end_date\": \"2023-12-25\",\n \"work_phone\": \"<string>\",\n \"department\": \"<string>\",\n \"legal_entity\": \"<string>\",\n \"office_location\": \"<string>\",\n \"report_to\": \"<string>\",\n \"teams\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"uid": "<string>",
"status": "updated",
"errors": [
"<string>"
]
}
]
}{
"error": "<string>",
"troubleshoot": "<string>"
}{
"error": "<string>",
"troubleshoot": "<string>"
}{
"error": "<string>",
"troubleshoot": "<string>"
}Introduction
This endpoint updates several users in one call, for example to move people to a new department or manager, or to sync a field from your HRIS. Use it instead of one Update a User call per user. Please note that:- You can update up to 100 users per call. To update more, split them into several calls.
- Each item identifies a user by its
uidand accepts the same attributes as Update a User. Only the attributes you pass are changed. - Each user can appear only once per call.
- Each user is updated on its own: if one user fails (for example because of an invalid value), the others are still updated. The response tells you, for each user, whether it was updated or why it failed, so you can retry only the failed ones.
- The whole call is rejected, with no user updated, when the payload is invalid (no items, more than 100 items, an item without
uid, auidlisted twice), when auiddoes not match any user of your company, or when your role cannot manage users. - Fields that are disabled or that your role cannot edit are ignored, as with a single update.
- The response does not contain the updated users. Retrieve a User to read their new values.
Example payload
{
"items": [
{ "uid": "u_ybj0tgd8nmr9", "department": "tv_dep_engineering", "metadata": { "cost_center": "FR-01" } },
{ "uid": "u_k2m9xq4ww1lp", "job_title": "Engineer", "teams": [] },
{ "uid": "u_p0z8c3vb7ndq", "country": "not-a-country" }
]
}
Example response
{
"results": [
{ "uid": "u_ybj0tgd8nmr9", "status": "updated", "errors": [] },
{ "uid": "u_k2m9xq4ww1lp", "status": "updated", "errors": [] },
{ "uid": "u_p0z8c3vb7ndq", "status": "error", "errors": ["Country is not included in the list"] }
]
}
Usage
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The Users to update, each identified by its UID and carrying the same attributes as the single User update.
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
Successful: each item reports whether its User was updated
The outcome of each item, in the order they were sent. Entries are outcomes, not Users: fetch a User to read its updated attributes.
Show child attributes
Show child attributes
Update several Users
curl --request PATCH \
--url https://api.siit.io/v1/users/batch_update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"uid": "<string>",
"birthday_date": "2023-12-25",
"city": "<string>",
"country": "<string>",
"employee_number": "<string>",
"first_name": "<string>",
"hire_date": "2023-12-25",
"job_leave_date": "2023-12-25",
"job_start_date": "2023-12-25",
"job_title": "<string>",
"last_name": "<string>",
"last_working_date": "2023-12-25",
"metadata": {},
"preferred_language": "<string>",
"probation_end_date": "2023-12-25",
"work_phone": "<string>",
"department": "<string>",
"legal_entity": "<string>",
"office_location": "<string>",
"report_to": "<string>",
"teams": [
"<string>"
]
}
]
}
'import requests
url = "https://api.siit.io/v1/users/batch_update"
payload = { "items": [
{
"uid": "<string>",
"birthday_date": "2023-12-25",
"city": "<string>",
"country": "<string>",
"employee_number": "<string>",
"first_name": "<string>",
"hire_date": "2023-12-25",
"job_leave_date": "2023-12-25",
"job_start_date": "2023-12-25",
"job_title": "<string>",
"last_name": "<string>",
"last_working_date": "2023-12-25",
"metadata": {},
"preferred_language": "<string>",
"probation_end_date": "2023-12-25",
"work_phone": "<string>",
"department": "<string>",
"legal_entity": "<string>",
"office_location": "<string>",
"report_to": "<string>",
"teams": ["<string>"]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
uid: '<string>',
birthday_date: '2023-12-25',
city: '<string>',
country: '<string>',
employee_number: '<string>',
first_name: '<string>',
hire_date: '2023-12-25',
job_leave_date: '2023-12-25',
job_start_date: '2023-12-25',
job_title: '<string>',
last_name: '<string>',
last_working_date: '2023-12-25',
metadata: {},
preferred_language: '<string>',
probation_end_date: '2023-12-25',
work_phone: '<string>',
department: '<string>',
legal_entity: '<string>',
office_location: '<string>',
report_to: '<string>',
teams: ['<string>']
}
]
})
};
fetch('https://api.siit.io/v1/users/batch_update', 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.siit.io/v1/users/batch_update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'uid' => '<string>',
'birthday_date' => '2023-12-25',
'city' => '<string>',
'country' => '<string>',
'employee_number' => '<string>',
'first_name' => '<string>',
'hire_date' => '2023-12-25',
'job_leave_date' => '2023-12-25',
'job_start_date' => '2023-12-25',
'job_title' => '<string>',
'last_name' => '<string>',
'last_working_date' => '2023-12-25',
'metadata' => [
],
'preferred_language' => '<string>',
'probation_end_date' => '2023-12-25',
'work_phone' => '<string>',
'department' => '<string>',
'legal_entity' => '<string>',
'office_location' => '<string>',
'report_to' => '<string>',
'teams' => [
'<string>'
]
]
]
]),
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.siit.io/v1/users/batch_update"
payload := strings.NewReader("{\n \"items\": [\n {\n \"uid\": \"<string>\",\n \"birthday_date\": \"2023-12-25\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"employee_number\": \"<string>\",\n \"first_name\": \"<string>\",\n \"hire_date\": \"2023-12-25\",\n \"job_leave_date\": \"2023-12-25\",\n \"job_start_date\": \"2023-12-25\",\n \"job_title\": \"<string>\",\n \"last_name\": \"<string>\",\n \"last_working_date\": \"2023-12-25\",\n \"metadata\": {},\n \"preferred_language\": \"<string>\",\n \"probation_end_date\": \"2023-12-25\",\n \"work_phone\": \"<string>\",\n \"department\": \"<string>\",\n \"legal_entity\": \"<string>\",\n \"office_location\": \"<string>\",\n \"report_to\": \"<string>\",\n \"teams\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.siit.io/v1/users/batch_update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"uid\": \"<string>\",\n \"birthday_date\": \"2023-12-25\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"employee_number\": \"<string>\",\n \"first_name\": \"<string>\",\n \"hire_date\": \"2023-12-25\",\n \"job_leave_date\": \"2023-12-25\",\n \"job_start_date\": \"2023-12-25\",\n \"job_title\": \"<string>\",\n \"last_name\": \"<string>\",\n \"last_working_date\": \"2023-12-25\",\n \"metadata\": {},\n \"preferred_language\": \"<string>\",\n \"probation_end_date\": \"2023-12-25\",\n \"work_phone\": \"<string>\",\n \"department\": \"<string>\",\n \"legal_entity\": \"<string>\",\n \"office_location\": \"<string>\",\n \"report_to\": \"<string>\",\n \"teams\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siit.io/v1/users/batch_update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"uid\": \"<string>\",\n \"birthday_date\": \"2023-12-25\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"employee_number\": \"<string>\",\n \"first_name\": \"<string>\",\n \"hire_date\": \"2023-12-25\",\n \"job_leave_date\": \"2023-12-25\",\n \"job_start_date\": \"2023-12-25\",\n \"job_title\": \"<string>\",\n \"last_name\": \"<string>\",\n \"last_working_date\": \"2023-12-25\",\n \"metadata\": {},\n \"preferred_language\": \"<string>\",\n \"probation_end_date\": \"2023-12-25\",\n \"work_phone\": \"<string>\",\n \"department\": \"<string>\",\n \"legal_entity\": \"<string>\",\n \"office_location\": \"<string>\",\n \"report_to\": \"<string>\",\n \"teams\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"uid": "<string>",
"status": "updated",
"errors": [
"<string>"
]
}
]
}{
"error": "<string>",
"troubleshoot": "<string>"
}{
"error": "<string>",
"troubleshoot": "<string>"
}{
"error": "<string>",
"troubleshoot": "<string>"
}
