Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JanContrerasDev/gestor-contrasenas/llms.txt
Use this file to discover all available pages before exploring further.
Error Response Format
The Password Manager API returns errors in a consistent JSON format. All error responses include amessage field describing the error and a status field containing the HTTP status code.
Standard Error Structure
Validation Error Structure
When request validation fails, the API returns a more detailed error response that includes a list of validation errors:HTTP Status Codes
The API uses the following HTTP status codes:Request completed successfully. The response includes the requested data or confirmation message.
The request contains invalid data or missing required fields. Check the
errors object for validation details.The requested resource was not found. This occurs when accessing a password with an invalid ID or when no passwords exist.
An unexpected error occurred on the server, typically during database operations.
Common Error Scenarios
Validation Errors (400)
Validation Errors (400)
Returned when creating a password without required fields.Example Request:Error Response:Required Fields:
password- The password valuesistema- The system identifierusuario- The username associated with the password
Resource Not Found (404)
Resource Not Found (404)
Returned when attempting to access, update, or delete a password that doesn’t exist.Example Request:Error Response:This error occurs in the following endpoints:
GET /api/getPassword/{id}- When password ID doesn’t existPOST /api/updatePassword/{id}- When trying to update non-existent passwordPOST /api/deletePassword/{id}- When trying to delete non-existent passwordGET /api/listPassword- Returns this when no passwords are found
Server Errors (500)
Server Errors (500)
Returned when a database operation fails during password creation.Example Scenario:
Database connection issues or constraint violations during password creation.Error Response:
Error Messages Reference
The following error messages are returned by the API:| Endpoint | Status Code | Message | Description |
|---|---|---|---|
POST /api/createPassword | 400 | Invalid data | Missing or invalid required fields |
POST /api/createPassword | 500 | Error creating password | Database operation failed |
GET /api/listPassword | 404 | No passwords found | No passwords exist in the system |
GET /api/getPassword/{id} | 404 | contraseña no encontrada | Password with specified ID not found |
POST /api/updatePassword/{id} | 404 | contraseña no encontrada | Password with specified ID not found |
POST /api/deletePassword/{id} | 404 | contraseña no encontrada | Password with specified ID not found |
All error responses include both a human-readable
message and a numeric status field that matches the HTTP status code.Best Practices
- Check Status Codes: Always check the HTTP status code to determine the type of error
- Handle Validation Errors: Parse the
errorsobject for field-specific validation messages - Implement Retry Logic: For 500 errors, implement exponential backoff retry logic
- Log Errors: Log error responses for debugging and monitoring purposes
- User-Friendly Messages: Convert technical error messages to user-friendly descriptions in your application