Contact Form Validator
API Contract
REST
/api/v1/contact-validation
8 endpoints
GET
/api/v1/contact-validation/api/v1/contact-validation
List validation rule configurations
Public
Response Example
{
"data": [
{
"rule_id": "vr-001",
"field": "email",
"rule_type": "format",
"description": "Must be a valid email address",
"active": true
},
{
"rule_id": "vr-002",
"field": "phone",
"rule_type": "format",
"description": "Must be a valid Norwegian phone number",
"active": true
},
{
"rule_id": "vr-003",
"field": "chapter_affiliations",
"rule_type": "count",
"description": "Maximum 5 chapter affiliations per contact",
"active": true
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 3
}
}
GET
/api/v1/contact-validation/api/v1/contact-validation/:id
Get a specific validation rule
Public
Response Example
{
"rule_id": "vr-001",
"field": "email",
"rule_type": "format",
"description": "Must be a valid email address",
"active": true
}
POST
/api/v1/contact-validation/api/v1/contact-validation/validate
Validate a full contact edit payload (validateContactForm)
Public
Request Example
{
"first_name": "Ingrid",
"last_name": "Solberg",
"email": "ingrid.s@updated.no",
"phone": "+47 912 34 567",
"address": "Storgata 12, 0155 Oslo",
"chapter_affiliations": [
"ch-01",
"ch-04",
"ch-07"
]
}
Response Example
{
"valid": true,
"errors": [],
"validated_at": "2026-03-26T11:20:00Z"
}
PUT
/api/v1/contact-validation/api/v1/contact-validation/:id
Update a validation rule
Public
Request Example
{
"description": "Must be a valid Norwegian or international phone number",
"active": true
}
Response Example
{
"rule_id": "vr-002",
"field": "phone",
"description": "Must be a valid Norwegian or international phone number",
"active": true,
"updated_at": "2026-03-26T12:05:00Z"
}
DELETE
/api/v1/contact-validation/api/v1/contact-validation/:id
Delete a validation rule
Public
Response Example
{
"rule_id": "vr-003",
"deleted": true,
"deleted_at": "2026-03-26T12:55:00Z"
}
POST
/api/v1/contact-validation/api/v1/contact-validation/validate-email
Validate an email address field (validateEmail)
Public
Request Example
{
"email": "ingrid.s@updated.no"
}
Response Example
{
"email": "ingrid.s@updated.no",
"valid": true,
"error": null
}
POST
/api/v1/contact-validation/api/v1/contact-validation/validate-phone
Validate a phone number field (validatePhoneNumber)
Public
Request Example
{
"phone": "+47 912 34 567"
}
Response Example
{
"phone": "+47 912 34 567",
"valid": true,
"error": null
}
POST
/api/v1/contact-validation/api/v1/contact-validation/validate-chapter-affiliations
Validate chapter affiliation list count (validateChapterAffiliationCount)
Public
Request Example
{
"chapter_ids": [
"ch-01",
"ch-04",
"ch-07"
]
}
Response Example
{
"chapter_ids": [
"ch-01",
"ch-04",
"ch-07"
],
"count": 3,
"valid": true,
"error": null
}