> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/api-inc-cloud/convencoes.md).

# Convenções

Formato de respostas, datas, paginação e parâmetros comuns.

Regras que valem para todos os endpoints da INC Cloud API.

## Formato das respostas

As respostas vêm em JSON, num envelope comum:

```json
{
  "code": 0,
  "message": "Filtering succeeded.",
  "data": { }
}
```

| Campo     | Descrição                                               |
| --------- | ------------------------------------------------------- |
| `code`    | Código de resultado. `0` indica sucesso.                |
| `message` | Mensagem descritiva. Pode vir vazia em caso de sucesso. |
| `data`    | Conteúdo específico de cada endpoint (objeto ou lista). |

{% hint style="info" %}
Alguns endpoints de dispositivos retornam os dados diretamente, sem o envelope. A referência de cada endpoint mostra o formato exato.
{% endhint %}

## Códigos HTTP

| Código | Significado                                                                  |
| ------ | ---------------------------------------------------------------------------- |
| `200`  | Sucesso. Confira também o campo `code` da resposta.                          |
| `400`  | Requisição inválida: parâmetro obrigatório ausente ou com formato incorreto. |
| `401`  | `apikey` ausente ou inválida.                                                |
| `500`  | Erro interno do servidor.                                                    |

## Datas e horários

Todos os campos de data (`startTime`, `endTime`, `begin_time`, `end_time` etc.) usam **timestamp Unix em milissegundos**.

| Data                      | Timestamp       |
| ------------------------- | --------------- |
| 07/09/2025 00:00:00 (UTC) | `1757203200000` |

## Idioma

Vários endpoints exigem o parâmetro de query `locale`. Envie `locale=en` para receber os textos da resposta em inglês.

## Usuário e sites

* **`user` / `user_name`:** nome do usuário da conta INC Cloud.
* **`shopId` / `shops`:** identificador do **site** (local gerenciado). Obtenha a lista com `GET /user/shop`.
* **`devSN`:** número de série do dispositivo. Obtenha a lista com `POST /shop/device/page`.

## Paginação

A API usa estilos diferentes de paginação, conforme o grupo de endpoints:

| Estilo           | Campos                                                              | Exemplo de endpoint                    |
| ---------------- | ------------------------------------------------------------------- | -------------------------------------- |
| Página e tamanho | `start` (página, começando em 1) e `size`                           | `POST /shop/device/page`               |
| Índice e tamanho | `page_index` e `page_size`                                          | `POST /api/o2oportal/getAuthUserInfo`  |
| Deslocamento     | `skipnum` e `limitnum`                                              | `POST /device/historyclients`          |
| Cursor           | `active` (`firstPage`, `nextPage`, `prePage`, `lastPage`) e `limit` | `POST /stamonitor/getHistoryDayReport` |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://portal-integracao.intelbras.com.br/api-inc-cloud/convencoes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
