# Erros e Respostas

## Possíveis Status & Respostas

<table><thead><tr><th width="136" data-type="number">STATUS</th><th>DESCRIÇÃO</th><th>RESULTADO</th></tr></thead><tbody><tr><td>200</td><td><strong>Success</strong><br>Pedido efectuado com sucesso</td><td>Lista de registos encontrados</td></tr><tr><td>201</td><td><strong>Created</strong><br>Registo criado com sucesso</td><td>GET Registo</td></tr><tr><td>204</td><td><strong>No Content</strong><br>Pedido processado com sucesso mas sem resposta.</td><td>(Sem Resposta)</td></tr><tr><td>400</td><td><strong>Bad Request</strong><br>Existem parâmetros inválidos ou inexistentes.</td><td>Lista de erros detectados</td></tr><tr><td>401</td><td><strong>Access Denied</strong><br>Token inválido ou inexistente</td><td>(Sem Resposta)</td></tr><tr><td>403</td><td><strong>Forbidden</strong><br>Não tem permissões para aceder a este endpoint.</td><td>(Sem Resposta)</td></tr><tr><td>404</td><td><strong>Not Found</strong><br>Registo não encontrado.</td><td>(Sem Resposta)</td></tr><tr><td>405</td><td><strong>Method Not Allowed</strong><br>Método não é permitido para este endpoint.</td><td>(Sem Resposta)</td></tr></tbody></table>

## Exemplo de Resposta com Erro

Em caso de erro, qualquer que seja o tipo de erro, a API CloudInvoice responde, habitualmente, com um código `400 Bad Request`.

```json
{
    "errors": [
        {
            "message": "Este campo deve ser um inteiro",
            "code": "invalid",
            "field": "code"
        },
        {
            "message": "Este campo é obrigatório.",
            "code": "invalid",
            "field": "customer_name"
        }
    ]
}
```

<br>


---

# Agent Instructions: 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://apidocs.cloudinvoice.net/introducao/erros-e-respostas.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.
