Skip to content

Errors

HTTP Status Codes

These status codes are used across all endpoints to indicate the general outcome of a request.

Code Status Description
200 OK The request was successful and the response contains data.
201 Created A new resource was created successfully (e.g. after POST /workplaces).
204 No Content The request was successful with no body to return (e.g. after DELETE /workplaces/{id}).
401 Unauthorized The X-Api-Key header is missing, expired, or invalid.
404 Not Found The requested resource does not exist or does not belong to your account.
405 Method Not Allowed The HTTP method used is not supported by this endpoint.
422 Unprocessable Entity The request body failed validation. The response body contains field-level error details.
500 Internal Server Error An unexpected server-side error occurred.

Validation Errors (422)

When a request body fails validation the API returns 422 with a JSON body listing each field and its errors:

{
  "success": false,
  "errors": {
    "genero": ["Genero is invalid."],
    "estado": ["Estado cannot be blank."]
  }
}

For REST resources (e.g. Workplaces) the format is an array of objects:

[
  { "field": "name", "message": "Name cannot be blank." },
  { "field": "country", "message": "Country must be an integer." }
]

Application-Level Error Codes

Several endpoints (Events, Extras) return a code field in the response body instead of using HTTP error codes.

Code Meaning
0 Success
1 Error — see the message field for details

Application-Level Error Messages

Message Endpoint(s) Cause
Marca actualizada correctamente POST /actualizar-marca Attendance mark updated successfully
Planificacion no encontrada POST /actualizar-marca, POST /agregar-evento, POST /modificar-evento, POST /borrar-evento The planning record ID does not exist or belongs to a different account
Evento extra agregado correctamente POST /agregar-evento Extra event added successfully
Evento extra modificado correctamente POST /modificar-evento Extra event updated successfully
Evento extra borrado correctamente POST /borrar-evento Extra event deleted successfully
Evento extra no encontrado POST /modificar-evento, POST /borrar-evento The extra event ID does not exist on the given planning record
Invalid request POST /actualizar-marca, POST /agregar-evento, POST /modificar-evento, POST /borrar-evento The request method or body is invalid
Archivo guardado POST /recibo-importar File uploaded and stored successfully
Archivo ya existente POST /recibo-importar A file with the same name already exists for this employee and period
Persona no esta activa en el cliente POST /recibo-importar The employee was not found or is inactive in your account
Error al guardar POST /recibo-importar An unexpected server error occurred while saving the file

Date Range Errors

Endpoints that accept from / to query parameters return a JSON error body (not an HTTP error code) when the range is invalid:

Error Cause
{"error": "The time interval cannot be negative"} to is earlier than from
{"error": "The time interval cannot be greater than a month"} The range spans more than one calendar month