> For the complete documentation index, see [llms.txt](https://expedy.gitbook.io/openapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://expedy.gitbook.io/openapi/master.md).

# Open API Expedy

URL Base para o ambiente de ***testes:*** `https://api.expedy.com.br/test`

URL Base para o ambiente de ***produção:*** `https://api.expedy.com.br`

Com isso utilizando o endpoint de testes, será usado um banco de dados diferente da produção, que não tem correlação com a produção, não afetando a mesma

## Autenticação

<mark style="color:green;">`POST`</mark> `/auth`

Endpoint para autenticação

#### Headers

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

#### Request Body

| Name                                          | Type   | Description        |
| --------------------------------------------- | ------ | ------------------ |
| companyCode<mark style="color:red;">\*</mark> | String | Código da empresa. |
| login<mark style="color:red;">\*</mark>       | String | Usuário.           |
| password<mark style="color:red;">\*</mark>    | String | Senha.             |

{% tabs %}
{% tab title="200 Exemplo de Response." %}

```
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aXBvIjoidXNlciIsImlkIjo0LCJuYW1lIjoiR1ZNIiwibG9naW4iOiJ0ZXN0ZUB0ZXN0ZS5jb20iLCJlbWFpbCI6InRlc3RlQHRlc3RlLmNvbSIsImNvbXBhbnkiOjQsInBlcm1pc3Npb25zIjpbXSwiaWF0IjoxNjMzOTUzOTAzLCJleHAiOjE2MzQ1NTg3MDN9.NaE8DwrTh8x4Li0k9X8BZYw9JqBQ7GJgbXCEeS2T05U",
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NCwiaWF0IjoxNjMzOTUzOTAzfQ.iAN74Yixt6F_ZrED06g_CVDX641VWQ_ODEDEjf8Y5Jw",
  "date_expiration_access_token": "2021-10-18 09:05:03",
  "date_expiration_refresh_token": "2021-10-25 09:05:03"
}
```

{% endtab %}
{% endtabs %}

## Signup Company

<mark style="color:green;">`POST`</mark> `/auth/signup/company`

Endpoint para criar uma conta para a Empresa.

#### Request Body

| Name                                                   | Type   | Description             |
| ------------------------------------------------------ | ------ | ----------------------- |
| name<mark style="color:red;">\*</mark>                 | String | Nome da empresa.        |
| email<mark style="color:red;">\*</mark>                | String | E-mail da empresa.      |
| document<mark style="color:red;">\*</mark>             | String | CPF ou CNPJ da empresa. |
| password<mark style="color:red;">\*</mark>             | String | Senha.                  |
| passwordConfirmation<mark style="color:red;">\*</mark> | String | Confirmação da Senha.   |
| login<mark style="color:red;">\*</mark>                | String | Login da Empresa.       |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
	"company": {
		"name": "Test Company",
		"email": "companytest@gmail.com",
		"document": "",
		"password": "",
		"users": [],
		"createdAt": "2022-01-03T18:19:47.861Z",
		"updatedAt": "2022-01-03T18:19:47.861Z",
		"code": 4,
		"id": 4
	}
}
```

{% endtab %}
{% endtabs %}

## Signup User

<mark style="color:green;">`POST`</mark> `/auth/signup/user`

Endpoint para criar conta de Usuário.

#### Request Body

| Name                                                   | Type   | Description                                                                                          |
| ------------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------- |
| company<mark style="color:red;">\*</mark>              | Number | ID da Empresa que será vinculado o usuário (mesmo id retornado no endpoint de cadastro de empresas). |
| login<mark style="color:red;">\*</mark>                | String | Login do Usuário.                                                                                    |
| name<mark style="color:red;">\*</mark>                 | String | Nome do Usuário.                                                                                     |
| email<mark style="color:red;">\*</mark>                | String | Email do Usuário.                                                                                    |
| password<mark style="color:red;">\*</mark>             | String | Senha do Usuário.                                                                                    |
| passwordConfirmation<mark style="color:red;">\*</mark> | String | Confirmação da Senha do Usuário.                                                                     |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
	"message": "created"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://expedy.gitbook.io/openapi/master.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.
