Credential Validator
API Contract
REST
/api/v1/validations
7 endpoints
GET
/api/v1/validations/api/v1/validations
List stored validation results with pagination. Useful for audit logs of validation attempts.
Public
Response Example
{
"data": [
{
"id": "val_3c4d5e6f7a8b9c0d",
"field": "email",
"value_hash": "sha256:a3f5b2c9d1e4...",
"is_valid": true,
"errors": [],
"validated_at": "2026-03-26T14:21:50.000Z"
},
{
"id": "val_4d5e6f7g8h9i0j1k",
"field": "password",
"value_hash": "sha256:b4g6c3d0e2f5...",
"is_valid": false,
"errors": [
"Password must be at least 8 characters",
"Password must contain at least one number"
],
"validated_at": "2026-03-26T14:21:55.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/validations/api/v1/validations/:id
Get a specific validation result by ID.
Public
Response Example
{
"id": "val_3c4d5e6f7a8b9c0d",
"field": "email",
"value_hash": "sha256:a3f5b2c9d1e4...",
"is_valid": true,
"errors": [],
"validated_at": "2026-03-26T14:21:50.000Z"
}
POST
/api/v1/validations/api/v1/validations
Validate all credentials at once (validateAll). Returns an array of ValidationResult per field.
Public
Request Example
{
"email": "john.doe@example.com",
"password": "SecurePass@2026!"
}
Response Example
{
"id": "val_5e6f7g8h9i0j1k2l",
"all_valid": true,
"results": [
{
"field": "email",
"is_valid": true,
"errors": []
},
{
"field": "password",
"is_valid": true,
"errors": []
}
],
"validated_at": "2026-03-26T14:22:00.000Z",
"created_at": "2026-03-26T14:22:00.000Z"
}
PUT
/api/v1/validations/api/v1/validations/:id
Update a validation rule entry (e.g. amend error messages or re-run with corrected input).
Public
Request Example
{
"field": "email",
"value_hash": "sha256:a3f5b2c9d1e4...",
"is_valid": true,
"errors": []
}
Response Example
{
"id": "val_3c4d5e6f7a8b9c0d",
"field": "email",
"value_hash": "sha256:a3f5b2c9d1e4...",
"is_valid": true,
"errors": [],
"validated_at": "2026-03-26T14:21:50.000Z",
"updated_at": "2026-03-26T14:35:00.000Z"
}
DELETE
/api/v1/validations/api/v1/validations/:id
Delete a stored validation result from audit records.
Public
Response Example
{
"deleted": true,
"id": "val_3c4d5e6f7a8b9c0d"
}
POST
/api/v1/validations/api/v1/validations/email
Validate only the email field (validateEmail). Returns a single ValidationResult.
Public
Request Example
{
"email": "john.doe@example.com"
}
Response Example
{
"field": "email",
"is_valid": true,
"errors": []
}
POST
/api/v1/validations/api/v1/validations/password
Validate only the password field (validatePassword). Returns a single ValidationResult.
Public
Request Example
{
"password": "weak"
}
Response Example
{
"field": "password",
"is_valid": false,
"errors": [
"Password must be at least 8 characters",
"Password must contain at least one uppercase letter",
"Password must contain at least one number"
]
}