> For the complete documentation index, see [llms.txt](https://docs.gestao.plus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gestao.plus/api/public/login.md).

# Login

## Login

<mark style="color:green;">`POST`</mark> `https://api.gestao.plus/oauth`

Através desta rota o seu parceiro é capaz de logar na api, um **token** será devolvido como resposta para que ele possa realizar futuras requisições em rotas privadas.

#### Headers

| Name                                           | Type   | Description                      |
| ---------------------------------------------- | ------ | -------------------------------- |
| Origin                                         | string | <https://suaempresa.gestao.plus> |
| Content-Type<mark style="color:red;">\*</mark> | string | application/json                 |

#### Request Body

| Name                                            | Type   | Description                            |
| ----------------------------------------------- | ------ | -------------------------------------- |
| password<mark style="color:red;">\*</mark>      | string | A sua senha                            |
| username<mark style="color:red;">\*</mark>      | string | O seu nome de usuário geralmente o CPF |
| client:secret<mark style="color:red;">\*</mark> | string | null                                   |
| client:id<mark style="color:red;">\*</mark>     | string | "app"                                  |
| grant:type<mark style="color:red;">\*</mark>    | string | "password"                             |

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

```
{
    "access_token": "SEU TOKEN",
    "expires_in": "43200",
    "token_type": "Bearer",
    "scope": "",
    "refresh_token": "SEU REFRESH TOKEN"
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "invalid_client",
    "status": 400,
    "detail": "DESCRIÇÃO SOBRE O ERRO"
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "invalid_grant",
    "status": 401,
    "detail": "Invalid username and password combination"
}
```

{% endtab %}
{% endtabs %}
