Standard Response Structure
All API endpoints return a consistent JSON response format:Indicates whether the request was successful (
true) or failed (false)A human-readable message describing the result of the operation
The response payload. Can be:
- An object (for single resource responses)
- An array (for collection responses)
null(for delete operations)
Success Responses
List Resources (200 OK)
When retrieving a collection of resources:200
Messages are localized in Spanish. Examples include:
- “Usuarios listados con éxito” (Users)
- “Secciones listado con éxito” (Sections)
- “Evaluaciones listadas con éxito” (Evaluations)
Get Single Resource (200 OK)
When retrieving a specific resource:200
Create Resource (201 Created)
When successfully creating a new resource:201
Update Resource (200 OK)
When successfully updating a resource:200
Delete Resource (200 OK)
When successfully deleting a resource:200
Delete operations return
null in the data field since the resource no longer exists.HTTP Status Codes
The API uses standard HTTP status codes:| Status Code | Description | When Used |
|---|---|---|
| 200 | OK | Successful GET, PUT, DELETE operations |
| 201 | Created | Successful POST operations |
| 400 | Bad Request | Invalid request data or validation errors |
| 401 | Unauthorized | Missing or invalid authentication token |
| 404 | Not Found | Resource does not exist |
| 422 | Unprocessable Entity | Validation failed on request data |
| 500 | Internal Server Error | Unexpected server error |
Error Responses
When an error occurs, the response format remains consistent but withsuccess: false:
Validation Error (422)
Authentication Error (401)
Not Found Error (404)
Response Messages by Resource
Each resource type has specific success messages:Institutions
- List: “Instituciones listadas con éxito”
- Show: “Institución obtenida con éxito”
- Create: “Institución creada con éxito”
- Update: “Institución actualizada con éxito”
- Delete: “Institución eliminada con éxito”
Users
- List: “Usuarios listados con éxito”
- Show: “Usuario obtenido con éxito”
- Create: “Usuario creado con éxito”
- Update: “Usuario actualizado con éxito”
- Delete: “Usuario eliminado con éxito”
Sections
- List: “Secciones listado con éxito”
- Show: “Sección obtenido con éxito”
- Create: “Sección creado con éxito”
- Update: “Sección actualizado con éxito”
- Delete: “Sección eliminado con éxito”
Evaluations
- List: “Evaluaciones listadas con éxito”
- Show: “Evaluación obtenida con éxito”
- Create: “Evaluación creada con éxito”
- Update: “Evaluación actualizada con éxito”
- Delete: “Evaluación eliminada con éxito”
Other resources (Units, Topics, Resources, Questions, Response Options, Registrations, Evaluation Questions) follow the same message pattern in Spanish.