Brick uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.). Codes in the 5xx range indicate an error with Brick’s servers (these are rare).
Error Object
Always verify the response bodyThe return of the request will show the reason why it was not allowed by Brick's servers.
The erros inside Brick API will always be returned with the following schema:
{
"code": "<UPPER_CASE_STRING>",
"message": "Human readable string"
}The response body, as we saw at the Standard Returns section, will always return the same schema. Therefore, every request to Brick API will receive a list of Errors Objects as return. It can be empty or it can have values.
{
"data": null,
"status": 400,
"errors": [
{
"code": "RECORD_MISSING_DOCUMENT",
"message": "Document not found!"
},
{
"code": "RECORD_MISSING_ENTITY_TYPE",
"message": "Entity type is required when creating a Record. It must be PF/PJ"
}
]
}
Standard Errors
4xx Client Error
| Status | Code | Description |
|---|---|---|
| 400 | it will vary a lot | The server will not process the request due to an erro inside the customer request |
| 401 | UNAUTHORIZED | The servir did not allowed the request. Bearer Token invalid. |
| 403 | FORBIDDEN | The server did not allowed the request. The Bearer Token did not had permissions to perform that action. |
| 404 | NOT_FOUND | The server did not found the resource |
5xx Server Error
| Status | Code | Description |
|---|---|---|
| 500 | INTERNAL_SERVER_ERROR | An unexpected error occurred |
Brick API has a system to monitor 500 status code errors.
Specific Errors
Create Record Errors
| Codigo | Motivo |
|---|---|
| USER_NOT_FOUND | Usuário não encontrado |
| DOCUMENT_NOT_FOUND | Documento não encontrado |
| ENTITY_TYPE_NOT_FOUND | Tipo de entidade não encontrado |
| BUNDLES_NOT_FOUND | Bundles não encontrados |
| CREDIT_VARIANT_NOT_FOUND | Variante de crédito não encontrada |
| ORIGIN_NOT_FOUND | Origem não encontrada |
| FACIAL_BIOMETRY_NOT_ALLOWED_FOR_PJ | Biometria facial não permitida para PJ |
| CNH_NR_NOT_FOUND | CNH não encontrada |
| FACIAL_BIOMETRY_METHOD_NOT_FOUND | Método de biometria facial não encontrado |
| PHOTO_NOT_FOUND | Foto não encontrada |
| PDF_NOT_SUPPORTED | PDF não suportado |
| LIVENESS_METHOD_SHOULD_BE_LINK | Método de biometria com liveness deve ser LINK |
| NIS_NOT_FOUND | NIS não encontrado |
| INVALID_FACE_AMOUNT | Quantidade de faces inválida |
| FACE_OCCLUDED | Face oculta |
| FACE_TOO_DARK | Face muito escura |
| FACE_DETECTION_FAILED | Falha na detecção de face |
| FAILED_TO_CROP_IMAGE | Falha ao cortar imagem |
| FAILED_TO_SAVE_RECORD | Falha ao salvar cadastro |
| FAILED_TO_TRIGGER_ANALYSES | Falha ao disparar análises |
| PERSON_BLOCKED_GOVERNMENT_OFFICIAL | Pessoa bloqueada oficial de governo |
| PERSON_BLOCKED_JUDICIAL_REQUEST | Pessoa bloqueada por solicitação judicial |
| PERSON_BLOCKED_REQUEST | Pessoa bloqueada por solicitação |
| PERSON_BLOCKED_GOVERNMENT_MINISTER | Pessoa bloqueada ministro de governo |
| PERSON_BLOCKED_STF_STJ_MINISTER | Pessoa bloqueada ministro do STF ou STJ |
| PERSON_BLOCKED_ARMED_FORCES_COMMANDER | Pessoa bloqueada comandante das forças armadas |
| BASIC_DATA_NOT_FOUND | Dados básicos não encontrados |
Find Record By Id Errors
| Código | Descrição |
|---|---|
| USER_NOT_FOUND | Usuário logado não encontrado |
| RECORD_ID_NOT_FOUND | ID do cadastro não encontrado na input |
| RECORD_NOT_FOUND | Cadastro não encontrado |
Support
If you are having trouble with our API, please reach us through our support number with the largest amount of details as possible.
Here are a few informations that might help us debug it:
- The Environment
- Request Path
- Request Method
- HTTP error code
- JSON sent
- JSON received
- The time of the request
- Print screen
- Origin IP