> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orkeia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Histórico de Setor Específico

> Retorna o histórico de mudanças de um setor específico.

## Endpoint

`GET https://gateway.orkeia.ai/sectors/{id}/history`

**Autenticação**\
Requer cabeçalho `authorization:  <seu_token>`.

## Parâmetros de Caminho

| Nome | Tipo   | Obrigatório | Descrição                     | Exemplo       |
| ---- | ------ | ----------- | ----------------------------- | ------------- |
| id   | string | Sim         | Identificador único do setor. | SECTOR\_12345 |

## Exemplo (cURL)

```bash theme={null}
curl -X GET "https://gateway.orkeia.ai/sectors/SECTOR_12345/history" \
  -H "authorization:  <seu_token>"
```

## Respostas

### Response - Success

```json response theme={null}
{
  "status": "OK",
  "data": [
    {
      "id": "hist_001",
      "responsible": "admin@orkeia.ai",
      "action": "updated sector",
      "type": "neutral",
      "date": "2024-07-22T18:00:00.000Z",
      "changes": { "name": "Novo nome" }
    }
  ]
}
```

### 500 — Server Error

```json theme={null}
{
  "status": "ERROR",
  "code": "server/error",
  "data": null
}
```

### 400 — Client Error

```json theme={null}
{
  "status": "ERROR",
  "code": "client/error",
  "data": null
}
```

## Campos do Histórico

| Nome        | Tipo   | Descrição                                                              |
| ----------- | ------ | ---------------------------------------------------------------------- |
| id          | string | Identificador único do evento de histórico.                            |
| responsible | string | Nome/usuário responsável pela alteração.                               |
| action      | string | Ação registrada (ex.: created sector, updated sector, deleted sector). |
| type        | string | Classificação do evento (`success`, `fail`, `neutral`).                |
| date        | Date   | Data e hora da alteração.                                              |
| changes     | object | Mudanças realizadas nos campos do setor, quando aplicável.             |
