Iniciar una operación masiva de tareas
curl --request POST \
--url https://api.ugps.io/api/work/tasks/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "update",
"items": [
{
"id": 2,
"label": "<string>",
"description": "<string>",
"trackerId": 123,
"from": "<string>",
"to": "<string>",
"formTemplateId": 123,
"externalId": "<string>",
"maxDelay": 123,
"minStayDuration": 123,
"minArrivalDuration": 123
}
]
}
'import requests
url = "https://api.ugps.io/api/work/tasks/bulk"
payload = {
"operation": "update",
"items": [
{
"id": 2,
"label": "<string>",
"description": "<string>",
"trackerId": 123,
"from": "<string>",
"to": "<string>",
"formTemplateId": 123,
"externalId": "<string>",
"maxDelay": 123,
"minStayDuration": 123,
"minArrivalDuration": 123
}
]
}
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({
operation: 'update',
items: [
{
id: 2,
label: '<string>',
description: '<string>',
trackerId: 123,
from: '<string>',
to: '<string>',
formTemplateId: 123,
externalId: '<string>',
maxDelay: 123,
minStayDuration: 123,
minArrivalDuration: 123
}
]
})
};
fetch('https://api.ugps.io/api/work/tasks/bulk', 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/tasks/bulk",
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([
'operation' => 'update',
'items' => [
[
'id' => 2,
'label' => '<string>',
'description' => '<string>',
'trackerId' => 123,
'from' => '<string>',
'to' => '<string>',
'formTemplateId' => 123,
'externalId' => '<string>',
'maxDelay' => 123,
'minStayDuration' => 123,
'minArrivalDuration' => 123
]
]
]),
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/tasks/bulk"
payload := strings.NewReader("{\n \"operation\": \"update\",\n \"items\": [\n {\n \"id\": 2,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"trackerId\": 123,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"formTemplateId\": 123,\n \"externalId\": \"<string>\",\n \"maxDelay\": 123,\n \"minStayDuration\": 123,\n \"minArrivalDuration\": 123\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.ugps.io/api/work/tasks/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operation\": \"update\",\n \"items\": [\n {\n \"id\": 2,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"trackerId\": 123,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"formTemplateId\": 123,\n \"externalId\": \"<string>\",\n \"maxDelay\": 123,\n \"minStayDuration\": 123,\n \"minArrivalDuration\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/work/tasks/bulk")
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 \"operation\": \"update\",\n \"items\": [\n {\n \"id\": 2,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"trackerId\": 123,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"formTemplateId\": 123,\n \"externalId\": \"<string>\",\n \"maxDelay\": 123,\n \"minStayDuration\": 123,\n \"minArrivalDuration\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"bulkOperationId": "<string>"
}
}{
"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 - Tareas
Iniciar una operación masiva de tareas
Encola una operación masiva (update, delete o assign) sobre hasta 500 tareas y
responde de inmediato con el id de la operación. El procesamiento es asíncrono
(BullMQ); consultar el progreso vía GET /api/work/tasks/bulk/{bulkOperationId}.
Operaciones (operation):
update:itemses un array de tareas completas a actualizardelete:itemses un array de{ id }assign:itemses un array de{ id, trackerId }(trackerId nullable para desasignar)
Permisos requeridos: access_tasks
POST
/
api
/
work
/
tasks
/
bulk
Iniciar una operación masiva de tareas
curl --request POST \
--url https://api.ugps.io/api/work/tasks/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "update",
"items": [
{
"id": 2,
"label": "<string>",
"description": "<string>",
"trackerId": 123,
"from": "<string>",
"to": "<string>",
"formTemplateId": 123,
"externalId": "<string>",
"maxDelay": 123,
"minStayDuration": 123,
"minArrivalDuration": 123
}
]
}
'import requests
url = "https://api.ugps.io/api/work/tasks/bulk"
payload = {
"operation": "update",
"items": [
{
"id": 2,
"label": "<string>",
"description": "<string>",
"trackerId": 123,
"from": "<string>",
"to": "<string>",
"formTemplateId": 123,
"externalId": "<string>",
"maxDelay": 123,
"minStayDuration": 123,
"minArrivalDuration": 123
}
]
}
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({
operation: 'update',
items: [
{
id: 2,
label: '<string>',
description: '<string>',
trackerId: 123,
from: '<string>',
to: '<string>',
formTemplateId: 123,
externalId: '<string>',
maxDelay: 123,
minStayDuration: 123,
minArrivalDuration: 123
}
]
})
};
fetch('https://api.ugps.io/api/work/tasks/bulk', 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/tasks/bulk",
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([
'operation' => 'update',
'items' => [
[
'id' => 2,
'label' => '<string>',
'description' => '<string>',
'trackerId' => 123,
'from' => '<string>',
'to' => '<string>',
'formTemplateId' => 123,
'externalId' => '<string>',
'maxDelay' => 123,
'minStayDuration' => 123,
'minArrivalDuration' => 123
]
]
]),
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/tasks/bulk"
payload := strings.NewReader("{\n \"operation\": \"update\",\n \"items\": [\n {\n \"id\": 2,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"trackerId\": 123,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"formTemplateId\": 123,\n \"externalId\": \"<string>\",\n \"maxDelay\": 123,\n \"minStayDuration\": 123,\n \"minArrivalDuration\": 123\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.ugps.io/api/work/tasks/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operation\": \"update\",\n \"items\": [\n {\n \"id\": 2,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"trackerId\": 123,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"formTemplateId\": 123,\n \"externalId\": \"<string>\",\n \"maxDelay\": 123,\n \"minStayDuration\": 123,\n \"minArrivalDuration\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/work/tasks/bulk")
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 \"operation\": \"update\",\n \"items\": [\n {\n \"id\": 2,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"trackerId\": 123,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"formTemplateId\": 123,\n \"externalId\": \"<string>\",\n \"maxDelay\": 123,\n \"minStayDuration\": 123,\n \"minArrivalDuration\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"bulkOperationId": "<string>"
}
}{
"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.
Body
application/json

