# Authentication

A autenticação é parte essencial para garantir a **segurança** das ações realizadas no sistema.&#x20;

{% hint style="info" %}
É possível **armazenar e reutilizar** o token
{% endhint %}

## signIn

<mark style="color:green;">`POST`</mark> `/cognito/user/signIn`

**API utilizada para gerar um token** para então consumir as API's que necessitam da autenticação.&#x20;

#### Request Body

| Name     | Type   | Description             |
| -------- | ------ | ----------------------- |
| email    | string | email para autenticação |
| password | string | senha para autenticação |

{% tabs %}
{% tab title="200 Autenticação realizada. Token pode ser utilizado nas próximas chamadas.

Atributos:
token: bearer token,
expiration: new Date(value \* 1000) | duração 60 minutos" %}

```
{
    "token": <token> : String,
    "expiration": <expiration> : number
}
```

{% endtab %}

{% tab title="400 O parâmetro enviado é inválido " %}

```
{
    "error": "BadRequest: Invalid parameters provided: email"
}
```

{% endtab %}

{% tab title="404 Usuário não cadastrado" %}

```
{
    "message": "User does not exist."
}
```

{% 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://docs.workflow.d1.cx/configuracoes/authentication.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.
