{
    "openapi": "3.1.0",
    "info": {
        "title": "Conntodo CRM \u2014 API Docs",
        "version": "1.0.0",
        "description": "API REST multi-aplicaci\u00f3n de Conntodo CRM. Autenticaci\u00f3n via Passport (Bearer token). Todos los endpoints requieren los headers `X-Workspace-ID` y `X-App-ID`."
    },
    "servers": [
        {
            "url": "https://api.conntodo.com/api/v1",
            "description": "Producci\u00f3n"
        },
        {
            "url": "http://127.0.0.1:8000/api/v1",
            "description": "Local"
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "/health": {
            "get": {
                "operationId": "_0",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "ok"
                                                },
                                                "version": {
                                                    "type": "string"
                                                },
                                                "time": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "version",
                                                "time"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/islogged": {
            "get": {
                "operationId": "_0",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "authenticated": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "authenticated"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/users": {
            "get": {
                "operationId": "accountUser.index",
                "tags": [
                    "AccountUser"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/UserResource"
                                                    }
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "current_page": {
                                                            "type": "string"
                                                        },
                                                        "last_page": {
                                                            "type": "string"
                                                        },
                                                        "per_page": {
                                                            "type": "string"
                                                        },
                                                        "total": {
                                                            "type": "string"
                                                        },
                                                        "has_more": {
                                                            "type": "string"
                                                        },
                                                        "from": {
                                                            "type": "string"
                                                        },
                                                        "to": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "current_page",
                                                        "last_page",
                                                        "per_page",
                                                        "total",
                                                        "has_more",
                                                        "from",
                                                        "to"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "meta",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "accountUser.storeUser",
                "tags": [
                    "AccountUser"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreUserRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Usuario creado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "code": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/UserResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/users/roles": {
            "get": {
                "operationId": "accountUser.roles",
                "tags": [
                    "AccountUser"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Rol"
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/users/{id}": {
            "get": {
                "operationId": "accountUser.show",
                "tags": [
                    "AccountUser"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "$ref": "#/components/schemas/UserResource"
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "accountUser.updateUser",
                "tags": [
                    "AccountUser"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateUserRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "$ref": "#/components/schemas/UserResource"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Usuario actualizado"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "accountUser.destroy",
                "tags": [
                    "AccountUser"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Usuario removido del workspace"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/users/{id}/resend": {
            "post": {
                "operationId": "accountUser.resendInvitation",
                "tags": [
                    "AccountUser"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Invitaci\u00f3n reenviada"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/users/{id}/companies": {
            "put": {
                "operationId": "accountUser.syncCompanies",
                "description": "PUT /users/{id}/companies\nBody: { companies: [{company_id, job_title?, department?, is_primary?}] }",
                "summary": "Sincroniza las empresas asociadas a un usuario (reemplaza todas)",
                "tags": [
                    "AccountUser"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "companies": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "company_id": {
                                                    "type": "integer"
                                                },
                                                "job_title": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 255
                                                },
                                                "department": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 255
                                                },
                                                "is_primary": {
                                                    "type": [
                                                        "boolean",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "company_id"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "companies"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "$ref": "#/components/schemas/UserResource"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Empresas actualizadas"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/agenda/sedes": {
            "get": {
                "operationId": "agenda.sedes",
                "summary": "GET /agenda/sedes\nSedes activas del workspace con sus franjas configuradas\n(data source catalog `sedes`)",
                "tags": [
                    "Agenda"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/agenda/availability": {
            "get": {
                "operationId": "agenda.availability",
                "summary": "GET /agenda/availability?sede={key}&date=YYYY-MM-DD\nFranjas de la sede para la fecha, con cupo, reservas y disponibilidad",
                "tags": [
                    "Agenda"
                ],
                "parameters": [
                    {
                        "name": "sede",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Disponibilidad de la sede",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "code": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "sede": {
                                                    "type": "object",
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "label": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "key",
                                                        "label"
                                                    ]
                                                },
                                                "date": {
                                                    "type": "string"
                                                },
                                                "slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "time": {
                                                                "type": "string"
                                                            },
                                                            "capacity": {
                                                                "type": "integer"
                                                            },
                                                            "booked": {
                                                                "type": "integer"
                                                            },
                                                            "available": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "required": [
                                                            "time",
                                                            "capacity",
                                                            "booked",
                                                            "available"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "sede",
                                                "date",
                                                "slots"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/agenda/locks": {
            "get": {
                "operationId": "agenda.locks",
                "summary": "GET /agenda/locks?user_id=\nBloqueos de agenda del workspace (opcionalmente filtrados por evaluador)",
                "tags": [
                    "Agenda"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/AgendaLock"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "agenda.storeLock",
                "summary": "POST /agenda/locks\nCrea un bloqueo. Con permiso agenda.manage puede bloquear a cualquiera;\ncon solo agenda.lock, \u00fanicamente la agenda propia",
                "tags": [
                    "Agenda"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "starts_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "ends_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "starts_at",
                                    "ends_at"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/AgendaLock"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Bloqueo de agenda creado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/agenda/book": {
            "post": {
                "operationId": "agenda.book",
                "summary": "POST /agenda/book\nReserva una franja para un proceso: valida cupo y bloqueo del evaluador,\nescribe start_date (notificando al evaluador si se asigna) y estampa la\nsede en metadata.agenda",
                "tags": [
                    "Agenda"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "process_id": {
                                        "type": "integer"
                                    },
                                    "sede": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "date": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "time": {
                                        "type": "string",
                                        "pattern": "^\\d{2}:\\d{2}$"
                                    },
                                    "assigned_to": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "process_id",
                                    "sede",
                                    "date",
                                    "time"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "process_id": {
                                                    "type": "integer"
                                                },
                                                "start_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "agenda": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "process_id",
                                                "start_date",
                                                "agenda"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Cita reservada correctamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/agenda/locks/{id}": {
            "delete": {
                "operationId": "agenda.destroyLock",
                "summary": "DELETE /agenda/locks/{id}\nElimina un bloqueo (propio, o de cualquiera con agenda.manage)",
                "tags": [
                    "Agenda"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Bloqueo eliminado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/validate": {
            "post": {
                "operationId": "auth.validateAccount",
                "summary": "Validaci\u00f3n de cuenta: devuelve workspaces disponibles para el usuario",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "500": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 500
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Error interno del servidor"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "requires_workspace_selection": {
                                                            "type": "boolean"
                                                        },
                                                        "workspaces": {
                                                            "type": "array",
                                                            "items": {}
                                                        },
                                                        "default_workspace": {
                                                            "type": "string"
                                                        },
                                                        "user_capabilities": {
                                                            "type": "object",
                                                            "properties": {
                                                                "can_own_workspaces": {
                                                                    "type": "boolean"
                                                                },
                                                                "can_be_member": {
                                                                    "type": "boolean"
                                                                }
                                                            },
                                                            "required": [
                                                                "can_own_workspaces",
                                                                "can_be_member"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "email",
                                                        "name",
                                                        "requires_workspace_selection",
                                                        "workspaces",
                                                        "default_workspace",
                                                        "user_capabilities"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "data"
                                            ]
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "no_workspaces"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No tienes acceso a ning\u00fan workspace activo"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "email": {
                                                    "type": "string"
                                                },
                                                "user_name": {
                                                    "type": "string"
                                                },
                                                "user_type": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "email",
                                                "user_name",
                                                "user_type"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/login": {
            "post": {
                "operationId": "auth.login",
                "summary": "Login principal con soporte de bloqueo por intentos fallidos y auditor\u00eda",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LoginRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "500": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Error interno del servidor"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "token": {
                                                    "type": "string"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "first_name": {
                                                            "type": "string"
                                                        },
                                                        "last_name": {
                                                            "type": "string"
                                                        },
                                                        "roles": {
                                                            "type": "string"
                                                        },
                                                        "account_type": {
                                                            "type": "string"
                                                        },
                                                        "user_type": {},
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "permissions": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "minItems": 0,
                                                                    "maxItems": 0,
                                                                    "additionalItems": false
                                                                },
                                                                {
                                                                    "type": "string"
                                                                }
                                                            ]
                                                        },
                                                        "avatar": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "workspace": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "logo": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "layout": {
                                                                    "type": "string"
                                                                },
                                                                "country_id": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "integer"
                                                                        }
                                                                    ]
                                                                },
                                                                "timezone": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "name",
                                                                "logo",
                                                                "layout",
                                                                "country_id",
                                                                "timezone"
                                                            ]
                                                        },
                                                        "applications": {
                                                            "type": "string"
                                                        },
                                                        "profile_id": {
                                                            "type": "string"
                                                        },
                                                        "job_title": {
                                                            "type": "string"
                                                        },
                                                        "company_id": {
                                                            "type": "string"
                                                        },
                                                        "active_company": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "null"
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name"
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "workspace_config": {
                                                            "type": [
                                                                "object",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "email",
                                                        "first_name",
                                                        "last_name",
                                                        "roles",
                                                        "account_type",
                                                        "user_type",
                                                        "is_admin",
                                                        "permissions",
                                                        "avatar",
                                                        "workspace",
                                                        "applications",
                                                        "profile_id",
                                                        "job_title",
                                                        "company_id",
                                                        "active_company",
                                                        "workspace_config"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "token",
                                                "user"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No tiene acceso a este workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Credenciales inv\u00e1lidas"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "account_locked"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Cuenta bloqueada temporalmente por m\u00faltiples intentos fallidos. Intente de nuevo en 15 minutos."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/token/refresh": {
            "post": {
                "operationId": "auth.refreshToken",
                "summary": "Renueva el token activo: emite un PAT nuevo y revoca el actual.\nEl cliente debe reemplazar su cookie/almac\u00e9n con el token devuelto",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "token": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "token"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Token renovado"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/me": {
            "get": {
                "operationId": "auth.me",
                "summary": "Retorna los datos del usuario autenticado en el contexto del workspace activo.\nEquivalente a la respuesta de login pero sin emitir token",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "500": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Error interno del servidor"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "first_name": {
                                                            "type": "string"
                                                        },
                                                        "last_name": {
                                                            "type": "string"
                                                        },
                                                        "roles": {
                                                            "type": "string"
                                                        },
                                                        "account_type": {
                                                            "type": "string"
                                                        },
                                                        "user_type": {},
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "permissions": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "minItems": 0,
                                                                    "maxItems": 0,
                                                                    "additionalItems": false
                                                                },
                                                                {
                                                                    "type": "string"
                                                                }
                                                            ]
                                                        },
                                                        "avatar": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "workspace": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "logo": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "layout": {
                                                                    "type": "string"
                                                                },
                                                                "country_id": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "integer"
                                                                        }
                                                                    ]
                                                                },
                                                                "timezone": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "name",
                                                                "logo",
                                                                "layout",
                                                                "country_id",
                                                                "timezone"
                                                            ]
                                                        },
                                                        "applications": {
                                                            "type": "string"
                                                        },
                                                        "profile_id": {
                                                            "type": "string"
                                                        },
                                                        "job_title": {
                                                            "type": "string"
                                                        },
                                                        "company_id": {
                                                            "type": "string"
                                                        },
                                                        "active_company": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "null"
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name"
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "workspace_config": {
                                                            "type": [
                                                                "object",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "email",
                                                        "first_name",
                                                        "last_name",
                                                        "roles",
                                                        "account_type",
                                                        "user_type",
                                                        "is_admin",
                                                        "permissions",
                                                        "avatar",
                                                        "workspace",
                                                        "applications",
                                                        "profile_id",
                                                        "job_title",
                                                        "company_id",
                                                        "active_company",
                                                        "workspace_config"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Perfil no encontrado para este workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/logout": {
            "post": {
                "operationId": "auth.logout",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "200": {
                        "description": "Sesi\u00f3n cerrada; token revocado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/billing/summary": {
            "get": {
                "operationId": "billing.summary",
                "summary": "GET /billing/summary",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "plan": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ]
                                                },
                                                "subscriptions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "application_id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "expires_at": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "application_id",
                                                            "name",
                                                            "status",
                                                            "expires_at"
                                                        ]
                                                    }
                                                },
                                                "addons": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "slug": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "icon": {},
                                                            "pricing": {},
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "slug",
                                                            "name",
                                                            "icon",
                                                            "pricing",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "pending_intents": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/PaymentIntent"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "plan",
                                                "subscriptions",
                                                "addons",
                                                "pending_intents"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/billing/transactions": {
            "get": {
                "operationId": "billing.transactions",
                "summary": "GET /billing/transactions \u2014 historial de pagos del workspace",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/calidad/config": {
            "get": {
                "operationId": "calidad.config",
                "summary": "GET /calidad/config\nChecklist del workspace, opciones de resultado y cat\u00e1logos de hallazgos",
                "tags": [
                    "Calidad"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "checklist": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "results": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "findings": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "checklist",
                                                "results",
                                                "findings"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/calidad/pending": {
            "get": {
                "operationId": "calidad.pending",
                "summary": "GET /calidad/pending\nProcesos atendidos/en curso sin revisi\u00f3n de calidad (cola de QA)",
                "tags": [
                    "Calidad"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/calidad/reviews": {
            "get": {
                "operationId": "calidad.reviews",
                "summary": "GET /calidad/reviews\nRevisiones existentes del workspace, m\u00e1s recientes primero",
                "tags": [
                    "Calidad"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "calidad.store",
                "summary": "POST /calidad/reviews\nCrea o actualiza la revisi\u00f3n del proceso. Con `result_key` finaliza el\nproceso y notifica el resultado; correcciones nuevas notifican al\nevaluador asignado",
                "tags": [
                    "Calidad"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "process_id": {
                                        "type": "integer"
                                    },
                                    "result_key": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "observations": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "corrections": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "checks": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "maxLength": 100
                                                },
                                                "passed": {
                                                    "type": [
                                                        "boolean",
                                                        "null"
                                                    ]
                                                },
                                                "findings": {
                                                    "type": [
                                                        "array",
                                                        "null"
                                                    ],
                                                    "items": {
                                                        "type": "string",
                                                        "maxLength": 255
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "process_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ProcessReview"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Revisi\u00f3n de calidad guardada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/calidad/process/{processId}": {
            "get": {
                "operationId": "calidad.showForProcess",
                "summary": "GET /calidad/process/{processId}\nRevisi\u00f3n del proceso (o data null si a\u00fan no tiene)",
                "tags": [
                    "Calidad"
                ],
                "parameters": [
                    {
                        "name": "processId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "anyOf": [
                                                {
                                                    "$ref": "#/components/schemas/ProcessReview"
                                                },
                                                {
                                                    "type": "null"
                                                }
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/calidad/reviews/{id}/resend": {
            "post": {
                "operationId": "calidad.resend",
                "summary": "POST /calidad/reviews/{id}/resend\nReenv\u00eda la notificaci\u00f3n de resultado al destinatario",
                "tags": [
                    "Calidad"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ProcessReview"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Resultado reenviado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/summit/chat": {
            "post": {
                "operationId": "chat.chat",
                "tags": [
                    "Chat"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "message": {
                                        "type": "string",
                                        "maxLength": 500
                                    },
                                    "session_key": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "message"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "response": {
                                            "type": "string"
                                        },
                                        "session_key": {
                                            "type": "string"
                                        },
                                        "messages_remaining": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "success",
                                        "response",
                                        "session_key",
                                        "messages_remaining"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/clients": {
            "get": {
                "operationId": "client.index",
                "summary": "Lista paginada de empresas cliente del workspace",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": ""
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "client.store",
                "summary": "Crear empresa cliente en el workspace",
                "tags": [
                    "Client"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "legal_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "dba": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "nit": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 100
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "web": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "city": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "tariff": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "billing_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "billing_email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 100
                                    },
                                    "billing_address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 150
                                    },
                                    "users": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "first_name": {
                                                    "type": "string",
                                                    "maxLength": 100
                                                },
                                                "last_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 100
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "format": "email",
                                                    "maxLength": 100
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 50
                                                }
                                            }
                                        },
                                        "maxItems": 10
                                    }
                                },
                                "required": [
                                    "legal_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa cliente creada correctamente."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "legal_name": {
                                                    "type": "string"
                                                },
                                                "dba": {
                                                    "type": "string"
                                                },
                                                "nit": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "web": {
                                                    "type": "string"
                                                },
                                                "city": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "logo_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "tariff": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_address": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "legal_name",
                                                "dba",
                                                "nit",
                                                "email",
                                                "phone",
                                                "address",
                                                "web",
                                                "city",
                                                "logo_url",
                                                "tariff",
                                                "billing_name",
                                                "billing_email",
                                                "billing_address",
                                                "created_at"
                                            ]
                                        },
                                        "warnings": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data",
                                        "warnings"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/clients/list": {
            "get": {
                "operationId": "client.list",
                "summary": "Lista simple de clientes para selects (id + nombre)",
                "tags": [
                    "Client"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/clients/{id}": {
            "get": {
                "operationId": "client.show",
                "summary": "Detalle de una empresa cliente",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "legal_name": {
                                                    "type": "string"
                                                },
                                                "dba": {
                                                    "type": "string"
                                                },
                                                "nit": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "web": {
                                                    "type": "string"
                                                },
                                                "city": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "logo_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "tariff": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_address": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "legal_name",
                                                "dba",
                                                "nit",
                                                "email",
                                                "phone",
                                                "address",
                                                "web",
                                                "city",
                                                "logo_url",
                                                "tariff",
                                                "billing_name",
                                                "billing_email",
                                                "billing_address",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "client.update",
                "summary": "Actualizar empresa cliente",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "legal_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "dba": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "nit": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 100
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "web": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "city": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "tariff": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "billing_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "billing_email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 100
                                    },
                                    "billing_address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 150
                                    }
                                },
                                "required": [
                                    "legal_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa actualizada correctamente."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "legal_name": {
                                                    "type": "string"
                                                },
                                                "dba": {
                                                    "type": "string"
                                                },
                                                "nit": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "web": {
                                                    "type": "string"
                                                },
                                                "city": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "logo_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "tariff": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "billing_address": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "legal_name",
                                                "dba",
                                                "nit",
                                                "email",
                                                "phone",
                                                "address",
                                                "web",
                                                "city",
                                                "logo_url",
                                                "tariff",
                                                "billing_name",
                                                "billing_email",
                                                "billing_address",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "client.destroy",
                "summary": "Eliminar (soft delete) empresa cliente",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Empresa eliminada",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/clients/{id}/logo": {
            "post": {
                "operationId": "client.uploadLogo",
                "summary": "Sube o reemplaza el logo de la empresa cliente.\nAcceso: administrador con clients.edit O usuario cliente perteneciente a la empresa",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application/octet-stream",
                                        "maxLength": 2048
                                    }
                                },
                                "required": [
                                    "logo"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Logo actualizado correctamente."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "logo_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "logo_url"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No autorizado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/clients/{id}/users": {
            "get": {
                "operationId": "client.getUsers",
                "summary": "Lista usuarios vinculados a una empresa cliente (profile.company_id)",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "client.addUser",
                "summary": "Crea un usuario y lo vincula a la empresa cliente",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "last_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "maxLength": 100
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    }
                                },
                                "required": [
                                    "first_name",
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "Usuario cliente creado y vinculado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/clients/{id}/users/{userId}": {
            "delete": {
                "operationId": "client.removeUser",
                "summary": "Desvincula (soft-remove) un usuario de la empresa y del workspace",
                "tags": [
                    "Client"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "userId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Usuario desvinculado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "El usuario no pertenece a esta empresa."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Empresa no encontrada."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/clients/{id}/service-prices": {
            "get": {
                "operationId": "clientPrice.servicePrices",
                "summary": "Devuelve los servicios activos del workspace con el precio base\ny el precio espec\u00edfico del cliente (si existe)",
                "tags": [
                    "ClientPrice"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "data_source_id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "base_price": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "base_currency": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "string",
                                                                "enum": [
                                                                    "COP"
                                                                ]
                                                            }
                                                        ]
                                                    },
                                                    "price": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "currency": {},
                                                    "has_override": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "data_source_id",
                                                    "name",
                                                    "key",
                                                    "base_price",
                                                    "base_currency",
                                                    "price",
                                                    "currency",
                                                    "has_override"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Cliente no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "clientPrice.syncServicePrices",
                "summary": "Sincroniza los precios por servicio de un cliente.\nRecibe: [{ data_source_id, price, currency }]\nRows con price === null se eliminan (vuelve al precio base)",
                "tags": [
                    "ClientPrice"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "prices": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "data_source_id": {
                                                    "type": "integer"
                                                },
                                                "price": {
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ],
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "data_source_id"
                                            ]
                                        }
                                    }
                                },
                                "required": [
                                    "prices"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Precios actualizados."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Cliente no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/data-sources/for-role/{roleId}": {
            "get": {
                "operationId": "dataSource.forRole",
                "description": "Regla: restricted_role_ids vac\u00edo = accesible para todos.\nNo requiere permiso services.manage \u2014 lo consultan los m\u00f3dulos operativos.",
                "summary": "GET /admin/data-sources/for-role/{roleId}\nServicios activos accesibles para un rol concreto del workspace",
                "tags": [
                    "DataSource"
                ],
                "parameters": [
                    {
                        "name": "roleId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "template_id": {
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ]
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "category": {
                                                        "type": "string"
                                                    },
                                                    "values": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "config": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "requires_scheduling": {
                                                        "type": "boolean"
                                                    },
                                                    "restricted_role_ids": {},
                                                    "price": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "currency": {},
                                                    "is_active": {
                                                        "type": "boolean"
                                                    },
                                                    "is_custom": {
                                                        "type": "boolean"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "template_id",
                                                    "name",
                                                    "key",
                                                    "description",
                                                    "category",
                                                    "values",
                                                    "config",
                                                    "requires_scheduling",
                                                    "restricted_role_ids",
                                                    "price",
                                                    "currency",
                                                    "is_active",
                                                    "is_custom",
                                                    "created_at"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/data-sources/my-services": {
            "get": {
                "operationId": "dataSource.myServices",
                "description": "Regla: restricted_role_ids vac\u00edo = accesible para todos.\nUn servicio aparece si NINGUNO de los roles del usuario est\u00e1 en la lista de exclusi\u00f3n.",
                "summary": "GET /admin/data-sources/my-services\nServicios activos accesibles para el usuario autenticado, considerando todos\nsus roles en el workspace. Usado por m\u00f3dulos operativos (procesos, etc.)\npara poblar dropdowns de servicio al crear registros",
                "tags": [
                    "DataSource"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "template_id": {
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ]
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "category": {
                                                        "type": "string"
                                                    },
                                                    "values": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "config": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "requires_scheduling": {
                                                        "type": "boolean"
                                                    },
                                                    "restricted_role_ids": {},
                                                    "price": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "currency": {},
                                                    "is_active": {
                                                        "type": "boolean"
                                                    },
                                                    "is_custom": {
                                                        "type": "boolean"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "template_id",
                                                    "name",
                                                    "key",
                                                    "description",
                                                    "category",
                                                    "values",
                                                    "config",
                                                    "requires_scheduling",
                                                    "restricted_role_ids",
                                                    "price",
                                                    "currency",
                                                    "is_active",
                                                    "is_custom",
                                                    "created_at"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/data-sources": {
            "get": {
                "operationId": "dataSource.index",
                "summary": "GET /admin/data-sources\nTodos los or\u00edgenes del workspace agrupados por categor\u00eda",
                "tags": [
                    "DataSource"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "service": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "template_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "category": {
                                                                "type": "string"
                                                            },
                                                            "values": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "config": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "requires_scheduling": {
                                                                "type": "boolean"
                                                            },
                                                            "restricted_role_ids": {},
                                                            "price": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "currency": {},
                                                            "is_active": {
                                                                "type": "boolean"
                                                            },
                                                            "is_custom": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "template_id",
                                                            "name",
                                                            "key",
                                                            "description",
                                                            "category",
                                                            "values",
                                                            "config",
                                                            "requires_scheduling",
                                                            "restricted_role_ids",
                                                            "price",
                                                            "currency",
                                                            "is_active",
                                                            "is_custom",
                                                            "created_at"
                                                        ]
                                                    }
                                                },
                                                "catalog": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "template_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "category": {
                                                                "type": "string"
                                                            },
                                                            "values": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "config": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "requires_scheduling": {
                                                                "type": "boolean"
                                                            },
                                                            "restricted_role_ids": {},
                                                            "price": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "currency": {},
                                                            "is_active": {
                                                                "type": "boolean"
                                                            },
                                                            "is_custom": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "template_id",
                                                            "name",
                                                            "key",
                                                            "description",
                                                            "category",
                                                            "values",
                                                            "config",
                                                            "requires_scheduling",
                                                            "restricted_role_ids",
                                                            "price",
                                                            "currency",
                                                            "is_active",
                                                            "is_custom",
                                                            "created_at"
                                                        ]
                                                    }
                                                },
                                                "parameter": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "template_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "category": {
                                                                "type": "string"
                                                            },
                                                            "values": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "config": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "requires_scheduling": {
                                                                "type": "boolean"
                                                            },
                                                            "restricted_role_ids": {},
                                                            "price": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "currency": {},
                                                            "is_active": {
                                                                "type": "boolean"
                                                            },
                                                            "is_custom": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "template_id",
                                                            "name",
                                                            "key",
                                                            "description",
                                                            "category",
                                                            "values",
                                                            "config",
                                                            "requires_scheduling",
                                                            "restricted_role_ids",
                                                            "price",
                                                            "currency",
                                                            "is_active",
                                                            "is_custom",
                                                            "created_at"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "service",
                                                "catalog",
                                                "parameter"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "dataSource.store",
                "summary": "POST /admin/data-sources\nCrea un origen custom",
                "tags": [
                    "DataSource"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "category": {
                                        "type": "string",
                                        "enum": [
                                            "service",
                                            "catalog",
                                            "parameter"
                                        ]
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "config": {
                                        "type": "object",
                                        "properties": {
                                            "requires_scheduling": {
                                                "type": "boolean"
                                            },
                                            "restricted_role_ids": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                }
                                            },
                                            "price": {
                                                "type": [
                                                    "number",
                                                    "null"
                                                ],
                                                "minimum": 0
                                            },
                                            "currency": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "minLength": 3,
                                                "maxLength": 3
                                            }
                                        }
                                    },
                                    "values": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "maxLength": 100
                                                },
                                                "label": {
                                                    "type": "string",
                                                    "maxLength": 100
                                                },
                                                "color": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 30
                                                },
                                                "icon": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 60
                                                },
                                                "sort_order": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 0
                                                },
                                                "is_active": {
                                                    "type": [
                                                        "boolean",
                                                        "null"
                                                    ]
                                                },
                                                "metadata": {
                                                    "type": [
                                                        "array",
                                                        "null"
                                                    ],
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "name",
                                    "category"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "template_id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "config": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "requires_scheduling": {
                                                    "type": "boolean"
                                                },
                                                "restricted_role_ids": {},
                                                "price": {
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ]
                                                },
                                                "currency": {},
                                                "is_active": {
                                                    "type": "boolean"
                                                },
                                                "is_custom": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "template_id",
                                                "name",
                                                "key",
                                                "description",
                                                "category",
                                                "values",
                                                "config",
                                                "requires_scheduling",
                                                "restricted_role_ids",
                                                "price",
                                                "currency",
                                                "is_active",
                                                "is_custom",
                                                "created_at"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Origen de datos creado correctamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/data-sources/templates": {
            "get": {
                "operationId": "dataSource.templates",
                "summary": "GET /admin/data-sources/templates\nTemplates del sistema disponibles para adoptar (con flag adopted)",
                "tags": [
                    "DataSource"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "key": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "category": {
                                                        "type": "string"
                                                    },
                                                    "default_values": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "is_system": {
                                                        "type": "boolean"
                                                    },
                                                    "version": {
                                                        "type": "integer"
                                                    },
                                                    "adopted": {
                                                        "type": "string"
                                                    },
                                                    "is_pending": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "key",
                                                    "name",
                                                    "description",
                                                    "category",
                                                    "default_values",
                                                    "is_system",
                                                    "version",
                                                    "adopted",
                                                    "is_pending"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/data-sources/adopt": {
            "post": {
                "operationId": "dataSource.adopt",
                "summary": "POST /admin/data-sources/adopt\nAdopta un template del sistema (hereda requires_scheduling y vac\u00eda restricted_role_ids)",
                "tags": [
                    "DataSource"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "template_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "template_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "template_id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "config": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "requires_scheduling": {
                                                    "type": "boolean"
                                                },
                                                "restricted_role_ids": {},
                                                "price": {
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ]
                                                },
                                                "currency": {},
                                                "is_active": {
                                                    "type": "boolean"
                                                },
                                                "is_custom": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "template_id",
                                                "name",
                                                "key",
                                                "description",
                                                "category",
                                                "values",
                                                "config",
                                                "requires_scheduling",
                                                "restricted_role_ids",
                                                "price",
                                                "currency",
                                                "is_active",
                                                "is_custom",
                                                "created_at"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Template adoptado correctamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/data-sources/{id}": {
            "put": {
                "operationId": "dataSource.update",
                "summary": "PUT /admin/data-sources/{id}\nActualiza nombre, descripci\u00f3n, values, config o is_active.\nconfig puede incluir requires_scheduling y restricted_role_ids",
                "tags": [
                    "DataSource"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "is_active": {
                                        "type": "boolean"
                                    },
                                    "config": {
                                        "type": "object",
                                        "properties": {
                                            "requires_scheduling": {
                                                "type": "boolean"
                                            },
                                            "restricted_role_ids": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                }
                                            },
                                            "price": {
                                                "type": [
                                                    "number",
                                                    "null"
                                                ],
                                                "minimum": 0
                                            },
                                            "currency": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "minLength": 3,
                                                "maxLength": 3
                                            }
                                        }
                                    },
                                    "values": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "maxLength": 100
                                                },
                                                "label": {
                                                    "type": "string",
                                                    "maxLength": 100
                                                },
                                                "color": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 30
                                                },
                                                "icon": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 60
                                                },
                                                "sort_order": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 0
                                                },
                                                "is_active": {
                                                    "type": [
                                                        "boolean",
                                                        "null"
                                                    ]
                                                },
                                                "metadata": {
                                                    "type": [
                                                        "array",
                                                        "null"
                                                    ],
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "template_id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "config": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "requires_scheduling": {
                                                    "type": "boolean"
                                                },
                                                "restricted_role_ids": {},
                                                "price": {
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ]
                                                },
                                                "currency": {},
                                                "is_active": {
                                                    "type": "boolean"
                                                },
                                                "is_custom": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "warning": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "template_id",
                                                "name",
                                                "key",
                                                "description",
                                                "category",
                                                "values",
                                                "config",
                                                "requires_scheduling",
                                                "restricted_role_ids",
                                                "price",
                                                "currency",
                                                "is_active",
                                                "is_custom",
                                                "created_at",
                                                "warning"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Origen de datos actualizado correctamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "dataSource.destroy",
                "summary": "DELETE /admin/data-sources/{id}",
                "tags": [
                    "DataSource"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Origen de datos eliminado."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/data-sources/{id}/propose": {
            "post": {
                "operationId": "dataSource.propose",
                "summary": "POST /admin/data-sources/{id}/propose\nPropone un origen custom como template global (pendiente de aprobaci\u00f3n)",
                "tags": [
                    "DataSource"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "template_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "template_id",
                                                "status"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Propuesta enviada. Un administrador revisar\u00e1 y aprobar\u00e1 el template."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/service-links": {
            "get": {
                "operationId": "dataSourceForm.index",
                "summary": "Lista los v\u00ednculos activos del workspace.\nIncluye nombre del servicio y del template para el frontend",
                "tags": [
                    "DataSourceForm"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "workspace_data_source_id": {
                                                        "type": "integer"
                                                    },
                                                    "data_source_id": {
                                                        "type": "integer"
                                                    },
                                                    "data_source_name": {
                                                        "type": "string"
                                                    },
                                                    "form_template_id": {
                                                        "type": "integer"
                                                    },
                                                    "form_template_name": {
                                                        "type": "string"
                                                    },
                                                    "fill_timing": {
                                                        "type": "string"
                                                    },
                                                    "is_required": {
                                                        "type": "boolean"
                                                    },
                                                    "notes": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "workspace_data_source_id",
                                                    "data_source_id",
                                                    "data_source_name",
                                                    "form_template_id",
                                                    "form_template_name",
                                                    "fill_timing",
                                                    "is_required",
                                                    "notes"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "dataSourceForm.store",
                "summary": "Crea un v\u00ednculo servicio \u2194 template",
                "tags": [
                    "DataSourceForm"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "workspace_data_source_id": {
                                        "type": "integer"
                                    },
                                    "form_template_id": {
                                        "type": "integer"
                                    },
                                    "fill_timing": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "before",
                                            "during",
                                            "after"
                                        ]
                                    },
                                    "is_required": {
                                        "type": [
                                            "boolean",
                                            "null"
                                        ]
                                    },
                                    "notes": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "workspace_data_source_id",
                                    "form_template_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "data_source_name": {
                                                    "type": "string"
                                                },
                                                "form_template_name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "data_source_name",
                                                "form_template_name"
                                            ]
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 201
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/service-links/{id}": {
            "delete": {
                "operationId": "dataSourceForm.destroy",
                "summary": "Elimina un v\u00ednculo",
                "tags": [
                    "DataSourceForm"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "V\u00ednculo eliminado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/data-source-templates": {
            "get": {
                "operationId": "dataSourceTemplateModeration.index",
                "summary": "GET /api/superadmin/data-source-templates\nLista templates pendientes (o por status)",
                "tags": [
                    "DataSourceTemplateModeration"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": "pending"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "category": {
                                                                "type": "string"
                                                            },
                                                            "industries": {
                                                                "type": [
                                                                    "array",
                                                                    "null"
                                                                ],
                                                                "items": {}
                                                            },
                                                            "default_values": {
                                                                "type": [
                                                                    "array",
                                                                    "null"
                                                                ],
                                                                "items": {}
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "proposed_by_workspace_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "key",
                                                            "name",
                                                            "category",
                                                            "industries",
                                                            "default_values",
                                                            "status",
                                                            "proposed_by_workspace_id",
                                                            "created_at"
                                                        ]
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/data-source-templates/{id}/approve": {
            "patch": {
                "operationId": "dataSourceTemplateModeration.approve",
                "summary": "PATCH /api/superadmin/data-source-templates/{id}/approve\nAprueba el template: lo marca como sistema y lo activa para todos los workspaces",
                "tags": [
                    "DataSourceTemplateModeration"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "status"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Template no encontrado o no est\u00e1 pendiente."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/data-source-templates/{id}/reject": {
            "patch": {
                "operationId": "dataSourceTemplateModeration.reject",
                "summary": "PATCH /api/superadmin/data-source-templates/{id}/reject\nRechaza el template: queda inactivo, solo visible para el workspace proponente",
                "tags": [
                    "DataSourceTemplateModeration"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "status"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Template no encontrado o no est\u00e1 pendiente."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forgot": {
            "post": {
                "operationId": "forgot.forgot",
                "tags": [
                    "Forgot"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "500": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Error interno del servidor"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Token de reestablecimiento creado y correo enviado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "code": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/UserResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/reset": {
            "post": {
                "operationId": "forgot.resetPassword",
                "tags": [
                    "Forgot"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ForgotRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "500": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Error interno del servidor"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Contrase\u00f1a actualizada",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/verify": {
            "post": {
                "operationId": "forgot.verify",
                "tags": [
                    "Forgot"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "encodedData": {
                                        "type": "string"
                                    },
                                    "providedToken": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "500": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Error interno del servidor"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Token de reset v\u00e1lido",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/forms/{templateId}/sections/{sectionId}/fields": {
            "post": {
                "operationId": "formField.store",
                "tags": [
                    "FormField"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreFormFieldRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormFieldResource"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 201
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections/{sectionId}/fields/{fieldId}": {
            "put": {
                "operationId": "formField.update",
                "tags": [
                    "FormField"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "fieldId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormFieldResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "formField.destroy",
                "tags": [
                    "FormField"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "fieldId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 204
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections/{sectionId}/fields/reorder": {
            "post": {
                "operationId": "formField.reorder",
                "tags": [
                    "FormField"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "ids"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections/{sectionId}/fields/{fieldId}/move": {
            "patch": {
                "operationId": "formField.move",
                "tags": [
                    "FormField"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "fieldId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "target_group_id": {
                                        "type": "integer"
                                    },
                                    "position": {
                                        "type": "integer",
                                        "minimum": 0
                                    }
                                },
                                "required": [
                                    "target_group_id",
                                    "position"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormFieldResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/field-sources": {
            "get": {
                "operationId": "formFieldSource.index",
                "summary": "GET /forms/field-sources\nDevuelve cat\u00e1logos y par\u00e1metros del workspace formateados como opciones\npara campos select/radio/multiselect del formulario",
                "tags": [
                    "FormFieldSource"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "category": {
                                                        "type": "string"
                                                    },
                                                    "options": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "string",
                                                                            "enum": [
                                                                                ""
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                "label": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "string",
                                                                            "enum": [
                                                                                ""
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "value",
                                                                "label"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "required": [
                                                    "key",
                                                    "name",
                                                    "category",
                                                    "options"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections/{sectionId}/groups": {
            "post": {
                "operationId": "formGroup.store",
                "tags": [
                    "FormGroup"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "label": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "layout": {
                                        "type": "string",
                                        "enum": [
                                            "1col",
                                            "2col",
                                            "3col",
                                            "auto"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormGroupResource"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 201
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections/{sectionId}/groups/{groupId}": {
            "patch": {
                "operationId": "formGroup.update",
                "tags": [
                    "FormGroup"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "groupId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "layout": {
                                        "type": "string",
                                        "enum": [
                                            "1col",
                                            "2col",
                                            "3col",
                                            "auto"
                                        ]
                                    },
                                    "label": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "is_repeatable": {
                                        "type": "boolean"
                                    },
                                    "visibility_rules": {
                                        "type": "object",
                                        "properties": {
                                            "conjunction": {
                                                "type": "string",
                                                "enum": [
                                                    "and",
                                                    "or"
                                                ]
                                            },
                                            "rules": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "layout": {
                                                    "type": "string"
                                                },
                                                "label": {
                                                    "type": "string"
                                                },
                                                "is_repeatable": {
                                                    "type": "boolean"
                                                },
                                                "visibility_rules": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "layout",
                                                "label",
                                                "is_repeatable",
                                                "visibility_rules"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "formGroup.destroy",
                "tags": [
                    "FormGroup"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "groupId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 204
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/submissions/{submissionId}/report": {
            "post": {
                "operationId": "formReport.generate",
                "summary": "Genera el informe PDF de una submission revisada",
                "tags": [
                    "FormReport"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "report_id": {
                                                    "type": "integer"
                                                },
                                                "report_url": {
                                                    "type": "string"
                                                },
                                                "file_path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "generated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "report_id",
                                                "report_url",
                                                "file_path",
                                                "generated_at"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "formReport.destroy",
                "summary": "Elimina el informe de una submission (genera uno nuevo si se vuelve a solicitar)",
                "tags": [
                    "FormReport"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 204
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "get": {
                "operationId": "formReport.show",
                "summary": "Retorna el informe existente de una submission, si existe",
                "tags": [
                    "FormReport"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "report_id": {
                                                    "type": "integer"
                                                },
                                                "report_url": {
                                                    "type": "string"
                                                },
                                                "generated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "report_id",
                                                "report_url",
                                                "generated_at"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No existe un informe para esta submission."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections": {
            "post": {
                "operationId": "formSection.store",
                "tags": [
                    "FormSection"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "settings": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormSectionResource"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 201
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections/{sectionId}": {
            "put": {
                "operationId": "formSection.update",
                "tags": [
                    "FormSection"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "settings": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormSectionResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "formSection.destroy",
                "tags": [
                    "FormSection"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sectionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 204
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{templateId}/sections/reorder": {
            "post": {
                "operationId": "formSection.reorder",
                "tags": [
                    "FormSection"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "ids"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/submissions": {
            "get": {
                "operationId": "formSubmission.index",
                "tags": [
                    "FormSubmission"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/FormSubmissionResource"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "formSubmission.store",
                "tags": [
                    "FormSubmission"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreFormSubmissionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormSubmissionResource"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 201
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Template no encontrado o inactivo."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/forms/{templateId}/export": {
            "get": {
                "operationId": "formSubmission.export",
                "tags": [
                    "FormSubmission"
                ],
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Archivo XLSX con las respuestas del formulario",
                        "content": {
                            "text/csv; charset=UTF-8": {
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        },
                        "headers": {
                            "Transfer-Encoding": {
                                "required": true,
                                "schema": {
                                    "type": "string",
                                    "enum": [
                                        "chunked"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/submissions/mine": {
            "get": {
                "operationId": "formSubmission.mine",
                "summary": "GET /forms/submissions/mine\nSubmissions del evaluador autenticado en el workspace",
                "tags": [
                    "FormSubmission"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/FormSubmissionResource"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/submissions/{submissionId}": {
            "get": {
                "operationId": "formSubmission.show",
                "tags": [
                    "FormSubmission"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormSubmissionResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "formSubmission.destroy",
                "summary": "DELETE /forms/submissions/{submissionId}\nBorrado l\u00f3gico (soft delete) de un AP. Solo administradores\n(gated por can:forms.delete_submissions a nivel de ruta)",
                "tags": [
                    "FormSubmission"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "soft delete \u2014 conserva informes y trazabilidad",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 204
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/submissions/{submissionId}/section": {
            "patch": {
                "operationId": "formSubmission.saveSection",
                "tags": [
                    "FormSubmission"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "section_id": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1
                                    },
                                    "duration_seconds": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0
                                    }
                                },
                                "required": [
                                    "section_id",
                                    "data"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormSubmissionResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/submissions/{submissionId}/complete": {
            "patch": {
                "operationId": "formSubmission.complete",
                "tags": [
                    "FormSubmission"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormSubmissionResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/submissions/{submissionId}/review": {
            "patch": {
                "operationId": "formSubmission.review",
                "tags": [
                    "FormSubmission"
                ],
                "parameters": [
                    {
                        "name": "submissionId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reviewer_notes": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormSubmissionResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms": {
            "get": {
                "operationId": "formTemplate.index",
                "tags": [
                    "FormTemplate"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/FormTemplateResource"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "formTemplate.store",
                "tags": [
                    "FormTemplate"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreFormTemplateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormTemplateResource"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 201
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/forms/{id}": {
            "get": {
                "operationId": "formTemplate.show",
                "tags": [
                    "FormTemplate"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormTemplateResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "formTemplate.update",
                "tags": [
                    "FormTemplate"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormTemplateResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "formTemplate.destroy",
                "tags": [
                    "FormTemplate"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 204
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{id}/duplicate": {
            "post": {
                "operationId": "formTemplate.duplicate",
                "tags": [
                    "FormTemplate"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormTemplateResource"
                                        },
                                        "message": {
                                            "type": "integer",
                                            "const": 201
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{id}/publish": {
            "post": {
                "operationId": "formTemplate.publish",
                "tags": [
                    "FormTemplate"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormTemplateResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/forms/{id}/archive": {
            "post": {
                "operationId": "formTemplate.archive",
                "tags": [
                    "FormTemplate"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FormTemplateResource"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/public/leads": {
            "post": {
                "operationId": "lead.publicStore",
                "summary": "Captura p\u00fablica de un lead (formulario de recursos/contacto/landing)",
                "tags": [
                    "Lead"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "source": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "maxLength": 255
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 32
                                    },
                                    "message": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "metadata": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 201
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": [
                                                        "id"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Gracias por tu inter\u00e9s."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 201
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Gracias por tu inter\u00e9s."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 400
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "X-App-ID requerido"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/leads": {
            "get": {
                "operationId": "lead.index",
                "summary": "Lista paginada de leads del workspace",
                "tags": [
                    "Lead"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/leads/{id}": {
            "get": {
                "operationId": "lead.show",
                "tags": [
                    "Lead"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Lead no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "lead.update",
                "tags": [
                    "Lead"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "new",
                                            "contacted",
                                            "qualified",
                                            "archived"
                                        ]
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 32
                                    },
                                    "message": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Lead actualizado"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Lead no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "lead.destroy",
                "tags": [
                    "Lead"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Lead eliminado"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Lead no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/locations/cities": {
            "get": {
                "operationId": "location.searchCities",
                "description": "GET /locations/cities?search=bogot",
                "summary": "B\u00fasqueda de ciudades por nombre parcial dentro del pa\u00eds del workspace.\nRetorna ciudad + nombre del departamento/regi\u00f3n",
                "tags": [
                    "Location"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "string"
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/locations/regions": {
            "get": {
                "operationId": "location.getRegionsByCountry",
                "description": "GET /locations/regions",
                "summary": "Lista de departamentos/estados del pa\u00eds del workspace",
                "tags": [
                    "Location"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "string"
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/locations/city": {
            "post": {
                "operationId": "location.createCity",
                "description": "POST /locations/city\nBody: { city_name, region_id?, region_name? }",
                "summary": "Crea (o recupera) una ciudad dentro del pa\u00eds del workspace.\nAcepta region_id (ID existente) o region_name (crea la regi\u00f3n si no existe)",
                "tags": [
                    "Location"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "region_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "region_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    }
                                },
                                "required": [
                                    "city_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    },
                    "201": {
                        "description": "Ciudad registrada (200 si ya exist\u00eda)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "code": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "region_id": {
                                                    "type": "integer"
                                                },
                                                "region_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "region_id",
                                                "region_name"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/location-service/{level}": {
            "get": {
                "operationId": "location.service",
                "tags": [
                    "Location"
                ],
                "parameters": [
                    {
                        "name": "level",
                        "in": "path",
                        "required": true,
                        "description": "**Optional**",
                        "schema": {
                            "type": "string",
                            "default": null
                        },
                        "x-optional": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "string"
                                                },
                                                "message": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "const": "VALIDATION_FAILED"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Errores de validaci\u00f3n"
                                        },
                                        "errors": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/location-service": {
            "post": {
                "operationId": "location.store",
                "summary": "Crea una ubicaci\u00f3n v\u00eda el flujo original del m\u00f3dulo Servicios.\nRecibe country_input + region_input como texto libre o IDs",
                "tags": [
                    "Location"
                ],
                "responses": {
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "const": "VALIDATION_FAILED"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Errores de validaci\u00f3n"
                                        },
                                        "errors": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Ubicaci\u00f3n creada exitosamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/m2m/ping": {
            "get": {
                "operationId": "m2m.ping",
                "summary": "GET /m2m/ping \u2014 smoke del integrador: token v\u00e1lido + binding resuelto",
                "tags": [
                    "M2M"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "workspace_id": {
                                                    "type": "string"
                                                },
                                                "client_id": {
                                                    "type": "string"
                                                },
                                                "time": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "workspace_id",
                                                "client_id",
                                                "time"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/m2m/processes": {
            "get": {
                "operationId": "m2m.processes",
                "summary": "GET /m2m/processes \u2014 procesos del workspace del client (scope processes.read)",
                "tags": [
                    "M2M"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/mks/auth/login-microsoft": {
            "post": {
                "operationId": "mksAuth.loginMicrosoft",
                "tags": [
                    "MksAuth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "token": {
                                        "type": "string"
                                    },
                                    "workspace_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "token"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "message": {
                                                    "type": "string"
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "token": {
                                                            "type": "string"
                                                        },
                                                        "user": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "string"
                                                                },
                                                                "email": {
                                                                    "type": "string"
                                                                },
                                                                "first_name": {
                                                                    "type": "string"
                                                                },
                                                                "last_name": {
                                                                    "type": "string"
                                                                },
                                                                "roles": {
                                                                    "type": "string"
                                                                },
                                                                "account_type": {
                                                                    "type": "string"
                                                                },
                                                                "user_type": {},
                                                                "is_admin": {
                                                                    "type": "boolean"
                                                                },
                                                                "permissions": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "string"
                                                                            },
                                                                            "minItems": 0,
                                                                            "maxItems": 0,
                                                                            "additionalItems": false
                                                                        },
                                                                        {
                                                                            "type": "string"
                                                                        }
                                                                    ]
                                                                },
                                                                "avatar": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "workspace": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "logo": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "layout": {
                                                                            "type": "string"
                                                                        },
                                                                        "country_id": {
                                                                            "anyOf": [
                                                                                {
                                                                                    "type": "string"
                                                                                },
                                                                                {
                                                                                    "type": "integer"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "timezone": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name",
                                                                        "logo",
                                                                        "layout",
                                                                        "country_id",
                                                                        "timezone"
                                                                    ]
                                                                },
                                                                "applications": {
                                                                    "type": "string"
                                                                },
                                                                "profile_id": {
                                                                    "type": "string"
                                                                },
                                                                "job_title": {
                                                                    "type": "string"
                                                                },
                                                                "company_id": {
                                                                    "type": "string"
                                                                },
                                                                "active_company": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "null"
                                                                        },
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "string"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            },
                                                                            "required": [
                                                                                "id",
                                                                                "name"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            },
                                                                            "required": [
                                                                                "id",
                                                                                "name"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                "workspace_config": {
                                                                    "type": [
                                                                        "object",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "email",
                                                                "first_name",
                                                                "last_name",
                                                                "roles",
                                                                "account_type",
                                                                "user_type",
                                                                "is_admin",
                                                                "permissions",
                                                                "avatar",
                                                                "workspace",
                                                                "applications",
                                                                "profile_id",
                                                                "job_title",
                                                                "company_id",
                                                                "active_company",
                                                                "workspace_config"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "token",
                                                        "user"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message",
                                                "data"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "workspace_required"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Selecciona un workspace para continuar."
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "workspaces": {
                                                            "type": "array",
                                                            "description": "Workspaces como member (person o business h\u00edbrido)\nif (in_array($user->account_type, ['person', 'business'])) {\n$memberWorkspaces = $this->getMemberWorkspaces($user);\n$workspaces = $workspaces->merge($memberWorkspaces);\n}\nEliminar duplicados por ID y ordenar  revisar...",
                                                            "items": {
                                                                "anyOf": [
                                                                    {
                                                                        "type": "string"
                                                                    },
                                                                    {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "id": {
                                                                                "type": "integer"
                                                                            },
                                                                            "name": {
                                                                                "type": "string"
                                                                            },
                                                                            "logo": {
                                                                                "type": [
                                                                                    "string",
                                                                                    "null"
                                                                                ]
                                                                            },
                                                                            "role": {
                                                                                "type": "string",
                                                                                "const": "owner"
                                                                            }
                                                                        },
                                                                        "required": [
                                                                            "id",
                                                                            "name",
                                                                            "logo",
                                                                            "role"
                                                                        ]
                                                                    }
                                                                ]
                                                            }
                                                        }
                                                    },
                                                    "required": [
                                                        "email",
                                                        "workspaces"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message",
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "No tienes acceso a este workspace."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "no_workspaces"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "No tienes acceso a ning\u00fan workspace activo."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "user_not_registered"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Tu cuenta de Microsoft no est\u00e1 autorizada en esta plataforma. Contacta al administrador."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Token de Microsoft inv\u00e1lido."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/modules/{moduleCode}": {
            "get": {
                "operationId": "module.getModules",
                "tags": [
                    "Module"
                ],
                "parameters": [
                    {
                        "name": "moduleCode",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "module": {
                                                    "type": "string"
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "module",
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "const": "VALIDATION_FAILED"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Errores de validaci\u00f3n"
                                        },
                                        "errors": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/payments/checkout": {
            "post": {
                "operationId": "payment.checkout",
                "summary": "POST /payments/checkout\nCrea el intento de pago y devuelve la URL de checkout de la pasarela",
                "tags": [
                    "Payment"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "concept_type": {
                                        "type": "string",
                                        "enum": [
                                            "addon_payment",
                                            "subscription_payment"
                                        ]
                                    },
                                    "concept_id": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "idempotency_key": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    }
                                },
                                "required": [
                                    "concept_type",
                                    "concept_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "amount": {
                                                    "type": "string"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "checkout_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "uuid",
                                                "status",
                                                "amount",
                                                "currency",
                                                "checkout_url"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Checkout creado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/payments/intents/{uuid}": {
            "get": {
                "operationId": "payment.show",
                "summary": "GET /payments/intents/{uuid}\nEstado del intento (para polling tras volver de la pasarela)",
                "tags": [
                    "Payment"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "amount": {
                                                    "type": "string"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "concept_type": {
                                                    "type": "string"
                                                },
                                                "concept_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "checkout_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "uuid",
                                                "status",
                                                "amount",
                                                "currency",
                                                "concept_type",
                                                "concept_id",
                                                "checkout_url"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/payment-gateways": {
            "get": {
                "operationId": "paymentGatewayAdmin.index",
                "summary": "GET /superadmin/payment-gateways",
                "tags": [
                    "PaymentGatewayAdmin"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "driver": {
                                                        "type": "string"
                                                    },
                                                    "currency": {
                                                        "type": "string"
                                                    },
                                                    "is_sandbox": {
                                                        "type": "boolean"
                                                    },
                                                    "is_active": {
                                                        "type": "boolean"
                                                    },
                                                    "credential_keys": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "applications": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "assignment_id": {
                                                                    "type": "string"
                                                                },
                                                                "application_id": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "country": {
                                                                    "type": "string"
                                                                },
                                                                "is_default": {
                                                                    "type": "boolean"
                                                                }
                                                            },
                                                            "required": [
                                                                "assignment_id",
                                                                "application_id",
                                                                "name",
                                                                "country",
                                                                "is_default"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "driver",
                                                    "currency",
                                                    "is_sandbox",
                                                    "is_active",
                                                    "credential_keys",
                                                    "applications"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "paymentGatewayAdmin.store",
                "summary": "POST /superadmin/payment-gateways",
                "tags": [
                    "PaymentGatewayAdmin"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "driver": {
                                        "type": "string",
                                        "enum": [
                                            "wompi",
                                            "epayco",
                                            "mercadopago",
                                            "stripe",
                                            "fake"
                                        ]
                                    },
                                    "currency": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10
                                    },
                                    "is_sandbox": {
                                        "type": "boolean"
                                    },
                                    "credentials": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "name",
                                    "driver"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Pasarela creada (inactiva)."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/payment-gateways/{id}": {
            "patch": {
                "operationId": "paymentGatewayAdmin.update",
                "summary": "PATCH /superadmin/payment-gateways/{id} \u2014 credenciales por merge",
                "tags": [
                    "PaymentGatewayAdmin"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "currency": {
                                        "type": "string",
                                        "maxLength": 10
                                    },
                                    "is_sandbox": {
                                        "type": "boolean"
                                    },
                                    "is_active": {
                                        "type": "boolean"
                                    },
                                    "credentials": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Pasarela actualizada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/payment-gateways/{id}/applications": {
            "put": {
                "operationId": "paymentGatewayAdmin.assign",
                "summary": "PUT /superadmin/payment-gateways/{id}/applications \u2014 upsert asignaci\u00f3n",
                "tags": [
                    "PaymentGatewayAdmin"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "application_id": {
                                        "type": "integer"
                                    },
                                    "country": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5
                                    }
                                },
                                "required": [
                                    "application_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Pasarela asignada a la aplicaci\u00f3n."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/payment-gateways/assignments/{assignmentId}": {
            "delete": {
                "operationId": "paymentGatewayAdmin.unassign",
                "summary": "DELETE /superadmin/payment-gateways/assignments/{assignmentId}",
                "tags": [
                    "PaymentGatewayAdmin"
                ],
                "parameters": [
                    {
                        "name": "assignmentId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Asignaci\u00f3n eliminada."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/payment-intents": {
            "get": {
                "operationId": "paymentGatewayAdmin.intents",
                "summary": "GET /superadmin/payment-intents \u2014 monitoreo de pagos de la plataforma",
                "tags": [
                    "PaymentGatewayAdmin"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "workspace_id",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 0
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/payments/webhooks/{gateway}": {
            "post": {
                "operationId": "paymentWebhook.handle",
                "tags": [
                    "PaymentWebhook"
                ],
                "parameters": [
                    {
                        "name": "gateway",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "400": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/people/lookup": {
            "get": {
                "operationId": "person.lookup",
                "description": "Patr\u00f3n setupDocumentListener: el frontend hace debounce 500ms\ny llama este endpoint cuando el campo documento tiene \u2265 6 chars.",
                "summary": "GET /people/lookup?document={doc}&type={type}\nBusca una persona por n\u00famero de documento para prellenar el formulario",
                "tags": [
                    "Person"
                ],
                "parameters": [
                    {
                        "name": "document",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "minLength": 4,
                            "maxLength": 30
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "CC",
                                "CE",
                                "PAS",
                                "NIT",
                                "RUT",
                                "DNI",
                                "other"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "id_document": {
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "first_name": {
                                                            "type": "string",
                                                            "description": "Datos de contacto: workspace override > global"
                                                        },
                                                        "last_name": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "email": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "phone": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "global_name": {
                                                            "type": "string",
                                                            "description": "Nombre global para comparaci\u00f3n en el frontend"
                                                        },
                                                        "gender": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "birth": {
                                                            "type": "string"
                                                        },
                                                        "verification_pending": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "id_document",
                                                        "type",
                                                        "first_name",
                                                        "last_name",
                                                        "email",
                                                        "phone",
                                                        "global_name",
                                                        "gender",
                                                        "birth",
                                                        "verification_pending"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/people/search": {
            "get": {
                "operationId": "person.search",
                "summary": "GET /people/search?q={query}\nB\u00fasqueda de personas por nombre o documento (para selects con typeahead)",
                "tags": [
                    "Person"
                ],
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 50
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Person"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/verifications": {
            "get": {
                "operationId": "personVerification.index",
                "summary": "GET /superadmin/verifications\nLista todas las verificaciones pendientes con contexto de workspace",
                "tags": [
                    "PersonVerification"
                ],
                "responses": {
                    "200": {
                        "description": "Antes pasaba un 4\u00ba arg a success() que se descartaba (la meta se\nperd\u00eda). Ahora usa el contrato paginado est\u00e1ndar.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/verifications/{id}": {
            "patch": {
                "operationId": "personVerification.resolve",
                "description": "action = 'accept' \u2192 el nombre del workspace se convierte en el nombre global en `people`\naction = 'reject' \u2192 workspace_people revierte al nombre global; se descarta el override",
                "summary": "PATCH /superadmin/verifications/{workspacePeopleId}\nResuelve una verificaci\u00f3n pendiente",
                "tags": [
                    "PersonVerification"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "accept",
                                            "reject"
                                        ]
                                    }
                                },
                                "required": [
                                    "action"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 404
                                                },
                                                "error_code": {
                                                    "type": "string",
                                                    "enum": [
                                                        "BAD_REQUEST",
                                                        "UNAUTHENTICATED",
                                                        "FORBIDDEN",
                                                        "NOT_FOUND",
                                                        "CONFLICT",
                                                        "VALIDATION_FAILED",
                                                        "RATE_LIMITED",
                                                        "SERVER_ERROR"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Persona no encontrada."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "error_code",
                                                "message",
                                                "details"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 404
                                                },
                                                "error_code": {
                                                    "type": "string",
                                                    "enum": [
                                                        "BAD_REQUEST",
                                                        "UNAUTHENTICATED",
                                                        "FORBIDDEN",
                                                        "NOT_FOUND",
                                                        "CONFLICT",
                                                        "VALIDATION_FAILED",
                                                        "RATE_LIMITED",
                                                        "SERVER_ERROR"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Registro no encontrado."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "error_code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/planes": {
            "get": {
                "operationId": "v1.planes.index",
                "tags": [
                    "Plan"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.planes.store",
                "tags": [
                    "Plan"
                ],
                "responses": {
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "const": "VALIDATION_FAILED"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Errores de validaci\u00f3n"
                                        },
                                        "errors": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Registro creado exitosamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/planes/{id}": {
            "get": {
                "operationId": "v1.planes.show",
                "tags": [
                    "Plan"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "v1.planes.update",
                "tags": [
                    "Plan"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Record updated successfully"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.planes.destroy",
                "tags": [
                    "Plan"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Record deleted successfully"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/public/posts": {
            "get": {
                "operationId": "post.publicIndex",
                "summary": "Lista p\u00fablica de posts publicados de una app (por X-App-ID)",
                "tags": [
                    "Post"
                ],
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Post"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 400
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "X-App-ID requerido"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/public/posts/{slug}": {
            "get": {
                "operationId": "post.publicShow",
                "summary": "Detalle p\u00fablico de un post publicado por slug",
                "tags": [
                    "Post"
                ],
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "anyOf": [
                                                {
                                                    "$ref": "#/components/schemas/Post"
                                                },
                                                {
                                                    "type": "null"
                                                }
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Post no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 400
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "X-App-ID requerido"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts": {
            "get": {
                "operationId": "post.index",
                "summary": "Lista paginada de posts del workspace",
                "tags": [
                    "Post"
                ],
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "post.store",
                "summary": "Crear post",
                "tags": [
                    "Post"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Post"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Post creado"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/posts/{id}": {
            "get": {
                "operationId": "post.show",
                "summary": "Detalle de un post del workspace (cualquier estado)",
                "tags": [
                    "Post"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Post no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "post.update",
                "summary": "Actualizar post",
                "tags": [
                    "Post"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Post actualizado"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Post no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "post.destroy",
                "summary": "Eliminar (soft delete)",
                "tags": [
                    "Post"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Post eliminado"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Post no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/posts/upload-image": {
            "post": {
                "operationId": "post.uploadImage",
                "summary": "Subir imagen de contenido (editor). Devuelve { location }",
                "tags": [
                    "Post"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application/octet-stream",
                                        "maxLength": 4096
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "location": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "location"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes": {
            "get": {
                "operationId": "process.index",
                "description": "Enfoque A \u2014 filtro de datos por permiso de servicio:\nSi el usuario tiene permisos del patr\u00f3n `processes.service_filter.{slug}`,\nla consulta se restringe a los data_source_ids que corresponden a esos slugs.\nSin permisos de ese patr\u00f3n \u2192 acceso total (sin restricci\u00f3n de servicio).",
                "summary": "GET /processes\nLista paginada de grupos de procesos con filtros",
                "tags": [
                    "Process"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "process.store",
                "summary": "POST /processes\nCrea un grupo (evaluado + N servicios seleccionados)",
                "tags": [
                    "Process"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreProcessRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Proceso creado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "code": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "process_code": {
                                                    "type": "string"
                                                },
                                                "processes": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/ProcessResource"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "process_code",
                                                "processes"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/processes/cost-centers": {
            "get": {
                "operationId": "process.costCenters",
                "summary": "GET /processes/cost-centers\nValores de centro de costos ya usados en el workspace (datalist autocomplete)",
                "tags": [
                    "Process"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/my-assignments": {
            "get": {
                "operationId": "process.myAssignments",
                "summary": "GET /processes/my-assignments\nProcesos con requires_scheduling=true asignados al usuario autenticado.\nUsado por el evaluador para ver sus servicios programados",
                "tags": [
                    "Process"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ProcessResource"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/{code}/comments": {
            "get": {
                "operationId": "process.getGroupComments",
                "summary": "GET /processes/{code}/comments\nTodos los comentarios de los servicios del grupo, indexados por process_id",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "process_id": {
                                                        "type": "integer"
                                                    },
                                                    "content": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "is_mine": {
                                                        "type": "boolean"
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "initials": {
                                                                "type": "string"
                                                            },
                                                            "avatar": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name",
                                                            "initials",
                                                            "avatar"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "process_id",
                                                    "content",
                                                    "created_at",
                                                    "is_mine",
                                                    "user"
                                                ]
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/{code}": {
            "get": {
                "operationId": "process.show",
                "summary": "GET /processes/{code}\nDetalle completo de un grupo (todas las filas con el mismo process_code)",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ProcessResource"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Proceso no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "process.update",
                "summary": "PUT /processes/{code}\nActualiza datos comunes del grupo (asignado, empresa, fecha, etc.)",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateProcessRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Proceso actualizado correctamente."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Proceso no encontrado o sin cambios."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "process.destroy",
                "summary": "DELETE /processes/{code}\nElimina (soft) todo el grupo de procesos",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Proceso eliminado correctamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Proceso no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/{id}/comments": {
            "post": {
                "operationId": "process.addComment",
                "summary": "POST /processes/{id}/comments\nA\u00f1adir un comentario a un servicio del grupo",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "process_id": {
                                                    "type": "integer"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "is_mine": {
                                                    "type": "boolean"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "initials": {
                                                            "type": "string"
                                                        },
                                                        "avatar": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "initials",
                                                        "avatar"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "process_id",
                                                "content",
                                                "created_at",
                                                "is_mine",
                                                "user"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Comentario agregado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/{id}/status": {
            "patch": {
                "operationId": "process.updateStatus",
                "summary": "PATCH /processes/{id}/status\nActualiza el estado de un proceso individual dentro del grupo",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "maxLength": 50
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Estado actualizado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/{id}/schedule": {
            "patch": {
                "operationId": "process.scheduleService",
                "summary": "PATCH /processes/{id}/schedule\nPrograma un servicio individual (fecha + direcci\u00f3n + ciudad \u2192 status 'activo')",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "start_date": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "assigned_to": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "start_date"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Servicio programado correctamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/{id}/service": {
            "delete": {
                "operationId": "process.destroyService",
                "summary": "DELETE /processes/{id}/service\nElimina (soft) un servicio individual del grupo",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Servicio eliminado del proceso."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/processes/{code}/cancel": {
            "patch": {
                "operationId": "process.cancelGroup",
                "summary": "PATCH /processes/{code}/cancel\nCancela todos los servicios activos de un grupo (usado por usuarios cliente).\nRequiere permiso processes.reject.\nEl cliente solo puede cancelar procesos donde \u00e9l es el solicitante",
                "tags": [
                    "Process"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Proceso cancelado correctamente."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No hay servicios activos para cancelar."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/profile": {
            "get": {
                "operationId": "profile.show",
                "summary": "Retorna el perfil del usuario autenticado en el workspace actual",
                "tags": [
                    "Profile"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "first_name": {
                                                    "type": "string"
                                                },
                                                "last_name": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "phone": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "birthday": {
                                                    "type": "string"
                                                },
                                                "job_title": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "department": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "avatar": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "avatar_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "company_id": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "integer"
                                                        }
                                                    ]
                                                },
                                                "companies": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "legal_name": {
                                                                "type": "string"
                                                            },
                                                            "job_title": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "department": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "is_primary": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "legal_name",
                                                            "job_title",
                                                            "department",
                                                            "is_primary"
                                                        ]
                                                    }
                                                },
                                                "active_company": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "integer"
                                                                }
                                                            ]
                                                        },
                                                        "legal_name": {
                                                            "type": "string"
                                                        },
                                                        "dba": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "email": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "phone": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                },
                                                                {
                                                                    "type": "array",
                                                                    "items": {}
                                                                }
                                                            ]
                                                        },
                                                        "address": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "web": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "logo_url": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "legal_name",
                                                        "dba",
                                                        "email",
                                                        "phone",
                                                        "address",
                                                        "web",
                                                        "logo_url"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "email",
                                                "first_name",
                                                "last_name",
                                                "phone",
                                                "birthday",
                                                "job_title",
                                                "department",
                                                "avatar",
                                                "avatar_url",
                                                "company_id",
                                                "companies",
                                                "active_company"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Perfil no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "profile.update",
                "summary": "Actualiza los campos personales del perfil (no campos de admin: rol, estado)",
                "tags": [
                    "Profile"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "last_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 16
                                    },
                                    "birthday": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "job_title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "department": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "first_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "first_name": {
                                                    "type": "string"
                                                },
                                                "last_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "birthday": {
                                                    "type": "string"
                                                },
                                                "job_title": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "department": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first_name",
                                                "last_name",
                                                "phone",
                                                "birthday",
                                                "job_title",
                                                "department"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Perfil actualizado correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Perfil no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/profile/avatar": {
            "post": {
                "operationId": "profile.uploadAvatar",
                "summary": "Sube y actualiza el avatar del usuario en el workspace actual",
                "tags": [
                    "Profile"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "avatar": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application/octet-stream",
                                        "maxLength": 2048
                                    }
                                },
                                "required": [
                                    "avatar"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "avatar": {
                                                    "type": "string"
                                                },
                                                "avatar_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "avatar",
                                                "avatar_url"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Avatar actualizado correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Perfil no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/profile/confirm-password": {
            "post": {
                "operationId": "profile.confirmPassword",
                "summary": "Verifica la contrase\u00f1a actual del usuario sin generar token.\nUsada para confirmar identidad antes de cambiar empresa activa",
                "tags": [
                    "Profile"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Contrase\u00f1a verificada correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/profile/active-company": {
            "put": {
                "operationId": "profile.switchActiveCompany",
                "summary": "Cambia la empresa activa del usuario (solo para usuarios con m\u00faltiples empresas en el workspace).\nRequiere confirmaci\u00f3n previa de contrase\u00f1a via POST /profile/confirm-password",
                "tags": [
                    "Profile"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "company_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "company_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "active_company": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "active_company"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa activa actualizada correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 403
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No tienes acceso a esta empresa en el workspace"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/profile/company": {
            "put": {
                "operationId": "profile.updateCompany",
                "summary": "Actualiza los datos de contacto de la empresa activa del usuario.\nRequiere permiso 'profile.company.edit' (o ser admin)",
                "tags": [
                    "Profile"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "legal_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "dba": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 100
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "web": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    }
                                },
                                "required": [
                                    "legal_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "legal_name": {
                                                    "type": "string"
                                                },
                                                "dba": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "web": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "legal_name",
                                                "dba",
                                                "email",
                                                "phone",
                                                "address",
                                                "web"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa actualizada correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 403
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No tienes permiso para editar los datos de tu empresa."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/profile/company/logo": {
            "post": {
                "operationId": "profile.uploadCompanyLogo",
                "summary": "Sube o reemplaza el logo de la empresa activa del usuario.\nRequiere permiso 'profile.company.edit' (o ser admin)",
                "tags": [
                    "Profile"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application/octet-stream",
                                        "maxLength": 2048
                                    }
                                },
                                "required": [
                                    "logo"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "logo_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "logo_url"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Logo actualizado correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Empresa no encontrada"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 403
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No tienes permiso para editar los datos de tu empresa."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/register": {
            "post": {
                "operationId": "publicRegistration.register",
                "description": "Campos base (siempre requeridos):\n  - app_id  integer  exists:applications,id\n  - email   string   email\n\nLos campos adicionales y su almacenamiento post-registro son\nresponsabilidad del RegistrationHandler de cada aplicaci\u00f3n.\nPara agregar soporte a una nueva app, registrar su handler en\nRegistrationHandlerFactory::for().",
                "summary": "Registro p\u00fablico unificado para cualquier aplicaci\u00f3n de la plataforma",
                "tags": [
                    "PublicRegistration"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "app_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "app_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 403
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Registro exitoso; se env\u00eda correo de activaci\u00f3n",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "code": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "email": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "email"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/superadmin/role-templates": {
            "get": {
                "operationId": "roleTemplateModeration.index",
                "summary": "GET /api/superadmin/role-templates\nLista todos los templates custom pendientes de moderaci\u00f3n",
                "tags": [
                    "RoleTemplateModeration"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": "pending"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/RoleTemplate"
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/superadmin/role-templates/{id}/moderation": {
            "patch": {
                "operationId": "roleTemplateModeration.moderate",
                "description": "Body: { \"status\": \"active\" | \"inactive\", \"notes\": \"Motivo (opcional)\" }\n\n- \"active\"   \u2192 aprobado: el template aparece en el cat\u00e1logo de otros workspaces de la misma industria.\n- \"inactive\" \u2192 rechazado: el template y su rol siguen funcionando en el workspace de origen,\n               pero no se distribuye a otros workspaces.",
                "summary": "PATCH /api/superadmin/role-templates/{id}/moderation\nAprueba o rechaza un template custom",
                "tags": [
                    "RoleTemplateModeration"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "active",
                                            "inactive"
                                        ]
                                    },
                                    "notes": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "string"
                                                },
                                                "message": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Template no encontrado o no est\u00e1 pendiente de moderaci\u00f3n."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/summit/auth/request-otp": {
            "post": {
                "operationId": "summitAuth.requestOtp",
                "summary": "Genera un OTP de 6 d\u00edgitos y lo env\u00eda por correo al usuario",
                "tags": [
                    "SummitAuth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "workspace_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "email",
                                    "workspace_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "C\u00f3digo enviado a tu correo."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "C\u00f3digo enviado si el correo est\u00e1 registrado."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/summit/auth/login-otp": {
            "post": {
                "operationId": "summitAuth.loginOtp",
                "summary": "Valida el OTP y emite un token de acceso Passport si es correcto",
                "tags": [
                    "SummitAuth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "otp": {
                                        "type": "string",
                                        "minLength": 6,
                                        "maxLength": 6
                                    },
                                    "workspace_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "email",
                                    "otp",
                                    "workspace_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "token": {
                                                    "type": "string"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "first_name": {
                                                            "type": "string"
                                                        },
                                                        "last_name": {
                                                            "type": "string"
                                                        },
                                                        "roles": {
                                                            "type": "string"
                                                        },
                                                        "account_type": {
                                                            "type": "string"
                                                        },
                                                        "user_type": {},
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "permissions": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "minItems": 0,
                                                                    "maxItems": 0,
                                                                    "additionalItems": false
                                                                },
                                                                {
                                                                    "type": "string"
                                                                }
                                                            ]
                                                        },
                                                        "avatar": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "workspace": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "logo": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "layout": {
                                                                    "type": "string"
                                                                },
                                                                "country_id": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "integer"
                                                                        }
                                                                    ]
                                                                },
                                                                "timezone": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "name",
                                                                "logo",
                                                                "layout",
                                                                "country_id",
                                                                "timezone"
                                                            ]
                                                        },
                                                        "applications": {
                                                            "type": "string"
                                                        },
                                                        "profile_id": {
                                                            "type": "string"
                                                        },
                                                        "job_title": {
                                                            "type": "string"
                                                        },
                                                        "company_id": {
                                                            "type": "string"
                                                        },
                                                        "active_company": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "null"
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name"
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "workspace_config": {
                                                            "type": [
                                                                "object",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "email",
                                                        "first_name",
                                                        "last_name",
                                                        "roles",
                                                        "account_type",
                                                        "user_type",
                                                        "is_admin",
                                                        "permissions",
                                                        "avatar",
                                                        "workspace",
                                                        "applications",
                                                        "profile_id",
                                                        "job_title",
                                                        "company_id",
                                                        "active_company",
                                                        "workspace_config"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "token",
                                                "user"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "No tiene acceso a este workspace."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Usuario no encontrado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "C\u00f3digo incorrecto o expirado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/summit/me": {
            "get": {
                "operationId": "summitAuth.me",
                "summary": "Registration Summit del usuario autenticado (pa\u00eds, especialidad\u2026).\nAISLADO: solo lee SummitRegistration por user_id; no toca UserPayloadService,\n/me ni el flujo de otras apps. Devuelve null si el usuario no tiene registro",
                "tags": [
                    "SummitAuth"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "pais": {
                                                    "type": "string"
                                                },
                                                "nombre_apellidos": {
                                                    "type": "string"
                                                },
                                                "especialidad": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "pais",
                                                "nombre_apellidos",
                                                "especialidad"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/list-users": {
            "get": {
                "operationId": "v1.list-users.index",
                "tags": [
                    "User"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.list-users.store",
                "tags": [
                    "User"
                ],
                "responses": {
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "const": "VALIDATION_FAILED"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Errores de validaci\u00f3n"
                                        },
                                        "errors": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Registro creado exitosamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/list-users/{id}": {
            "get": {
                "operationId": "v1.list-users.show",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "v1.list-users.update",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Record updated successfully"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.list-users.destroy",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Record deleted successfully"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/verify-login": {
            "post": {
                "operationId": "verifyLogin.verifyAndLogin",
                "tags": [
                    "VerifyLogin"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "encodedData": {
                                        "type": "string"
                                    },
                                    "providedToken": {
                                        "type": "string"
                                    },
                                    "app_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "workspace_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "encodedData",
                                    "providedToken"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "token": {
                                                            "type": "string"
                                                        },
                                                        "workspace_id": {
                                                            "type": "integer"
                                                        },
                                                        "user": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "string"
                                                                },
                                                                "email": {
                                                                    "type": "string"
                                                                },
                                                                "first_name": {
                                                                    "type": "string"
                                                                },
                                                                "last_name": {
                                                                    "type": "string"
                                                                },
                                                                "roles": {
                                                                    "type": "string"
                                                                },
                                                                "account_type": {
                                                                    "type": "string"
                                                                },
                                                                "user_type": {},
                                                                "is_admin": {
                                                                    "type": "boolean"
                                                                },
                                                                "permissions": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "string"
                                                                            },
                                                                            "minItems": 0,
                                                                            "maxItems": 0,
                                                                            "additionalItems": false
                                                                        },
                                                                        {
                                                                            "type": "string"
                                                                        }
                                                                    ]
                                                                },
                                                                "avatar": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "workspace": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "logo": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "layout": {
                                                                            "type": "string"
                                                                        },
                                                                        "country_id": {
                                                                            "anyOf": [
                                                                                {
                                                                                    "type": "string"
                                                                                },
                                                                                {
                                                                                    "type": "integer"
                                                                                }
                                                                            ]
                                                                        },
                                                                        "timezone": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name",
                                                                        "logo",
                                                                        "layout",
                                                                        "country_id",
                                                                        "timezone"
                                                                    ]
                                                                },
                                                                "applications": {
                                                                    "type": "string"
                                                                },
                                                                "profile_id": {
                                                                    "type": "string"
                                                                },
                                                                "job_title": {
                                                                    "type": "string"
                                                                },
                                                                "company_id": {
                                                                    "type": "string"
                                                                },
                                                                "active_company": {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "null"
                                                                        },
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "string"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            },
                                                                            "required": [
                                                                                "id",
                                                                                "name"
                                                                            ]
                                                                        },
                                                                        {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            },
                                                                            "required": [
                                                                                "id",
                                                                                "name"
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                "workspace_config": {
                                                                    "type": [
                                                                        "object",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "email",
                                                                "first_name",
                                                                "last_name",
                                                                "roles",
                                                                "account_type",
                                                                "user_type",
                                                                "is_admin",
                                                                "permissions",
                                                                "avatar",
                                                                "workspace",
                                                                "applications",
                                                                "profile_id",
                                                                "job_title",
                                                                "company_id",
                                                                "active_company",
                                                                "workspace_config"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "token",
                                                        "workspace_id",
                                                        "user"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Cuenta activada. \u00a1Bienvenido/a!"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 403
                                                },
                                                "error_code": {
                                                    "type": "string",
                                                    "enum": [
                                                        "BAD_REQUEST",
                                                        "UNAUTHENTICATED",
                                                        "FORBIDDEN",
                                                        "NOT_FOUND",
                                                        "CONFLICT",
                                                        "VALIDATION_FAILED",
                                                        "RATE_LIMITED",
                                                        "SERVER_ERROR"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "No tiene acceso a este workspace."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "error_code",
                                                "message",
                                                "details"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 403
                                                },
                                                "error_code": {
                                                    "type": "string",
                                                    "enum": [
                                                        "BAD_REQUEST",
                                                        "UNAUTHENTICATED",
                                                        "FORBIDDEN",
                                                        "NOT_FOUND",
                                                        "CONFLICT",
                                                        "VALIDATION_FAILED",
                                                        "RATE_LIMITED",
                                                        "SERVER_ERROR"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "El usuario no tiene un workspace asignado."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "error_code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/webhook-endpoints": {
            "get": {
                "operationId": "webhookEndpoint.index",
                "summary": "GET /webhook-endpoints",
                "tags": [
                    "WebhookEndpoint"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookEndpoint"
                                            }
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "webhookEndpoint.store",
                "summary": "POST /webhook-endpoints",
                "tags": [
                    "WebhookEndpoint"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "format": "uri",
                                        "maxLength": 500
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "enum": [
                                                "process.created",
                                                "process.status_changed",
                                                "form.submission.created",
                                                "payment.confirmed"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "url",
                                    "events"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "\u00danica vez que el secret viaja \u2014 el integrador lo guarda para verificar firmas",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "endpoint": {
                                                    "$ref": "#/components/schemas/WebhookEndpoint"
                                                },
                                                "secret": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "endpoint",
                                                "secret"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Webhook creado. Guarda el secret: no se volver\u00e1 a mostrar."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/webhook-endpoints/{id}": {
            "patch": {
                "operationId": "webhookEndpoint.update",
                "summary": "PATCH /webhook-endpoints/{id}",
                "tags": [
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "format": "uri",
                                        "maxLength": 500
                                    },
                                    "is_active": {
                                        "type": "boolean"
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "enum": [
                                                "process.created",
                                                "process.status_changed",
                                                "form.submission.created",
                                                "payment.confirmed"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Webhook actualizado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "webhookEndpoint.destroy",
                "summary": "DELETE /webhook-endpoints/{id}",
                "tags": [
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Webhook eliminado."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/work-modes": {
            "get": {
                "operationId": "workMode.index",
                "summary": "Lista todos los modos de trabajo disponibles en el sistema",
                "tags": [
                    "WorkMode"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WorkModeTemplate"
                                            }
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/work-modes/{key}/impact": {
            "get": {
                "operationId": "workMode.impact",
                "description": "Compara el modules_config del modo activo contra el del modo destino y\ndevuelve, por m\u00f3dulo: cambio de vista, secciones que se ocultan (los datos\nse conservan en BD) y secciones nuevas. Incluye advertencias con conteos\n(p.ej. procesos sin fecha que no aparecer\u00e1n en la vista calendario).\n\nGET /work-modes/{key}/impact \u2014 PLAN_MULTIMODO \u00a74 (confiable_app).",
                "summary": "Reporte de impacto ANTES de cambiar de modo de trabajo (wizard de cambio)",
                "tags": [
                    "WorkMode"
                ],
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "current": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "key",
                                                        "name"
                                                    ]
                                                },
                                                "target": {
                                                    "type": "object",
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "key",
                                                        "name"
                                                    ]
                                                },
                                                "modules": {
                                                    "type": "string"
                                                },
                                                "warnings": {
                                                    "type": "array",
                                                    "items": {
                                                        "anyOf": [
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "code": {
                                                                        "type": "string",
                                                                        "const": "SECTIONS_HIDDEN"
                                                                    },
                                                                    "module": {
                                                                        "type": "string"
                                                                    },
                                                                    "message": {
                                                                        "type": "string"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "code",
                                                                    "module",
                                                                    "message"
                                                                ]
                                                            },
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "code": {
                                                                        "type": "string",
                                                                        "const": "CALENDAR_MISSING_DATES"
                                                                    },
                                                                    "module": {
                                                                        "type": "string"
                                                                    },
                                                                    "count": {
                                                                        "type": "integer",
                                                                        "minimum": 0
                                                                    },
                                                                    "message": {
                                                                        "type": "string"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "code",
                                                                    "module",
                                                                    "count",
                                                                    "message"
                                                                ]
                                                            }
                                                        ]
                                                    }
                                                },
                                                "reversible": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "current",
                                                "target",
                                                "modules",
                                                "warnings",
                                                "reversible"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 404
                                                },
                                                "error_code": {
                                                    "type": "string",
                                                    "enum": [
                                                        "BAD_REQUEST",
                                                        "UNAUTHENTICATED",
                                                        "FORBIDDEN",
                                                        "NOT_FOUND",
                                                        "CONFLICT",
                                                        "VALIDATION_FAILED",
                                                        "RATE_LIMITED",
                                                        "SERVER_ERROR"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Aplicaci\u00f3n no vinculada al workspace"
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "error_code",
                                                "message",
                                                "details"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "error"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 404
                                                },
                                                "error_code": {
                                                    "type": "string",
                                                    "enum": [
                                                        "BAD_REQUEST",
                                                        "UNAUTHENTICATED",
                                                        "FORBIDDEN",
                                                        "NOT_FOUND",
                                                        "CONFLICT",
                                                        "VALIDATION_FAILED",
                                                        "RATE_LIMITED",
                                                        "SERVER_ERROR"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Modo de trabajo no encontrado"
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "error_code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "X-App-ID requerido"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/work-mode": {
            "put": {
                "operationId": "workMode.setWorkMode",
                "summary": "Establece el modo de trabajo activo para el workspace + app actuales.\nSolo admins del workspace pueden hacer este cambio",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "work_modes": {
                                                    "type": "string"
                                                },
                                                "theme": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "theme_defaults": {
                                                    "type": "array",
                                                    "description": "defaults + overrides del workspace",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "work_modes",
                                                "theme",
                                                "theme_defaults"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/module-labels": {
            "put": {
                "operationId": "workMode.saveModuleLabels",
                "description": "Los labels son por workspace (todos los usuarios ven el mismo nombre),\nalmacenados en workspace_applications.app_config.module_labels.\n\nFormato: { \"procesos\": \"Evaluaciones\", \"clientes\": \"Empresas\", ... }",
                "summary": "Guarda los labels personalizados de m\u00f3dulos en app_config del workspace",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "module_labels": {
                                        "type": "array",
                                        "items": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "maxLength": 50
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "module_labels"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Labels de m\u00f3dulos guardados."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "module_labels": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "module_labels"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/module-sections": {
            "put": {
                "operationId": "workMode.saveModuleSections",
                "summary": "Guarda overrides de secciones visibles para un m\u00f3dulo espec\u00edfico.\nPermite al admin del workspace activar/desactivar campos que el work mode\noculta por defecto (ej: service_level, contract_dates en clientes)",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "module": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "sections": {
                                        "type": "array",
                                        "items": {
                                            "type": "boolean"
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "module",
                                    "sections"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Configuraci\u00f3n de campos guardada."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "sections": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "sections"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/module-views": {
            "put": {
                "operationId": "workMode.saveModuleViews",
                "summary": "Guarda las columnas visibles para un m\u00f3dulo espec\u00edfico.\nPermite al admin del workspace elegir qu\u00e9 campos se muestran en la vista tabla\ny en el acorde\u00f3n (meta) del m\u00f3dulo indicado",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "module": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "visible_columns": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "maxLength": 50
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "module",
                                    "visible_columns"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Configuraci\u00f3n de columnas guardada."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "visible_columns": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "visible_columns"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/module-required": {
            "put": {
                "operationId": "workMode.saveModuleRequiredFields",
                "description": "Estos required_fields son overrides del workspace sobre los defaults del sistema.\nSolo aplican a campos con formMode='section' (no a los hardcoded-required del backend).\nLa validaci\u00f3n se ejecuta en el frontend \u2014 el backend no valida campos individuales de negocio.",
                "summary": "Guarda los campos que el workspace marca como obligatorios para un m\u00f3dulo",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "module": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "required_fields": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "maxLength": 50
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "module",
                                    "required_fields"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Campos requeridos guardados."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "required_fields": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "required_fields"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/module-field-labels": {
            "put": {
                "operationId": "workMode.saveModuleFieldLabels",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "module": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "field_labels": {
                                        "type": "array",
                                        "items": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "maxLength": 100
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "module",
                                    "field_labels"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Etiquetas de campos guardadas."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "field_labels": {
                                                    "type": "array",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "field_labels"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/module-evaluator-roles": {
            "put": {
                "operationId": "workMode.saveModuleEvaluatorRoles",
                "summary": "Guarda etiquetas personalizadas de campos para un m\u00f3dulo.\nPermite al admin del workspace renombrar campos de negocio sin tocar c\u00f3digo.\nUn valor vac\u00edo elimina el override (vuelve a la etiqueta del sistema)",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "module": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "evaluator_role_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "module",
                                    "evaluator_role_ids"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Roles de evaluadores guardados."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "evaluator_role_ids": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "evaluator_role_ids"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/settings/theme": {
            "get": {
                "operationId": "workMode.getTheme",
                "summary": "Devuelve las preferencias de tema del usuario para la app actual",
                "tags": [
                    "WorkMode"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "theme": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "minItems": 0,
                                                            "maxItems": 0,
                                                            "additionalItems": false
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "theme"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "workMode.saveTheme",
                "summary": "Guarda las preferencias de tema personales del usuario para la app actual.\nCada usuario puede tener su propio tema sin afectar al resto del workspace",
                "tags": [
                    "WorkMode"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "primary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "secondary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "sidebar_bg": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "header_bg": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "header_text": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "background": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "text": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "text_secondary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "accent": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "success": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "danger": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "warning": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "info": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 200
                                    },
                                    "font_family": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "font_weight": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10
                                    },
                                    "heading_weight": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Preferencias de tema guardadas."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "theme": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "theme"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/settings/workspace-theme": {
            "get": {
                "operationId": "workMode.getWorkspaceTheme",
                "summary": "Devuelve el tema del workspace (app_config.theme) fresco desde la BD.\nUsado por el frontend para sincronizar localStorage tras cambios externos",
                "tags": [
                    "WorkMode"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "theme": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "theme"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Aplicaci\u00f3n no vinculada al workspace"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "X-App-ID requerido"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/workspaces": {
            "get": {
                "operationId": "v1.workspaces.index",
                "tags": [
                    "Workspace"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "string"
                                                },
                                                "last_page": {
                                                    "type": "string"
                                                },
                                                "per_page": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "has_more": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total",
                                                "has_more",
                                                "from",
                                                "to"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "meta",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.workspaces.store",
                "tags": [
                    "Workspace"
                ],
                "responses": {
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "const": "VALIDATION_FAILED"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Errores de validaci\u00f3n"
                                        },
                                        "errors": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "errors"
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "token": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "token",
                                                "url"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Cuenta creada exitosamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/workspaces/{id}": {
            "get": {
                "operationId": "v1.workspaces.show",
                "tags": [
                    "Workspace"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "v1.workspaces.update",
                "tags": [
                    "Workspace"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Record updated successfully"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.workspaces.destroy",
                "tags": [
                    "Workspace"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Record deleted successfully"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Recurso no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/account": {
            "get": {
                "operationId": "workspace.myAccount",
                "tags": [
                    "Workspace"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Application"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/roles": {
            "get": {
                "operationId": "workspaceRole.index",
                "summary": "GET /admin/roles\nLista roles activos del workspace scoped a la aplicaci\u00f3n activa",
                "tags": [
                    "WorkspaceRole"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "description": "Incluye roles globales (workspace_id = null) como el rol Administrador,\nque son compartidos entre todos los workspaces y no tienen copia propia.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "slug": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "icon": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "color": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "is_default": {
                                                                "type": "boolean"
                                                            },
                                                            "is_global": {
                                                                "type": "boolean"
                                                            },
                                                            "template_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ],
                                                                "description": "rol compartido, no editable"
                                                            },
                                                            "uses_template_permissions": {
                                                                "type": "boolean"
                                                            },
                                                            "template_outdated": {
                                                                "type": "string"
                                                            },
                                                            "template_version": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "latest_version": {
                                                                "type": "string"
                                                            },
                                                            "permissions_count": {
                                                                "type": "integer",
                                                                "minimum": 0
                                                            },
                                                            "permissions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "display_name": {
                                                                            "type": "string"
                                                                        },
                                                                        "group": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name",
                                                                        "display_name",
                                                                        "group"
                                                                    ]
                                                                }
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name",
                                                            "slug",
                                                            "description",
                                                            "level",
                                                            "scope",
                                                            "icon",
                                                            "color",
                                                            "is_default",
                                                            "is_global",
                                                            "template_id",
                                                            "uses_template_permissions",
                                                            "template_outdated",
                                                            "template_version",
                                                            "latest_version",
                                                            "permissions_count",
                                                            "permissions"
                                                        ]
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "workspaceRole.store",
                "summary": "POST /admin/roles\nCrea rol custom \u2192 template pendiente de moderaci\u00f3n + rol workspace-scoped",
                "tags": [
                    "WorkspaceRole"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "level": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 100
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 7
                                    },
                                    "category": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "scope": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "workspace",
                                            "client"
                                        ]
                                    },
                                    "permissions": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Rol"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Rol creado exitosamente. El template queda pendiente de aprobaci\u00f3n para aparecer en otros workspaces."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/roles/templates": {
            "get": {
                "operationId": "workspaceRole.templates",
                "summary": "GET /admin/roles/templates\nTemplates disponibles de la industria para la aplicaci\u00f3n activa.\nExcluye los ya adoptados, los auto-asignados y los pendientes de moderaci\u00f3n",
                "tags": [
                    "WorkspaceRole"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/RoleTemplate"
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/roles/{id}/permissions": {
            "get": {
                "operationId": "workspaceRole.permissions",
                "summary": "GET /admin/roles/{id}/permissions\nPermisos efectivos de un rol (desde template o desde role_permissions seg\u00fan uses_template_permissions)",
                "tags": [
                    "WorkspaceRole"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "group": {
                                                                "type": "string"
                                                            },
                                                            "permissions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "display_name": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name",
                                                                        "display_name"
                                                                    ]
                                                                }
                                                            }
                                                        },
                                                        "required": [
                                                            "group",
                                                            "permissions"
                                                        ]
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Rol no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/roles/adopt": {
            "post": {
                "operationId": "workspaceRole.adopt",
                "summary": "POST /admin/roles/adopt\nAdopta un template existente \u2192 crea rol workspace-scoped en la aplicaci\u00f3n activa",
                "tags": [
                    "WorkspaceRole"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "template_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "template_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Rol"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Rol adoptado exitosamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/roles/{id}": {
            "put": {
                "operationId": "workspaceRole.update",
                "summary": "PUT /admin/roles/{id}\nActualiza nombre, descripci\u00f3n, nivel y/o permisos de un rol workspace-scoped.\nSi se env\u00edan permisos, el rol pasa a gestionar los suyos propios (uses_template_permissions=false)",
                "tags": [
                    "WorkspaceRole"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "level": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 100
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 7
                                    },
                                    "sync_from_template": {
                                        "type": "boolean"
                                    },
                                    "permissions": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "$ref": "#/components/schemas/Rol"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Rol actualizado exitosamente."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Rol no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "workspaceRole.destroy",
                "summary": "DELETE /admin/roles/{id}\nDescarta rol del workspace (soft-delete + quita de app_config de la aplicaci\u00f3n activa)",
                "tags": [
                    "WorkspaceRole"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Rol descartado. El template persiste en el sistema."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Rol no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/permissions": {
            "get": {
                "operationId": "workspaceRole.allPermissions",
                "summary": "GET /admin/permissions\nTodos los permisos disponibles de la industria del workspace, agrupados por m\u00f3dulo",
                "tags": [
                    "WorkspaceRole"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "group": {
                                                                "type": "string"
                                                            },
                                                            "permissions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "display_name": {
                                                                            "type": "string"
                                                                        },
                                                                        "group": {
                                                                            "type": "string"
                                                                        },
                                                                        "module": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "scope": {
                                                                            "type": "string"
                                                                        },
                                                                        "is_custom": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "min_level": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "name",
                                                                        "display_name",
                                                                        "group",
                                                                        "module",
                                                                        "description",
                                                                        "scope",
                                                                        "is_custom",
                                                                        "min_level"
                                                                    ]
                                                                }
                                                            }
                                                        },
                                                        "required": [
                                                            "group",
                                                            "permissions"
                                                        ]
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "workspaceRole.storePermission",
                "summary": "POST /admin/permissions\nCrea un permiso custom para el workspace",
                "tags": [
                    "WorkspaceRole"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?$",
                                        "maxLength": 100
                                    },
                                    "display_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "group": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "module": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "name",
                                    "display_name",
                                    "group"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 201
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Permission"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Permiso creado exitosamente."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/permissions/check-name": {
            "get": {
                "operationId": "workspaceRole.checkPermissionName",
                "summary": "GET /admin/permissions/check-name\nVerifica disponibilidad de un nombre de permiso",
                "tags": [
                    "WorkspaceRole"
                ],
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "anyOf": [
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "available": {
                                                            "type": "boolean"
                                                        },
                                                        "reason": {
                                                            "type": "null"
                                                        }
                                                    },
                                                    "required": [
                                                        "available",
                                                        "reason"
                                                    ]
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "available": {
                                                            "type": "boolean"
                                                        },
                                                        "reason": {
                                                            "type": "string",
                                                            "const": "Ya existe en este workspace."
                                                        }
                                                    },
                                                    "required": [
                                                        "available",
                                                        "reason"
                                                    ]
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "available": {
                                                            "type": "boolean"
                                                        },
                                                        "reason": {
                                                            "type": "string",
                                                            "const": "En uso por un permiso del sistema."
                                                        }
                                                    },
                                                    "required": [
                                                        "available",
                                                        "reason"
                                                    ]
                                                }
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/permissions/conventions": {
            "get": {
                "operationId": "workspaceRole.filterConventions",
                "summary": "GET /admin/permissions/conventions\nConvenciones de filtros de datos disponibles por m\u00f3dulo.\nIncluye los permisos custom del workspace que ya implementan cada convenci\u00f3n",
                "tags": [
                    "WorkspaceRole"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "module": {
                                                                "type": "string"
                                                            },
                                                            "module_slug": {
                                                                "type": "string"
                                                            },
                                                            "conventions": {
                                                                "anyOf": [
                                                                    {
                                                                        "type": "string"
                                                                    },
                                                                    {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        },
                                                                        "minItems": 0,
                                                                        "maxItems": 0,
                                                                        "additionalItems": false
                                                                    }
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "module",
                                                            "module_slug",
                                                            "conventions"
                                                        ]
                                                    }
                                                },
                                                "message": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/admin/permissions/{id}": {
            "put": {
                "operationId": "workspaceRole.updatePermission",
                "summary": "PUT /admin/permissions/{id}\nActualiza display_name, group, module o description de un permiso custom",
                "tags": [
                    "WorkspaceRole"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "display_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "group": {
                                        "type": "string",
                                        "maxLength": 50
                                    },
                                    "module": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "$ref": "#/components/schemas/Permission"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Permiso actualizado."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Permiso no encontrado o no pertenece a este workspace."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "workspaceRole.destroyPermission",
                "summary": "DELETE /admin/permissions/{id}\nElimina un permiso custom. Rechaza si tiene roles asignados",
                "tags": [
                    "WorkspaceRole"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "success"
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "const": 200
                                                },
                                                "data": {
                                                    "type": "null"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Permiso eliminado."
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "code",
                                                "data",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 422
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Permiso no encontrado."
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/settings/workspace": {
            "get": {
                "operationId": "workspaceSettings.getSettings",
                "summary": "Retorna los datos de la empresa y del workspace para la vista de configuraci\u00f3n",
                "tags": [
                    "WorkspaceSettings"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "workspace": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "slug": {
                                                            "type": "string"
                                                        },
                                                        "description": {
                                                            "type": "string"
                                                        },
                                                        "timezone": {
                                                            "type": "string"
                                                        },
                                                        "branding": {
                                                            "type": "string"
                                                        },
                                                        "logo_url": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "slug",
                                                        "description",
                                                        "timezone",
                                                        "branding",
                                                        "logo_url"
                                                    ]
                                                },
                                                "company": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "legal_name": {
                                                            "type": "string"
                                                        },
                                                        "nit": {
                                                            "type": "string"
                                                        },
                                                        "dba": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "web": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "address": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "legal_name",
                                                        "nit",
                                                        "dba",
                                                        "email",
                                                        "web",
                                                        "phone",
                                                        "address"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "workspace",
                                                "company"
                                            ]
                                        },
                                        "message": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Workspace no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/settings/workspace/company": {
            "put": {
                "operationId": "workspaceSettings.updateCompany",
                "summary": "Actualiza los datos de la empresa y el nombre/descripci\u00f3n del workspace",
                "tags": [
                    "WorkspaceSettings"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "legal_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "nit": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "dba": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 100
                                    },
                                    "web": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 50
                                    },
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "workspace_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "workspace_description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "timezone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 60
                                    }
                                },
                                "required": [
                                    "legal_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "company": {
                                                    "type": "string"
                                                },
                                                "workspace": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "company",
                                                "workspace"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Datos actualizados correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Workspace no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/settings/workspace/logo": {
            "post": {
                "operationId": "workspaceSettings.uploadLogo",
                "summary": "Sube el logo de la empresa al directorio de almacenamiento del workspace.\nGuarda la ruta en workspaces.branding.logo",
                "tags": [
                    "WorkspaceSettings"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application/octet-stream",
                                        "maxLength": 2048
                                    }
                                },
                                "required": [
                                    "logo"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "success"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 200
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "logo_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "logo_url"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Logo actualizado correctamente"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "data",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "error"
                                        },
                                        "code": {
                                            "type": "integer",
                                            "const": 404
                                        },
                                        "error_code": {
                                            "type": "string",
                                            "enum": [
                                                "BAD_REQUEST",
                                                "UNAUTHENTICATED",
                                                "FORBIDDEN",
                                                "NOT_FOUND",
                                                "CONFLICT",
                                                "VALIDATION_FAILED",
                                                "RATE_LIMITED",
                                                "SERVER_ERROR"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Workspace no encontrado"
                                        },
                                        "details": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "error_code",
                                        "message",
                                        "details"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "AgendaLock": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "workspace_id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "starts_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "ends_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "workspace_id",
                    "user_id",
                    "starts_at",
                    "ends_at",
                    "reason",
                    "created_by",
                    "created_at",
                    "updated_at"
                ],
                "title": "AgendaLock"
            },
            "Application": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "code": {
                        "type": "string"
                    },
                    "app_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "industry": {
                        "type": "string"
                    },
                    "industries": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "modules": {
                        "type": "array",
                        "items": {}
                    },
                    "api_prefix": {
                        "type": "string"
                    },
                    "allowed_origins": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "frontend_urls": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "default_plan_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "settings": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "version": {
                        "type": "string"
                    },
                    "webhook_urls": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "requires_subscription": {
                        "type": "integer"
                    },
                    "monthly_cost": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "slug",
                    "code",
                    "app_key",
                    "description",
                    "industry",
                    "industries",
                    "modules",
                    "api_prefix",
                    "allowed_origins",
                    "frontend_urls",
                    "default_plan_id",
                    "settings",
                    "version",
                    "webhook_urls",
                    "status",
                    "requires_subscription",
                    "monthly_cost",
                    "created_at",
                    "updated_at"
                ],
                "title": "Application"
            },
            "ForgotRequest": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email"
                    },
                    "token": {
                        "type": "string"
                    },
                    "password": {
                        "type": "string"
                    },
                    "password_confirm": {
                        "type": "string"
                    }
                },
                "required": [
                    "email",
                    "token",
                    "password",
                    "password_confirm"
                ],
                "title": "ForgotRequest"
            },
            "FormFieldResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "form_group_id": {
                        "type": "string"
                    },
                    "key": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "field_type": {
                        "type": "string"
                    },
                    "placeholder": {
                        "type": "string"
                    },
                    "hint": {
                        "type": "string"
                    },
                    "is_required": {
                        "type": "string"
                    },
                    "is_readonly": {
                        "type": "string"
                    },
                    "sort_order": {
                        "type": "string"
                    },
                    "options": {
                        "type": "string"
                    },
                    "validation": {
                        "type": "string"
                    },
                    "visibility_rules": {
                        "type": "string"
                    },
                    "data_source_key": {
                        "type": "string"
                    },
                    "default_value": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "form_group_id",
                    "key",
                    "label",
                    "field_type",
                    "placeholder",
                    "hint",
                    "is_required",
                    "is_readonly",
                    "sort_order",
                    "options",
                    "validation",
                    "visibility_rules",
                    "data_source_key",
                    "default_value"
                ],
                "title": "FormFieldResource"
            },
            "FormGroupResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "form_section_id": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "layout": {
                        "type": "string"
                    },
                    "sort_order": {
                        "type": "string"
                    },
                    "visibility_rules": {
                        "type": "string"
                    },
                    "is_repeatable": {
                        "type": "boolean"
                    },
                    "fields": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/FormFieldResource"
                        }
                    }
                },
                "required": [
                    "id",
                    "form_section_id",
                    "label",
                    "layout",
                    "sort_order",
                    "visibility_rules",
                    "is_repeatable"
                ],
                "title": "FormGroupResource"
            },
            "FormSectionResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "form_template_id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "icon": {
                        "type": "string"
                    },
                    "sort_order": {
                        "type": "string"
                    },
                    "settings": {
                        "type": "string"
                    },
                    "groups": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/FormGroupResource"
                        }
                    }
                },
                "required": [
                    "id",
                    "form_template_id",
                    "name",
                    "description",
                    "icon",
                    "sort_order",
                    "settings"
                ],
                "title": "FormSectionResource"
            },
            "FormSubmissionResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "form_template_id": {
                        "type": "string"
                    },
                    "form_template_version": {
                        "type": "string"
                    },
                    "process_id": {
                        "type": "string"
                    },
                    "service_id": {
                        "type": "string"
                    },
                    "evaluee_id": {
                        "type": "string"
                    },
                    "submitted_by": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "started_at": {
                        "type": "string"
                    },
                    "completed_at": {
                        "type": "string"
                    },
                    "reviewed_at": {
                        "type": "string"
                    },
                    "reviewed_by": {
                        "type": "string"
                    },
                    "duration_seconds": {
                        "type": "string"
                    },
                    "data": {
                        "type": "string"
                    },
                    "reviewer_notes": {
                        "type": "string"
                    },
                    "template": {
                        "$ref": "#/components/schemas/FormTemplateResource"
                    },
                    "submitter": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name"
                        ]
                    },
                    "evaluee": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            },
                            "first_name": {
                                "type": "string"
                            },
                            "last_name": {
                                "type": "string"
                            },
                            "id_document": {
                                "type": "string"
                            },
                            "type": {
                                "type": "string"
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "name",
                            "first_name",
                            "last_name",
                            "id_document",
                            "type",
                            "email",
                            "phone"
                        ]
                    },
                    "saves": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "form_template_id",
                    "form_template_version",
                    "process_id",
                    "service_id",
                    "evaluee_id",
                    "submitted_by",
                    "status",
                    "started_at",
                    "completed_at",
                    "reviewed_at",
                    "reviewed_by",
                    "duration_seconds",
                    "data",
                    "reviewer_notes"
                ],
                "title": "FormSubmissionResource"
            },
            "FormTemplateResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "settings": {
                        "type": "string"
                    },
                    "submissions_count": {
                        "type": "integer"
                    },
                    "sections": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/FormSectionResource"
                        }
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "slug",
                    "description",
                    "category",
                    "version",
                    "status",
                    "settings",
                    "created_at",
                    "updated_at"
                ],
                "title": "FormTemplateResource"
            },
            "LoginRequest": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email"
                    },
                    "password": {
                        "type": "string",
                        "minLength": 8
                    },
                    "company_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                },
                "required": [
                    "email",
                    "password"
                ],
                "title": "LoginRequest"
            },
            "PaymentIntent": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "uuid": {
                        "type": "string"
                    },
                    "workspace_id": {
                        "type": "integer"
                    },
                    "application_id": {
                        "type": "integer"
                    },
                    "payment_gateway_id": {
                        "type": "integer"
                    },
                    "transaction_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "concept_type": {
                        "type": "string"
                    },
                    "concept_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "amount": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "external_reference": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "checkout_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "idempotency_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "payload": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "created_by": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "uuid",
                    "workspace_id",
                    "application_id",
                    "payment_gateway_id",
                    "transaction_id",
                    "concept_type",
                    "concept_id",
                    "amount",
                    "currency",
                    "status",
                    "external_reference",
                    "checkout_url",
                    "idempotency_key",
                    "payload",
                    "created_by",
                    "created_at",
                    "updated_at"
                ],
                "title": "PaymentIntent"
            },
            "Permission": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "display_name": {
                        "type": "string"
                    },
                    "group": {
                        "type": "string"
                    },
                    "application_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "industries": {
                        "type": "array",
                        "items": {}
                    },
                    "module": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_system": {
                        "type": "boolean"
                    },
                    "scope": {
                        "type": "string"
                    },
                    "min_level": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "workspace_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "display_name",
                    "group",
                    "application_id",
                    "industries",
                    "module",
                    "description",
                    "is_system",
                    "scope",
                    "min_level",
                    "workspace_id",
                    "created_at",
                    "updated_at"
                ],
                "title": "Permission"
            },
            "Person": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "id_document": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "first_name": {
                        "type": "string"
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "nationality": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "gender": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "birth": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "location_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "id_document",
                    "type",
                    "first_name",
                    "last_name",
                    "nationality",
                    "gender",
                    "birth",
                    "email",
                    "phone",
                    "location_id"
                ],
                "title": "Person"
            },
            "Post": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "workspace_id": {
                        "type": "integer"
                    },
                    "app_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "type": {
                        "type": "string"
                    },
                    "author_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "title": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "excerpt": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "thumbnail": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "header_image": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "read_time": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "metadata": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "deleted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "workspace_id",
                    "app_id",
                    "type",
                    "author_id",
                    "title",
                    "slug",
                    "excerpt",
                    "content",
                    "category",
                    "author_name",
                    "thumbnail",
                    "header_image",
                    "read_time",
                    "status",
                    "metadata",
                    "published_at",
                    "created_at",
                    "updated_at",
                    "deleted_at"
                ],
                "title": "Post"
            },
            "ProcessResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "process_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "company_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "company": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "legal_name": {
                                "type": "string"
                            },
                            "dba": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "logo": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "legal_name",
                            "dba",
                            "logo"
                        ]
                    },
                    "person": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "id_document": {
                                "type": "string"
                            },
                            "type": {
                                "type": "string"
                            },
                            "first_name": {
                                "type": "string",
                                "description": "Datos de contacto: workspace override > global"
                            },
                            "last_name": {
                                "anyOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "email": {
                                "anyOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "phone": {
                                "anyOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "global_name": {
                                "type": "string",
                                "description": "Identidad global (referencia para el superadmin)"
                            },
                            "gender": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "birth": {
                                "type": "string"
                            },
                            "address": {
                                "type": "string"
                            },
                            "location_id": {
                                "anyOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "type": "integer"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "location_name": {
                                "type": "string"
                            },
                            "verification_pending": {
                                "type": "boolean",
                                "description": "Flag de verificaci\u00f3n pendiente"
                            },
                            "verification_meta": {
                                "type": [
                                    "object",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "id_document",
                            "type",
                            "first_name",
                            "last_name",
                            "email",
                            "phone",
                            "global_name",
                            "gender",
                            "birth",
                            "address",
                            "location_id",
                            "location_name",
                            "verification_pending",
                            "verification_meta"
                        ]
                    },
                    "cargo": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "location_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "location": {
                        "type": "string"
                    },
                    "data_source_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "data_source": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "key": {
                                "type": "string"
                            },
                            "requires_scheduling": {
                                "type": "boolean"
                            }
                        },
                        "required": [
                            "id",
                            "name",
                            "key",
                            "requires_scheduling"
                        ]
                    },
                    "requires_scheduling": {
                        "type": "boolean"
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "priority": {
                        "type": "string"
                    },
                    "assigned_to": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_name": {
                        "type": "string"
                    },
                    "requested_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "requested_name": {
                        "type": "string"
                    },
                    "result_recipient_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "start_date": {
                        "type": "string"
                    },
                    "end_date": {
                        "type": "string"
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "metadata": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "process_code",
                    "company_id",
                    "company",
                    "person",
                    "cargo",
                    "cost_center",
                    "address",
                    "location_id",
                    "location",
                    "data_source_id",
                    "data_source",
                    "requires_scheduling",
                    "status",
                    "priority",
                    "assigned_to",
                    "assigned_name",
                    "requested_by",
                    "requested_name",
                    "result_recipient_id",
                    "start_date",
                    "end_date",
                    "notes",
                    "metadata",
                    "created_at"
                ],
                "title": "ProcessResource"
            },
            "ProcessReview": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "workspace_id": {
                        "type": "integer"
                    },
                    "process_id": {
                        "type": "integer"
                    },
                    "reviewed_by": {
                        "type": "integer"
                    },
                    "result_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "checks": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "observations": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "corrections": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "result_sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "workspace_id",
                    "process_id",
                    "reviewed_by",
                    "result_key",
                    "checks",
                    "observations",
                    "corrections",
                    "result_sent_at",
                    "created_at",
                    "updated_at"
                ],
                "title": "ProcessReview"
            },
            "Rol": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "template_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "template_version": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "template_applied_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "level": {
                        "type": "integer"
                    },
                    "scope": {
                        "type": "string"
                    },
                    "workspace_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "is_default": {
                        "type": "boolean"
                    },
                    "is_system": {
                        "type": "boolean"
                    },
                    "uses_template_permissions": {
                        "type": "boolean"
                    },
                    "status": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "deleted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "slug",
                    "description",
                    "icon",
                    "color",
                    "template_id",
                    "template_version",
                    "template_applied_at",
                    "level",
                    "scope",
                    "workspace_id",
                    "is_default",
                    "is_system",
                    "uses_template_permissions",
                    "status",
                    "created_at",
                    "updated_at",
                    "deleted_at"
                ],
                "title": "Rol"
            },
            "RoleTemplate": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "application_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "industries": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tags": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "version": {
                        "type": "integer"
                    },
                    "suggested_level": {
                        "type": "integer"
                    },
                    "default_permissions": {
                        "type": "array",
                        "items": {}
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_system": {
                        "type": "boolean"
                    },
                    "global_role_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "moderation_notes": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "reviewed_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "reviewed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "slug",
                    "description",
                    "application_id",
                    "industries",
                    "category",
                    "tags",
                    "version",
                    "suggested_level",
                    "default_permissions",
                    "icon",
                    "color",
                    "is_system",
                    "global_role_id",
                    "status",
                    "moderation_notes",
                    "reviewed_by",
                    "reviewed_at",
                    "created_at",
                    "updated_at"
                ],
                "title": "RoleTemplate"
            },
            "StoreFormFieldRequest": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]*$",
                        "maxLength": 100
                    },
                    "label": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "field_type": {
                        "type": "string",
                        "enum": [
                            "text",
                            "textarea",
                            "number",
                            "email",
                            "date",
                            "time",
                            "datetime",
                            "birth_date",
                            "select",
                            "multiselect",
                            "radio",
                            "checkbox",
                            "boolean",
                            "rating",
                            "scale",
                            "phone",
                            "currency",
                            "percentage",
                            "location_country",
                            "location_state",
                            "location_city",
                            "autocomplete",
                            "file",
                            "signature",
                            "separator",
                            "html_block"
                        ]
                    },
                    "placeholder": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "hint": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500
                    },
                    "is_required": {
                        "type": "boolean"
                    },
                    "is_readonly": {
                        "type": "boolean"
                    },
                    "validation": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "visibility_rules": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "data_source_key": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "default_value": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "group_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "options": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "object",
                            "properties": {
                                "value": {
                                    "type": "string"
                                },
                                "label": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                },
                "required": [
                    "key",
                    "label",
                    "field_type"
                ],
                "title": "StoreFormFieldRequest"
            },
            "StoreFormSubmissionRequest": {
                "type": "object",
                "properties": {
                    "form_template_id": {
                        "type": "integer"
                    },
                    "process_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "service_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "evaluee_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "initial_data": {
                        "type": "object",
                        "description": "Datos iniciales para modo standalone (sin proceso vinculado)",
                        "properties": {
                            "person_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "first_name": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "last_name": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "id_document": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 30
                            },
                            "document_type": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 10
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "email",
                                "maxLength": 100
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            }
                        }
                    }
                },
                "required": [
                    "form_template_id"
                ],
                "title": "StoreFormSubmissionRequest"
            },
            "StoreFormTemplateRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "settings": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "name"
                ],
                "title": "StoreFormTemplateRequest"
            },
            "StoreProcessRequest": {
                "type": "object",
                "properties": {
                    "company_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Contexto del proceso"
                    },
                    "assigned_to": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "requested_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "result_recipient_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "location_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000
                    },
                    "start_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "person": {
                        "type": "object",
                        "description": "Evaluado",
                        "properties": {
                            "id_document": {
                                "type": "string",
                                "maxLength": 30
                            },
                            "type": {
                                "type": "string",
                                "enum": [
                                    "CC",
                                    "CE",
                                    "PAS",
                                    "TI",
                                    "RC",
                                    "NIT",
                                    "DNI",
                                    "PE",
                                    "PPT"
                                ]
                            },
                            "first_name": {
                                "type": "string",
                                "maxLength": 50
                            },
                            "last_name": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 50
                            },
                            "cargo": {
                                "type": "string",
                                "maxLength": 100
                            },
                            "email": {
                                "type": "string",
                                "format": "email",
                                "maxLength": 100
                            },
                            "phone": {
                                "type": "string",
                                "maxLength": 16
                            },
                            "gender": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "M",
                                    "F",
                                    "O"
                                ]
                            },
                            "birth": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "required": [
                            "id_document",
                            "type",
                            "first_name",
                            "cargo",
                            "email",
                            "phone"
                        ]
                    },
                    "data_source_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "minItems": 1
                    },
                    "metadata": {
                        "type": "object",
                        "properties": {
                            "report_recipients": {
                                "type": [
                                    "array",
                                    "null"
                                ],
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "type": {
                                            "type": "string",
                                            "enum": [
                                                "user",
                                                "email"
                                            ]
                                        },
                                        "id": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ]
                                        },
                                        "value": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "email",
                                            "maxLength": 150
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "required": [
                    "person",
                    "data_source_ids"
                ],
                "title": "StoreProcessRequest"
            },
            "StoreUserRequest": {
                "type": "object",
                "properties": {
                    "first_name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                    },
                    "role_id": {
                        "type": "integer"
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "department": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20
                    },
                    "user_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "staff",
                            "client"
                        ]
                    },
                    "company_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                },
                "required": [
                    "first_name",
                    "email",
                    "role_id"
                ],
                "title": "StoreUserRequest"
            },
            "UpdateProcessRequest": {
                "type": "object",
                "properties": {
                    "cargo": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "company_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_to": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "requested_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "result_recipient_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "priority": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "low",
                            "medium",
                            "high",
                            "urgent"
                        ]
                    },
                    "cost_center": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "location_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "start_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "metadata": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "person": {
                        "type": "object",
                        "properties": {
                            "cargo": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "first_name": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 50
                            },
                            "last_name": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 50
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "email",
                                "maxLength": 100
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 16
                            },
                            "location_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        }
                    }
                },
                "title": "UpdateProcessRequest"
            },
            "UpdateUserRequest": {
                "type": "object",
                "properties": {
                    "first_name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "department": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20
                    },
                    "employee_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "role_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "active",
                            "inactive",
                            "suspended"
                        ]
                    },
                    "company_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "company_ids": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "integer"
                        }
                    }
                },
                "title": "UpdateUserRequest"
            },
            "UserResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "account_type": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "user_type": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "workspace_status": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "profile": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "first_name": {
                                "type": "string"
                            },
                            "last_name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "employee_id": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "company_id": {
                                "type": "integer"
                            },
                            "company_name": {
                                "type": "string"
                            },
                            "avatar": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "job_title": {
                                "type": "string",
                                "description": "job_title y department vienen de la empresa principal (workspace_user_companies)"
                            },
                            "department": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "first_name",
                            "last_name",
                            "phone",
                            "employee_id",
                            "company_id",
                            "company_name",
                            "avatar"
                        ]
                    },
                    "companies": {
                        "type": "array",
                        "description": "companies proviene de workspace_user_companies (incluye job_title y department por empresa)",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "legal_name": {
                                    "type": "string"
                                },
                                "job_title": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "department": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "is_primary": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "id",
                                "legal_name",
                                "job_title",
                                "department",
                                "is_primary"
                            ]
                        }
                    },
                    "roles": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "slug": {
                                    "type": "string"
                                },
                                "color": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "icon": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "scope": {
                                    "type": "string"
                                },
                                "level": {
                                    "type": "integer"
                                }
                            },
                            "required": [
                                "id",
                                "name",
                                "slug",
                                "color",
                                "icon",
                                "scope",
                                "level"
                            ]
                        }
                    },
                    "role": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "email",
                    "account_type",
                    "status",
                    "user_type",
                    "workspace_status",
                    "profile",
                    "created_at"
                ],
                "title": "UserResource"
            },
            "WebhookEndpoint": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "workspace_id": {
                        "type": "integer"
                    },
                    "url": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {}
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "last_status": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "last_called_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_by": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "workspace_id",
                    "url",
                    "events",
                    "is_active",
                    "last_status",
                    "last_called_at",
                    "created_by",
                    "created_at",
                    "updated_at"
                ],
                "title": "WebhookEndpoint"
            },
            "WorkModeTemplate": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "application_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "industry_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "key": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "theme_defaults": {
                        "type": "array",
                        "items": {}
                    },
                    "modules_config": {
                        "type": "array",
                        "items": {}
                    },
                    "version": {
                        "type": "string"
                    },
                    "sort_order": {
                        "type": "integer"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "application_id",
                    "industry_key",
                    "name",
                    "key",
                    "description",
                    "theme_defaults",
                    "modules_config",
                    "version",
                    "sort_order",
                    "is_active",
                    "created_at",
                    "updated_at"
                ],
                "title": "WorkModeTemplate"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "AuthenticationException": {
                "description": "Unauthenticated",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "AuthorizationException": {
                "description": "Authorization error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}