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

# Analisar Relatório Manualmente

> Registra uma decisão manual (aprovado/negado com justificativa) sobre um relatório existente.

### Quando usar

Use este endpoint quando um usuário precisa **registrar manualmente** a decisão de um relatório, sobrescrevendo ou complementando o resultado automático da política. É a ação que um analista dispara no Toolbox ao aprovar/negar com justificativa (ex.: "aprovado por relacionamento comercial", "negado por política interna de risco").

<Info>
  Esta chamada **não** reprocessa nem recoleta dados das fontes — ela apenas registra a decisão humana. Para refazer uma análise manual já existente, use `POST /report/re-analyze`.
</Info>

### Autenticação

Bearer JWT no header `Authorization`.

### Parâmetros

| Nome         | Local  | Tipo      | Obrigatório | Descrição                                                     |
| ------------ | ------ | --------- | ----------- | ------------------------------------------------------------- |
| `id`         | `body` | `string`  | `sim`       | ID do relatório que receberá a análise manual.                |
| `approved`   | `body` | `boolean` | `sim`       | Decisão do analista: `true` para aprovar, `false` para negar. |
| `commentary` | `body` | `string`  | `sim`       | Justificativa/parecer do analista sobre a decisão.            |

### Corpo da requisição

```json theme={null}
{
  "id": "69a207bcdd0197828df9155a",
  "approved": true,
  "commentary": "Aprovado após análise manual."
}
```

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://gyra-core.gyramais.com.br/report/analyze' \
  --header 'Authorization: Bearer abc123' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "id": "69a207bcdd0197828df9155a",
    "approved": true,
    "commentary": "Aprovado após análise manual."
  }'
  ```

  ```javascript JavaScript theme={null}
  fetch("https://gyra-core.gyramais.com.br/report/analyze", {
    method: "POST",
    headers: {
      "Authorization": "Bearer abc123",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      id: "69a207bcdd0197828df9155a",
      approved: true,
      commentary: "Aprovado após análise manual."
    })
  })
    .then(res => res.json())
    .then(console.log)
  ```

  ```python Python theme={null}
  import requests

  url = "https://gyra-core.gyramais.com.br/report/analyze"
  headers = {
    "Authorization": "Bearer abc123",
    "Content-Type": "application/json"
  }
  payload = {
    "id": "69a207bcdd0197828df9155a",
    "approved": True,
    "commentary": "Aprovado após análise manual."
  }
  response = requests.post(url, headers=headers, json=payload)
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "69a207bcdd0197828df9155a",
    "analystId": "6610684663774970a8cf738d",
    "analystName": "Usuário API",
    "policyStatus": "APPROVED",
    "commentary": "Aprovado após análise manual.",
    "status": {
      "id": "6614758260513064a5af1044",
      "value": "APPROVED",
      "title": "Aprovado"
    },
    "updatedAt": "2026-02-27T21:12:10.110Z"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "code": 400,
    "message": "id should not be empty,id must be a string,approved should not be empty,approved must be a boolean value"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "code": 401,
    "message": "Token de acesso inválido."
  }
  ```
</ResponseExample>
