# Crear seguimientos

Para crear un seguimiento se debe realizar un POST como el que se muestra a continuación.

<mark style="color:green;">`POST`</mark> `https://api.persat.com.ar/v1/follow_ups`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer API\_KEY  |

#### Request Body

<table><thead><tr><th width="254">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>uid_client<mark style="color:red;">*</mark></td><td>string</td><td>El número/identificador de cliente (es un valor alfanumérico).</td></tr><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Título del seguimiento.</td></tr><tr><td>responsible_user_ids<mark style="color:red;">*</mark></td><td>number[]</td><td>Listado de ids de usuarios responsables del seguimiento. Mínimo 1 responsable.</td></tr><tr><td>color<mark style="color:red;">*</mark></td><td>string</td><td>Color identificador del seguimiento. Ver colores disponibles en la siguiente sección.</td></tr><tr><td>date<mark style="color:red;">*</mark></td><td>string</td><td>Fecha del seguimiento en formato ISO, debe ser una fecha futura. Ejemplo: 2021-09-09T14:30:00.000Z.</td></tr><tr><td>description</td><td>string</td><td>Descripción del seguimiento.</td></tr><tr><td>send_email_minutes_before</td><td>number</td><td>Minutos previos a la fecha en los que se envía un email a los responsables. Ver minutos disponibles en la siguiente sección. Si no está presente no se envía mail.</td></tr></tbody></table>

### Aclaraciones sobre el request

**Listado de colores disponibles.**

<figure><img src="/files/B1KsJp69WQC4nOw6rq0S" alt=""><figcaption><p>Listado en la app web</p></figcaption></figure>

* RED
* ORANGE
* YELLOW
* GREEN
* BLUE
* PINK
* BLACK

**Listado de minutos disponibles.**

<div align="center" data-full-width="false"><figure><img src="/files/EO6dmE88RNmX7OzzwKPn" alt="" width="296"><figcaption><p>Listado en la app web</p></figcaption></figure></div>

* 0 (en el momento del seguimiento)
* 10
* 20
* 30
* 45
* 60 (1 hora)
* 120 (2 horas)
* 180 (3 horas)
* 240 (4 horas)
* 300 (5 horas)
* 1440 (1 día)
* 2880 (2 días)
* 4320 (3 días)
* 5760 (4 días)
* 10080 (1 semana)

{% hint style="danger" %}
IMPORTANTE: los usuarios responsables deben tener habilitado el grupo de cliente correspondiente al cliente que se le asigna el seguimiento. Ver "**group\_id**" en [Obtener un Cliente](/entidades-basicas/clientes/obtener-un-cliente.md).
{% endhint %}

{% tabs %}
{% tab title="200 El seguimiento fue creado" %}

```javascript
{
    "success": true,
    "data": {
        "id": 33,
        "uid_client": "CL-0044",
        "title": "Llamar",
        "description": "",
        "color": "RED",
        "responsible_user_ids": [
            1,
            2,
            3
        ],
        "send_email": false,
        "date": "2026-01-01T00:00:00.000Z"
    }
}

```

{% endtab %}

{% tab title="400 campos obligatorios" %}

```javascript
{
    "success": false,
    "error": {
        "status": 400,
        "type": "BAD_REQUEST",
        "userMessage": "'uid_client' debe ser un string"
    }
}
```

{% endtab %}

{% tab title="404 Cliente no encontrado" %}

```javascript
{
    "success": false,
    "error": {
        "status": 409,
        "type": "CONFLICT",
        "userMessage": "No existe el cliente con uid: 'CL-0044'"
    }
}
```

{% endtab %}

{% tab title="409: Conflict los responsables no tienen permitido ver el grupo de cliente" %}

```javascript
{
    "success": false,
    "error": {
        "status": 409,
        "type": "CONFLICT",
        "userMessage": "Los usuarios con id 1,2. No tienen permitido ver el cliente"
    }
}
```

{% endtab %}
{% endtabs %}

### Ejemplo de request

En este ejemplo insertamos un seguimiento, que incluye envío de email 2 horas antes de la fecha del seguimiento.

### body

```json
{
    "title": "Llamar",
    "description": "Realizar nota de pedido",
    "uid_client": "CL-0044",
    "color": "ORANGE",
    "date": "2030-02-01T20:00:00.000Z",
    "responsible_user_ids": [1,2,52],
    "send_email_minutes_before": 120 
}
```

{% hint style="info" %}
**date:** Si bien la fecha esta representada en UTC, hay que considerarla en <mark style="color:blue;">**horario local**</mark>. Entonces para el caso del ejemplo, y sin importar si soy un cliente de Argentina, Ecuardor o Mexico, la fecha del evento representa el día 1 de Febrero de 2023 hora de mi país

```
"date": "2030-02-01T20:00:00.000Z",
```

{% endhint %}

### Analizando la Respuesta

En caso que no haya ningun error, obtenemos

```json
{
    "success": true,
    "data": {
        "id": 35,
        "uid_client": "CL-0044",
        "title": "Llamar",
        "description": "Realizar nota de pedido",
        "color": "ORANGE",
        "responsible_user_ids": [
            1,
            2,
            52
        ],
        "date": "2030-02-01T20:00:00.000Z",
        "send_email_minutes_before": 120,
        "send_email": true
    }
}
```

**id:** Identificador del seguimiento.

**uid\_client:** identificador alfanumérico del cliente.

&#x20;**title:** título del seguimiento.

**description:** descripción del seguimiento.

**color:** color del seguimiento.

**responsible\_user\_ids:** ids de los usuarios responsables del seguimiento.

**date:** fecha del seguimiento.

{% hint style="info" %}
Si bien la fecha esta representada en UTC, hay que considerarla en <mark style="color:blue;">**horario local**</mark>. Entonces para el caso del ejemplo, y sin importar si soy un cliente de Argentina, Ecuardor o Mexico, la fecha mostrada representa el día 1 de Febrero de 2023 hora de mi país

```
"date": "2030-02-01T20:00:00.000Z",
```

{% endhint %}

**send\_email:** booleano que indica si se enviará email

**send\_email\_minutes\_before:** los minutos previos a la fecha en los que se va a enviar un mail a los responsables en forma de aviso del seguimiento. En este ejemplo se enviaría el 2030-02-01T18:00:00.000Z.

{% hint style="danger" %}
**send\_email\_minutes\_before** solo estará presente cuando send\_email sea 'true'
{% endhint %}


---

# 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://docs.api.persat.com.ar/entidades-basicas/seguimientos/crear-seguimientos.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.
