# Modificar estado de formulario

Para modificar el estado de un formulario en Persat, se debe enviar un PUT como el que se especifica a continuación.

<mark style="color:orange;">`PUT`</mark> `https://api.persat.com.ar/v1/digital-forms/state/form_id`

#### Path Parameters

| Name                                       | Type   | Description                  |
| ------------------------------------------ | ------ | ---------------------------- |
| form\_id<mark style="color:red;">\*</mark> | String | Identificador del formulario |

#### Headers

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

#### Request Body

| Name                                        | Type   | Description                                  |
| ------------------------------------------- | ------ | -------------------------------------------- |
| state\_id<mark style="color:red;">\*</mark> | Number | Identificador del nuevo estado de formulario |

{% hint style="warning" %}
El  nuevo estado debe corresponder al grupo de formulario o la consulta retornará error. para poder listar los estados disponibles ir a la sección [Listar Estados](/modulos/formularios-digitales/estados-de-formulario/listar-estados.md)
{% endhint %}

{% tabs %}
{% tab title="200: OK La consulta se ejecutó con éxito" %}

```json
{
    "success": true,
    "data": {
        "_id": "197",
        "created": "2024-10-31T10:17:26.000Z",
        "created_by_user_name": "test@gmail.com",
        "created_by_user_id": 78,
        "state": {
            "color": "BLUE",
            "deleted": false,
            "id": 26,
            "name": "Listo"
        },
        "client": {...},
        "df_data": {...}
        }
    }
}
```

{% endtab %}

{% tab title="409: Bad Request Error en alguno de los campos enviados. userMessage contiene informacipon adicional." %}

```json
{
    "success": false,
    "error": {
        "status": 409,
        "type": "CONFLICT",
        "userMessage": "El estado con id '11' no pertenece al grupo de formulario '14' del formulario '197'"
    }
}
```

{% endtab %}

{% tab title="404: Not Found estado no existe" %}

```json
{
    "success": false,
    "error": {
        "status": 404,
        "type": "NOT_FOUND",
        "userMessage": "No hay estado de formulario con id: 123"
    }
}
```

{% endtab %}

{% tab title="404: Not Found Formulario no existe" %}

```javascript
{
    "success": false,
    "error": {
        "status": 404,
        "type": "NOT_FOUND",
        "userMessage": "No hay un formulario con id:'123'"
    }
}
```

{% endtab %}
{% endtabs %}

### Analizando la respuesta

Es la misma respuesta que al [Obtener formulario](/modulos/formularios-digitales/obtener-formulario.md).


---

# 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/modulos/formularios-digitales/estados-de-formulario/modificar-estado-de-formulario.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.
