# Ordenes de trabajo

## Obtener listado de OT's

<mark style="color:blue;">`GET`</mark> `https://{clave}.admintotal.com/api/v2/ordenes_servicio/`

#### Headers

| Name    | Type   | Description            |
| ------- | ------ | ---------------------- |
| Api-key | string | Token de autenticación |

#### Query Parameters

| Name   | Type    | Description                                                                                                                                      |
| ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| status | integer | <p>Filtrar las ordenes de trabajo por estado:<br>1 = "Abierta"<br>2 = "En proceso"<br>3 = "Terminada"<br>4 = "Cancelada"<br>5 = "Confirmada"</p> |

{% tabs %}
{% tab title="200 " %}

```
{
    "count": 23,
    "next": "https://{clave}.admintotal.com/api/v2/ordenes_servicio/",
    "previous": null,
    "results": [
        {
            "id": 11106,
            "status": 5,
            "prioridad": null,
            "bitacora_inicio_cliente": null,
            "bitacora_llegada_base": null,
            "descripcion": "<p>MANTENIMIENTO A INMUEBLES MANO DE OBRA</p>",
            "status_display": "Confirmada",
            "clave": "2761-13-1/1",
            "periodicidad": "Mensual",
            "prioridad_display": null,
            "tipo_servicio": "MANO DE OBRA",
            "sucursal": {
                "id": 29,
                "municipio": "Mérida",
                "nombre": "CAC MERIDA IV ORIENTE",
                "cliente": "MICLIENTE",
                "direccion": "Direccion"
            },
            "cliente": {
                "id": 1532,
                "regimen_fiscal": "601",
                "rfc": "XXXXX",
                "razon_social": "MICLIENTE",
                "direccion": "Dirección completa del cliente.",
                "colonia": "Ampliación Granada",
                "nombre": "MICLIENTE",
                "telefono": "(999) 1111-0002",
                "email": "",
                "representante_legal": "MICLIENTE"
            }
        },
        ...
    ]
}
```

{% endtab %}
{% endtabs %}

## Obtener una OT

<mark style="color:blue;">`GET`</mark> `https://{clave}.admintotal.com/api/v2/ordenes_servicio/:id/`

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| ID   | integer | ID de la OT |

#### Headers

| Name    | Type   | Description            |
| ------- | ------ | ---------------------- |
| Api-key | string | Token de autenticación |

{% tabs %}
{% tab title="200 " %}

```json
{
    "id": 11448,
    "status": 5,
    "prioridad": null,
    "bitacora_inicio_cliente": "2026-01-01T09:44:27-06:00",
    "bitacora_llegada_base": "2026-01-27T09:44:27-06:00",
    "descripcion": "<p>FALTA DE AGUA</p>",
    "status_display": "Confirmada",
    "clave": "7136-1-1/1",
    "periodicidad": "-----",
    "prioridad_display": null,
    "tipo_servicio": "TRABAJOS CORRECTIVOS",
    "sucursal": {
        "id": 228,
        "municipio": "Carmen",
        "nombre": "XXXX CD DEL CARMEN",
        "cliente": "Nombre del cliente",
        "direccion": "Dirección ..."
    },
    "cliente": {
        "id": 1547,
        "regimen_fiscal": "601",
        "rfc": "XXXXX",
        "razon_social": "Nombre del cliente",
        "direccion": "Dirección ...",
        "colonia": "Hipódromo Condesa",
        "nombre": "Nombre del cliente",
        "telefono": "(999) 181-4338",
        "email": "",
        "representante_legal": "Nombre del cliente"
    },
    "empleados": [
        {
            "id": 1650,
            "rfc": "XXXXXXXX",
            "nombre": "NOMBRE DEL EMPLEADO",
            "apellido_paterno": "DEL",
            "apellido_materno": "EMPLEADO"
        }
    ],
    "archivos": [
        {
            "id": 554877,
            "url": "https://....",
            "titulo": "Antes del servicio - 20260127_150310.jpg",
            "creado": "2026-01-27T22:20:56.787815+00:00"
        }
    ]
}
 
```

{% endtab %}
{% endtabs %}

## Editar una OT

<mark style="color:purple;">`PATCH`</mark> `https://{clave}.admintotal.com/api/v2/ordenes_servicio/:id/`

#### Request Body

| Name                      | Tipo    | Descripción                                                                                                                |
| ------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| status                    | Integer | <p>Estados disponibles:<br>1 = "Abierta"<br>2 = "En proceso"<br>3 = "Terminada"<br>4 = "Cancelada"<br>5 = "Confirmada"</p> |
| prioridad                 | integer | <p>Prioridad de la OT, opciones disponibles:<br>1 =  "Alta"<br>2 =  "Media"<br>3 =  "Baja"</p>                             |
| descripción               | string  | Descripción de la visita                                                                                                   |
| bitacora\_inicio\_cliente | string  | <p>Formato ISO 8601 ejemplo:<br>2026-01-01T09:44:27-06:00</p>                                                              |
| bitacora\_llegada\_base   | string  | <p>Formato ISO 8601 ejemplo:<br>2026-01-01T09:44:27-06:00</p>                                                              |

{% tabs %}
{% tab title="200 " %}

```json
{
    "id": 11448,
    "status": 5,
    "prioridad": null,
    "bitacora_inicio_cliente": "2026-01-01T09:44:27-06:00",
    "bitacora_llegada_base": "2026-01-27T09:44:27-06:00",
    "descripcion": "<p>FALTA DE AGUA</p>",
    "status_display": "Confirmada",
    "clave": "7136-1-1/1",
    "periodicidad": "-----",
    "prioridad_display": null,
    "tipo_servicio": "TRABAJOS CORRECTIVOS",
    "sucursal": {
        "id": 228,
        "municipio": "Carmen",
        "nombre": "XXXX CD DEL CARMEN",
        "cliente": "Nombre del cliente",
        "direccion": "Dirección ..."
    },
    "cliente": {
        "id": 1547,
        "regimen_fiscal": "601",
        "rfc": "XXXXX",
        "razon_social": "Nombre del cliente",
        "direccion": "Dirección ...",
        "colonia": "Hipódromo Condesa",
        "nombre": "Nombre del cliente",
        "telefono": "(999) 181-4338",
        "email": "",
        "representante_legal": "Nombre del cliente"
    },
    "empleados": [
        {
            "id": 1650,
            "rfc": "XXXXXXXX",
            "nombre": "NOMBRE DEL EMPLEADO",
            "apellido_paterno": "DEL",
            "apellido_materno": "EMPLEADO"
        }
    ],
    "archivos": [
        {
            "id": 554877,
            "url": "https://....",
            "titulo": "Antes del servicio - 20260127_150310.jpg",
            "creado": "2026-01-27T22:20:56.787815+00:00"
        }
    ]
}
 
```

{% endtab %}
{% endtabs %}

## Adjuntar imagen a la Visita de una OT

<mark style="color:$success;">`POST`</mark> `https://{clave}.admintotal.com/api/v2/ordenes_servicio/:id/adjuntar_imagen/`&#x20;

#### Query Parameters

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| ID   | integer | ID de la OT |

#### Headers

| Name    | Type   | Description            |
| ------- | ------ | ---------------------- |
| Api-key | string | Token de autenticación |

#### Request Body

| Name    | Type    | Description                                                                                             |
| ------- | ------- | ------------------------------------------------------------------------------------------------------- |
| titulo  | string  | Título de la imagen                                                                                     |
| proceso | integer | <p>ID del proceso:<br>1 = Antes del servicio<br>2 = Durante el servicio<br>3 = Después del servicio</p> |
| imagen  | string  | Formato: Base64                                                                                         |

{% tabs %}
{% tab title="201" %}

```json
{
    "id": 555417,
    "url": "https://...",
    "titulo": "Imágen antes del servicio",
    "creado": "2026-01-28T17:53:36.346193+00:00"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.admintotal.com/api/ordenes_servicio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
