Quitar una tarea de la pauta
curl --request DELETE \
--url https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}', 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/maintenance/programs/{id}/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "507f1f77bcf86cd799439011",
"name": "Volvo",
"description": "<string>",
"status": "active",
"sourceGroup": {
"id": "<string>",
"name": "<string>",
"takenAt": "2023-11-07T05:31:56Z"
},
"taskCount": 123,
"assetCount": 123,
"dueCounts": {
"overdue": 123,
"dueSoon": 123,
"ok": 123,
"assumedOk": 123,
"missingLastService": 123,
"assumedLastService": 123
},
"toScheduleAssetCount": 123,
"recipients": {
"userIds": [
"507f1f77bcf86cd799439011"
],
"emails": [
"taller@empresa.cl"
]
},
"requiresAttachment": true,
"requiresCost": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"recipientUsers": [
{
"id": "<string>",
"name": "Jefe Taller",
"email": "<string>"
}
],
"tasks": [
{
"id": "<string>",
"taskDefinition": {
"id": "<string>",
"code": "ACM",
"name": "Cambio de aceite de motor",
"status": "active"
},
"conditions": {
"odometer": {
"everyKm": 40000,
"remindBeforeKm": 4000
},
"engineHours": {
"everyHours": 2,
"remindBeforeHours": 1
},
"date": {
"every": 2,
"unit": "days",
"remindBefore": 1,
"remindUnit": "days"
}
},
"exceptionCounts": {
"notApplicable": 123,
"ownInterval": 123
}
}
],
"assets": [
{
"id": "<string>",
"name": "<string>",
"plate": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"kilometer": 123,
"kilometerSource": "tracker",
"addedAt": "2023-11-07T05:31:56Z",
"exceptions": [
{
"taskId": "<string>",
"notApplicable": true,
"conditions": {
"odometer": {
"everyKm": 40000,
"remindBeforeKm": 4000
},
"engineHours": {
"everyHours": 2,
"remindBeforeHours": 1
},
"date": {
"every": 2,
"unit": "days",
"remindBefore": 1,
"remindUnit": "days"
}
}
}
]
}
],
"groupDifference": {
"groupId": "<string>",
"groupName": "<string>",
"missingAssets": [
{
"id": "<string>",
"name": "<string>",
"plate": "<string>"
}
]
}
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"status": "failed",
"code": "TRACKER_SENSOR_DIN_CONFLICT",
"message": "Esa entrada digital ya está asignada a otro sensor del dispositivo"
}{
"message": "Error interno del servidor"
}Mantenimiento - Pautas
Quitar una tarea de la pauta
Quita la tarea de todos los activos de la pauta. Sus mantenciones abiertas quedan «Mantención sin asignación» (status: unassigned) y las hechas se conservan como historial; la misma Tarea del catálogo se puede volver a agregar. Si una mantención abierta de la tarea está en una orden de trabajo abierta responde 409 MAINTENANCE_PROGRAM_IN_OPEN_WORK_ORDER con la mantención y la orden en el mensaje, y no cambia nada. 404 MAINTENANCE_PROGRAM_TASK_NOT_FOUND si la tarea no es de la pauta; 409 MAINTENANCE_PROGRAM_ARCHIVED si la pauta está archivada.
DELETE
/
api
/
maintenance
/
programs
/
{id}
/
tasks
/
{taskId}
Quitar una tarea de la pauta
curl --request DELETE \
--url https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}', 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/maintenance/programs/{id}/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/maintenance/programs/{id}/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "507f1f77bcf86cd799439011",
"name": "Volvo",
"description": "<string>",
"status": "active",
"sourceGroup": {
"id": "<string>",
"name": "<string>",
"takenAt": "2023-11-07T05:31:56Z"
},
"taskCount": 123,
"assetCount": 123,
"dueCounts": {
"overdue": 123,
"dueSoon": 123,
"ok": 123,
"assumedOk": 123,
"missingLastService": 123,
"assumedLastService": 123
},
"toScheduleAssetCount": 123,
"recipients": {
"userIds": [
"507f1f77bcf86cd799439011"
],
"emails": [
"taller@empresa.cl"
]
},
"requiresAttachment": true,
"requiresCost": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"recipientUsers": [
{
"id": "<string>",
"name": "Jefe Taller",
"email": "<string>"
}
],
"tasks": [
{
"id": "<string>",
"taskDefinition": {
"id": "<string>",
"code": "ACM",
"name": "Cambio de aceite de motor",
"status": "active"
},
"conditions": {
"odometer": {
"everyKm": 40000,
"remindBeforeKm": 4000
},
"engineHours": {
"everyHours": 2,
"remindBeforeHours": 1
},
"date": {
"every": 2,
"unit": "days",
"remindBefore": 1,
"remindUnit": "days"
}
},
"exceptionCounts": {
"notApplicable": 123,
"ownInterval": 123
}
}
],
"assets": [
{
"id": "<string>",
"name": "<string>",
"plate": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"kilometer": 123,
"kilometerSource": "tracker",
"addedAt": "2023-11-07T05:31:56Z",
"exceptions": [
{
"taskId": "<string>",
"notApplicable": true,
"conditions": {
"odometer": {
"everyKm": 40000,
"remindBeforeKm": 4000
},
"engineHours": {
"everyHours": 2,
"remindBeforeHours": 1
},
"date": {
"every": 2,
"unit": "days",
"remindBefore": 1,
"remindUnit": "days"
}
}
}
]
}
],
"groupDifference": {
"groupId": "<string>",
"groupName": "<string>",
"missingAssets": [
{
"id": "<string>",
"name": "<string>",
"plate": "<string>"
}
]
}
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"status": "failed",
"code": "TRACKER_SENSOR_DIN_CONFLICT",
"message": "Esa entrada digital ya está asignada a otro sensor del dispositivo"
}{
"message": "Error interno del servidor"
}Authorizations
Token de sesión Better Auth o API token (atk_...) en el header Authorization: Bearer <token>. Los JWT legacy ya no son válidos.

