Actualizar un formulario dinámico
curl --request PUT \
--url https://api.ugps.io/api/dynamic-forms/{dynamicFormId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Inspección diaria",
"fields": [
{
"fieldId": "<string>",
"label": "Estado de frenos",
"required": true,
"helperText": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123,
"options": [
{
"optionId": "3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55",
"label": "Dañado",
"critical": true
}
],
"minChecked": 123,
"maxChecked": 123,
"criticalWhen": true,
"maxStars": 123,
"disableFuture": true,
"disablePast": true,
"maxFiles": 123,
"allowedExtensions": [
"pdf"
]
}
],
"description": "<string>",
"assetIds": [
"<string>"
],
"assetGroupIds": [
"<string>"
],
"allAssets": true
}
'import requests
url = "https://api.ugps.io/api/dynamic-forms/{dynamicFormId}"
payload = {
"name": "Inspección diaria",
"fields": [
{
"fieldId": "<string>",
"label": "Estado de frenos",
"required": True,
"helperText": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123,
"options": [
{
"optionId": "3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55",
"label": "Dañado",
"critical": True
}
],
"minChecked": 123,
"maxChecked": 123,
"criticalWhen": True,
"maxStars": 123,
"disableFuture": True,
"disablePast": True,
"maxFiles": 123,
"allowedExtensions": ["pdf"]
}
],
"description": "<string>",
"assetIds": ["<string>"],
"assetGroupIds": ["<string>"],
"allAssets": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Inspección diaria',
fields: [
{
fieldId: '<string>',
label: 'Estado de frenos',
required: true,
helperText: '<string>',
minLength: 123,
maxLength: 123,
min: 123,
max: 123,
options: [
{
optionId: '3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55',
label: 'Dañado',
critical: true
}
],
minChecked: 123,
maxChecked: 123,
criticalWhen: true,
maxStars: 123,
disableFuture: true,
disablePast: true,
maxFiles: 123,
allowedExtensions: ['pdf']
}
],
description: '<string>',
assetIds: ['<string>'],
assetGroupIds: ['<string>'],
allAssets: true
})
};
fetch('https://api.ugps.io/api/dynamic-forms/{dynamicFormId}', 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/dynamic-forms/{dynamicFormId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Inspección diaria',
'fields' => [
[
'fieldId' => '<string>',
'label' => 'Estado de frenos',
'required' => true,
'helperText' => '<string>',
'minLength' => 123,
'maxLength' => 123,
'min' => 123,
'max' => 123,
'options' => [
[
'optionId' => '3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55',
'label' => 'Dañado',
'critical' => true
]
],
'minChecked' => 123,
'maxChecked' => 123,
'criticalWhen' => true,
'maxStars' => 123,
'disableFuture' => true,
'disablePast' => true,
'maxFiles' => 123,
'allowedExtensions' => [
'pdf'
]
]
],
'description' => '<string>',
'assetIds' => [
'<string>'
],
'assetGroupIds' => [
'<string>'
],
'allAssets' => true
]),
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/dynamic-forms/{dynamicFormId}"
payload := strings.NewReader("{\n \"name\": \"Inspección diaria\",\n \"fields\": [\n {\n \"fieldId\": \"<string>\",\n \"label\": \"Estado de frenos\",\n \"required\": true,\n \"helperText\": \"<string>\",\n \"minLength\": 123,\n \"maxLength\": 123,\n \"min\": 123,\n \"max\": 123,\n \"options\": [\n {\n \"optionId\": \"3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55\",\n \"label\": \"Dañado\",\n \"critical\": true\n }\n ],\n \"minChecked\": 123,\n \"maxChecked\": 123,\n \"criticalWhen\": true,\n \"maxStars\": 123,\n \"disableFuture\": true,\n \"disablePast\": true,\n \"maxFiles\": 123,\n \"allowedExtensions\": [\n \"pdf\"\n ]\n }\n ],\n \"description\": \"<string>\",\n \"assetIds\": [\n \"<string>\"\n ],\n \"assetGroupIds\": [\n \"<string>\"\n ],\n \"allAssets\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.ugps.io/api/dynamic-forms/{dynamicFormId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Inspección diaria\",\n \"fields\": [\n {\n \"fieldId\": \"<string>\",\n \"label\": \"Estado de frenos\",\n \"required\": true,\n \"helperText\": \"<string>\",\n \"minLength\": 123,\n \"maxLength\": 123,\n \"min\": 123,\n \"max\": 123,\n \"options\": [\n {\n \"optionId\": \"3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55\",\n \"label\": \"Dañado\",\n \"critical\": true\n }\n ],\n \"minChecked\": 123,\n \"maxChecked\": 123,\n \"criticalWhen\": true,\n \"maxStars\": 123,\n \"disableFuture\": true,\n \"disablePast\": true,\n \"maxFiles\": 123,\n \"allowedExtensions\": [\n \"pdf\"\n ]\n }\n ],\n \"description\": \"<string>\",\n \"assetIds\": [\n \"<string>\"\n ],\n \"assetGroupIds\": [\n \"<string>\"\n ],\n \"allAssets\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/dynamic-forms/{dynamicFormId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Inspección diaria\",\n \"fields\": [\n {\n \"fieldId\": \"<string>\",\n \"label\": \"Estado de frenos\",\n \"required\": true,\n \"helperText\": \"<string>\",\n \"minLength\": 123,\n \"maxLength\": 123,\n \"min\": 123,\n \"max\": 123,\n \"options\": [\n {\n \"optionId\": \"3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55\",\n \"label\": \"Dañado\",\n \"critical\": true\n }\n ],\n \"minChecked\": 123,\n \"maxChecked\": 123,\n \"criticalWhen\": true,\n \"maxStars\": 123,\n \"disableFuture\": true,\n \"disablePast\": true,\n \"maxFiles\": 123,\n \"allowedExtensions\": [\n \"pdf\"\n ]\n }\n ],\n \"description\": \"<string>\",\n \"assetIds\": [\n \"<string>\"\n ],\n \"assetGroupIds\": [\n \"<string>\"\n ],\n \"allAssets\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"name": "Inspección diaria",
"status": "active",
"fields": [
{
"fieldId": "<string>",
"type": "text",
"label": "Estado de frenos",
"required": true,
"helperText": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123,
"options": [
{
"optionId": "3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55",
"label": "Dañado",
"critical": true
}
],
"minChecked": 123,
"maxChecked": 123,
"criticalWhen": true,
"maxStars": 123,
"disableFuture": true,
"disablePast": true,
"maxFiles": 123,
"allowedExtensions": [
"pdf"
]
}
],
"_id": "<string>",
"clientId": "<string>",
"version": 123,
"description": "<string>",
"assetIds": [
"<string>"
],
"assetGroupIds": [
"<string>"
],
"allAssets": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"message": "Error interno del servidor"
}Formularios dinámicos
Actualizar un formulario dinámico
Reemplaza nombre, asignación, estado y campos. Si los campos cambian, version sube;
un fieldId existente no puede cambiar de type (DYNAMIC_FORM_FIELD_TYPE_CHANGED).
Permisos requeridos: access_dynamic_forms
PUT
/
api
/
dynamic-forms
/
{dynamicFormId}
Actualizar un formulario dinámico
curl --request PUT \
--url https://api.ugps.io/api/dynamic-forms/{dynamicFormId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Inspección diaria",
"fields": [
{
"fieldId": "<string>",
"label": "Estado de frenos",
"required": true,
"helperText": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123,
"options": [
{
"optionId": "3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55",
"label": "Dañado",
"critical": true
}
],
"minChecked": 123,
"maxChecked": 123,
"criticalWhen": true,
"maxStars": 123,
"disableFuture": true,
"disablePast": true,
"maxFiles": 123,
"allowedExtensions": [
"pdf"
]
}
],
"description": "<string>",
"assetIds": [
"<string>"
],
"assetGroupIds": [
"<string>"
],
"allAssets": true
}
'import requests
url = "https://api.ugps.io/api/dynamic-forms/{dynamicFormId}"
payload = {
"name": "Inspección diaria",
"fields": [
{
"fieldId": "<string>",
"label": "Estado de frenos",
"required": True,
"helperText": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123,
"options": [
{
"optionId": "3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55",
"label": "Dañado",
"critical": True
}
],
"minChecked": 123,
"maxChecked": 123,
"criticalWhen": True,
"maxStars": 123,
"disableFuture": True,
"disablePast": True,
"maxFiles": 123,
"allowedExtensions": ["pdf"]
}
],
"description": "<string>",
"assetIds": ["<string>"],
"assetGroupIds": ["<string>"],
"allAssets": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Inspección diaria',
fields: [
{
fieldId: '<string>',
label: 'Estado de frenos',
required: true,
helperText: '<string>',
minLength: 123,
maxLength: 123,
min: 123,
max: 123,
options: [
{
optionId: '3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55',
label: 'Dañado',
critical: true
}
],
minChecked: 123,
maxChecked: 123,
criticalWhen: true,
maxStars: 123,
disableFuture: true,
disablePast: true,
maxFiles: 123,
allowedExtensions: ['pdf']
}
],
description: '<string>',
assetIds: ['<string>'],
assetGroupIds: ['<string>'],
allAssets: true
})
};
fetch('https://api.ugps.io/api/dynamic-forms/{dynamicFormId}', 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/dynamic-forms/{dynamicFormId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Inspección diaria',
'fields' => [
[
'fieldId' => '<string>',
'label' => 'Estado de frenos',
'required' => true,
'helperText' => '<string>',
'minLength' => 123,
'maxLength' => 123,
'min' => 123,
'max' => 123,
'options' => [
[
'optionId' => '3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55',
'label' => 'Dañado',
'critical' => true
]
],
'minChecked' => 123,
'maxChecked' => 123,
'criticalWhen' => true,
'maxStars' => 123,
'disableFuture' => true,
'disablePast' => true,
'maxFiles' => 123,
'allowedExtensions' => [
'pdf'
]
]
],
'description' => '<string>',
'assetIds' => [
'<string>'
],
'assetGroupIds' => [
'<string>'
],
'allAssets' => true
]),
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/dynamic-forms/{dynamicFormId}"
payload := strings.NewReader("{\n \"name\": \"Inspección diaria\",\n \"fields\": [\n {\n \"fieldId\": \"<string>\",\n \"label\": \"Estado de frenos\",\n \"required\": true,\n \"helperText\": \"<string>\",\n \"minLength\": 123,\n \"maxLength\": 123,\n \"min\": 123,\n \"max\": 123,\n \"options\": [\n {\n \"optionId\": \"3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55\",\n \"label\": \"Dañado\",\n \"critical\": true\n }\n ],\n \"minChecked\": 123,\n \"maxChecked\": 123,\n \"criticalWhen\": true,\n \"maxStars\": 123,\n \"disableFuture\": true,\n \"disablePast\": true,\n \"maxFiles\": 123,\n \"allowedExtensions\": [\n \"pdf\"\n ]\n }\n ],\n \"description\": \"<string>\",\n \"assetIds\": [\n \"<string>\"\n ],\n \"assetGroupIds\": [\n \"<string>\"\n ],\n \"allAssets\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.ugps.io/api/dynamic-forms/{dynamicFormId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Inspección diaria\",\n \"fields\": [\n {\n \"fieldId\": \"<string>\",\n \"label\": \"Estado de frenos\",\n \"required\": true,\n \"helperText\": \"<string>\",\n \"minLength\": 123,\n \"maxLength\": 123,\n \"min\": 123,\n \"max\": 123,\n \"options\": [\n {\n \"optionId\": \"3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55\",\n \"label\": \"Dañado\",\n \"critical\": true\n }\n ],\n \"minChecked\": 123,\n \"maxChecked\": 123,\n \"criticalWhen\": true,\n \"maxStars\": 123,\n \"disableFuture\": true,\n \"disablePast\": true,\n \"maxFiles\": 123,\n \"allowedExtensions\": [\n \"pdf\"\n ]\n }\n ],\n \"description\": \"<string>\",\n \"assetIds\": [\n \"<string>\"\n ],\n \"assetGroupIds\": [\n \"<string>\"\n ],\n \"allAssets\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/dynamic-forms/{dynamicFormId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Inspección diaria\",\n \"fields\": [\n {\n \"fieldId\": \"<string>\",\n \"label\": \"Estado de frenos\",\n \"required\": true,\n \"helperText\": \"<string>\",\n \"minLength\": 123,\n \"maxLength\": 123,\n \"min\": 123,\n \"max\": 123,\n \"options\": [\n {\n \"optionId\": \"3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55\",\n \"label\": \"Dañado\",\n \"critical\": true\n }\n ],\n \"minChecked\": 123,\n \"maxChecked\": 123,\n \"criticalWhen\": true,\n \"maxStars\": 123,\n \"disableFuture\": true,\n \"disablePast\": true,\n \"maxFiles\": 123,\n \"allowedExtensions\": [\n \"pdf\"\n ]\n }\n ],\n \"description\": \"<string>\",\n \"assetIds\": [\n \"<string>\"\n ],\n \"assetGroupIds\": [\n \"<string>\"\n ],\n \"allAssets\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"name": "Inspección diaria",
"status": "active",
"fields": [
{
"fieldId": "<string>",
"type": "text",
"label": "Estado de frenos",
"required": true,
"helperText": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123,
"options": [
{
"optionId": "3f1c2a8e-4b8d-4c1a-9a6e-7d2f0b1c9e55",
"label": "Dañado",
"critical": true
}
],
"minChecked": 123,
"maxChecked": 123,
"criticalWhen": true,
"maxStars": 123,
"disableFuture": true,
"disablePast": true,
"maxFiles": 123,
"allowedExtensions": [
"pdf"
]
}
],
"_id": "<string>",
"clientId": "<string>",
"version": 123,
"description": "<string>",
"assetIds": [
"<string>"
],
"assetGroupIds": [
"<string>"
],
"allAssets": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"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
Body
application/json
Cuerpo de creación y edición. En la creación fieldId/optionId se generan si no vienen; en la edición se conservan los existentes.
Example:
"Inspección diaria"
Show child attributes
Show child attributes
Activos individuales a los que aplica.
Grupos cuyos activos, presentes y futuros, reciben el formulario.
Aplica a todos los activos del cliente; ignora assetIds y assetGroupIds.
Solo en la edición. Un formulario inactivo no aparece al escanear.
Available options:
active, inactive