> ## Documentation Index
> Fetch the complete documentation index at: https://documentacao.mgnsystem.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Autenticação

> https://utilities.mgnsystem.cloud/ag-control/v1/login

## **Visão Geral**

A autenticação nas APIs da **MGN SYSTEM** é realizada via **JWT (JSON Web Token)**, necessário para todas as requisições autenticadas.

Para obter o token, utilize o endpoint:

Método HTTP: POST `/v1/login`

## Campos

| **Nome**  | **Tipo** | **Descrição**                          |
| :-------- | :------- | :------------------------------------- |
| `email`\* | string   | email do usuário cadastrado no sistema |
| `senha`\* | string   | senha                                  |

## Exemplo

<RequestExample>
  ```json Body theme={null}
  {
    "email": "usuario@empresa.com.br",
    "senha": "sua_senha"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
  	"user": {
  		"id": "43144d52-2393-477c-a28b-503504f8c64f",
  		"aud": "authenticated",
  		"role": "authenticated",
  		"email": "usuario@empresa.com.br",
  		"phone": "",
  		"created_at": "2025-07-05T01:48:19.492219Z",
  		"identities": [
  			{
  				"id": "43844d52-2893-487c-a28b-803504f8864f",
  				"email": "usuario@empresa.com.br",
  				"user_id": "43844d52-2893-487c-a28b-803504f8864f",
  				"provider": "email",
  				"created_at": "2025-07-05T01:48:19.494332Z",
  				"updated_at": "2025-07-05T01:48:19.494332Z",
  				"identity_id": "43844d52-2893-487c-a28b-803504f8864f",
  				"identity_data": {
  					"sub": "43844d52-2893-487c-a28b-803504f8864f",
  					"email": "usuario@empresa.com.br",
  					"email_verified": false,
  					"phone_verified": false
  				},
  				"last_sign_in_at": "2025-07-05T01:48:19.49427Z"
  			}
  		],
  		"updated_at": "2025-07-25T18:43:26.234582Z",
  		"app_metadata": {
  			"provider": "email",
  			"providers": [
  				"email"
  			]
  		},
  		"confirmed_at": "2025-07-05T01:48:19.500015Z",
  		"is_anonymous": false,
  		"user_metadata": {
  			"email_verified": true
  		},
  		"last_sign_in_at": "2025-07-25T18:43:26.225787256Z",
  		"email_confirmed_at": "2025-07-05T01:48:19.500015Z"
  	},
  	"expires_at": 1753472606,
  	"expires_in": 3600,
  	"token_type": "bearer",
  	"access_token": "access_token": "token de acesso",
  	"refresh_token": "dv7t2d73b3vl"
  }
  ```
</ResponseExample>

<Note>
  Certifique-se de que o e-mail esteja cadastrado corretamente no sistema
</Note>
