Actualizar un empleado
curl --request PATCH \
--url https://api.ugps.io/api/work/employees/{employeeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"middleName": "",
"lastName": "",
"email": "",
"phone": "",
"trackerId": null,
"departmentId": null,
"hardwareKey": null,
"personnelNumber": "",
"ssn": "",
"tags": [],
"location": null,
"driverLicenseNumber": "",
"driverLicenseCats": "",
"driverLicenseIssueDate": null,
"driverLicenseValidTill": null
}
'import requests
url = "https://api.ugps.io/api/work/employees/{employeeId}"
payload = {
"firstName": "<string>",
"middleName": "",
"lastName": "",
"email": "",
"phone": "",
"trackerId": None,
"departmentId": None,
"hardwareKey": None,
"personnelNumber": "",
"ssn": "",
"tags": [],
"location": None,
"driverLicenseNumber": "",
"driverLicenseCats": "",
"driverLicenseIssueDate": None,
"driverLicenseValidTill": None
}
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({
firstName: '<string>',
middleName: '',
lastName: '',
email: '',
phone: '',
trackerId: null,
departmentId: null,
hardwareKey: null,
personnelNumber: '',
ssn: '',
tags: [],
location: null,
driverLicenseNumber: '',
driverLicenseCats: '',
driverLicenseIssueDate: null,
driverLicenseValidTill: null
})
};
fetch('https://api.ugps.io/api/work/employees/{employeeId}', 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.ugps.io/api/work/employees/{employeeId}",
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([
'firstName' => '<string>',
'middleName' => '',
'lastName' => '',
'email' => '',
'phone' => '',
'trackerId' => null,
'departmentId' => null,
'hardwareKey' => null,
'personnelNumber' => '',
'ssn' => '',
'tags' => [
],
'location' => null,
'driverLicenseNumber' => '',
'driverLicenseCats' => '',
'driverLicenseIssueDate' => null,
'driverLicenseValidTill' => null
]),
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.ugps.io/api/work/employees/{employeeId}"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"middleName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"trackerId\": null,\n \"departmentId\": null,\n \"hardwareKey\": null,\n \"personnelNumber\": \"\",\n \"ssn\": \"\",\n \"tags\": [],\n \"location\": null,\n \"driverLicenseNumber\": \"\",\n \"driverLicenseCats\": \"\",\n \"driverLicenseIssueDate\": null,\n \"driverLicenseValidTill\": null\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.ugps.io/api/work/employees/{employeeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"middleName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"trackerId\": null,\n \"departmentId\": null,\n \"hardwareKey\": null,\n \"personnelNumber\": \"\",\n \"ssn\": \"\",\n \"tags\": [],\n \"location\": null,\n \"driverLicenseNumber\": \"\",\n \"driverLicenseCats\": \"\",\n \"driverLicenseIssueDate\": null,\n \"driverLicenseValidTill\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/work/employees/{employeeId}")
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 \"firstName\": \"<string>\",\n \"middleName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"trackerId\": null,\n \"departmentId\": null,\n \"hardwareKey\": null,\n \"personnelNumber\": \"\",\n \"ssn\": \"\",\n \"tags\": [],\n \"location\": null,\n \"driverLicenseNumber\": \"\",\n \"driverLicenseCats\": \"\",\n \"driverLicenseIssueDate\": null,\n \"driverLicenseValidTill\": null\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"updated": true
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"message": "Error interno del servidor"
}Trabajo - Empleados
Actualizar un empleado
Actualiza el empleado completo: Navixy valida el objeto entero y rechaza los payloads parciales, así que el body debe traer todos los campos.
Permisos requeridos: access_employees
PATCH
/
api
/
work
/
employees
/
{employeeId}
Actualizar un empleado
curl --request PATCH \
--url https://api.ugps.io/api/work/employees/{employeeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"middleName": "",
"lastName": "",
"email": "",
"phone": "",
"trackerId": null,
"departmentId": null,
"hardwareKey": null,
"personnelNumber": "",
"ssn": "",
"tags": [],
"location": null,
"driverLicenseNumber": "",
"driverLicenseCats": "",
"driverLicenseIssueDate": null,
"driverLicenseValidTill": null
}
'import requests
url = "https://api.ugps.io/api/work/employees/{employeeId}"
payload = {
"firstName": "<string>",
"middleName": "",
"lastName": "",
"email": "",
"phone": "",
"trackerId": None,
"departmentId": None,
"hardwareKey": None,
"personnelNumber": "",
"ssn": "",
"tags": [],
"location": None,
"driverLicenseNumber": "",
"driverLicenseCats": "",
"driverLicenseIssueDate": None,
"driverLicenseValidTill": None
}
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({
firstName: '<string>',
middleName: '',
lastName: '',
email: '',
phone: '',
trackerId: null,
departmentId: null,
hardwareKey: null,
personnelNumber: '',
ssn: '',
tags: [],
location: null,
driverLicenseNumber: '',
driverLicenseCats: '',
driverLicenseIssueDate: null,
driverLicenseValidTill: null
})
};
fetch('https://api.ugps.io/api/work/employees/{employeeId}', 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.ugps.io/api/work/employees/{employeeId}",
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([
'firstName' => '<string>',
'middleName' => '',
'lastName' => '',
'email' => '',
'phone' => '',
'trackerId' => null,
'departmentId' => null,
'hardwareKey' => null,
'personnelNumber' => '',
'ssn' => '',
'tags' => [
],
'location' => null,
'driverLicenseNumber' => '',
'driverLicenseCats' => '',
'driverLicenseIssueDate' => null,
'driverLicenseValidTill' => null
]),
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.ugps.io/api/work/employees/{employeeId}"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"middleName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"trackerId\": null,\n \"departmentId\": null,\n \"hardwareKey\": null,\n \"personnelNumber\": \"\",\n \"ssn\": \"\",\n \"tags\": [],\n \"location\": null,\n \"driverLicenseNumber\": \"\",\n \"driverLicenseCats\": \"\",\n \"driverLicenseIssueDate\": null,\n \"driverLicenseValidTill\": null\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.ugps.io/api/work/employees/{employeeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"middleName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"trackerId\": null,\n \"departmentId\": null,\n \"hardwareKey\": null,\n \"personnelNumber\": \"\",\n \"ssn\": \"\",\n \"tags\": [],\n \"location\": null,\n \"driverLicenseNumber\": \"\",\n \"driverLicenseCats\": \"\",\n \"driverLicenseIssueDate\": null,\n \"driverLicenseValidTill\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/work/employees/{employeeId}")
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 \"firstName\": \"<string>\",\n \"middleName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"trackerId\": null,\n \"departmentId\": null,\n \"hardwareKey\": null,\n \"personnelNumber\": \"\",\n \"ssn\": \"\",\n \"tags\": [],\n \"location\": null,\n \"driverLicenseNumber\": \"\",\n \"driverLicenseCats\": \"\",\n \"driverLicenseIssueDate\": null,\n \"driverLicenseValidTill\": null\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"updated": true
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"message": "Error interno del servidor"
}Authorizations
bearerAuthcookieAuth
Token de sesión Better Auth o API token (atk_...) en el header Authorization: Bearer <token>. Los JWT legacy ya no son válidos.
Path Parameters
Id del empleado en Navixy
Body
application/json
Minimum string length:
1Email válido o cadena vacía
null = sin llave; la cadena vacía guardaría una llave vacía en Navixy
Base del empleado. lat/lng pueden venir en null: el backend geocodifica la
dirección al guardar. Debe reenviarse tal como la entrega el listado, porque
Navixy reemplaza el empleado entero y omitirla borra la ubicación guardada.
Show child attributes
Show child attributes
⌘I