REST /api/v1/error-messages 7 endpoints
GET /api/v1/error-messages/api/v1/error-messages

List all registered plain-language error messages

Public

Response Example

{
  "data": [
    {
      "error_code": "ERR_REQUIRED_FIELD",
      "title": "This field is required",
      "message": "Please fill in this field before continuing.",
      "suggestion": "Look for fields marked with an asterisk (*)",
      "locale": "en-IE",
      "is_fallback": false
    },
    {
      "error_code": "ERR_INVALID_DATE",
      "title": "Date format is incorrect",
      "message": "Please enter the date as DD/MM/YYYY.",
      "suggestion": "Example: 15/03/1985",
      "locale": "en-IE",
      "is_fallback": false
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 42
  }
}
GET /api/v1/error-messages/api/v1/error-messages/:errorCode

Look up a plain-language error message by error code

Public

Response Example

{
  "error_code": "ERR_INVALID_DATE",
  "title": "Date format is incorrect",
  "message": "Please enter the date as DD/MM/YYYY.",
  "suggestion": "Example: 15/03/1985",
  "locale": "en-IE",
  "is_fallback": false,
  "created_at": "2026-01-10T09:00:00Z",
  "updated_at": "2026-02-14T10:00:00Z"
}
POST /api/v1/error-messages/api/v1/error-messages

Register a new plain-language error message

Public

Request Example

{
  "error_code": "ERR_SESSION_EXPIRED",
  "title": "Your session has ended",
  "message": "You have been inactive for a while, so your session has ended. Your draft has been saved.",
  "suggestion": "Click 'Resume' to continue where you left off.",
  "locale": "en-IE",
  "is_fallback": false
}

Response Example

{
  "error_code": "ERR_SESSION_EXPIRED",
  "title": "Your session has ended",
  "locale": "en-IE",
  "created_at": "2026-03-26T11:35:00Z"
}
PUT /api/v1/error-messages/api/v1/error-messages/:errorCode

Update an existing error message

Public

Request Example

{
  "message": "Please enter the date using numbers in the format DD/MM/YYYY.",
  "suggestion": "For example: 15/03/1985. Day first, then month, then year."
}

Response Example

{
  "error_code": "ERR_INVALID_DATE",
  "message": "Please enter the date using numbers in the format DD/MM/YYYY.",
  "updated_at": "2026-03-26T11:40:00Z"
}
DELETE /api/v1/error-messages/api/v1/error-messages/:errorCode

Remove a registered error message

Public

Response Example

{
  "deleted": true,
  "error_code": "ERR_SESSION_EXPIRED"
}
POST /api/v1/error-messages/api/v1/error-messages/load-from-asset

Bulk-load error messages from a JSON asset file

Public

Request Example

{
  "asset_path": "assets/errors/en-IE.json",
  "locale": "en-IE"
}

Response Example

{
  "locale": "en-IE",
  "entries_loaded": 42,
  "entries_created": 40,
  "entries_updated": 2,
  "loaded_at": "2026-03-26T11:45:00Z"
}
GET /api/v1/error-messages/api/v1/error-messages/fallback

Get the default fallback error message used when a code is not registered

Public

Response Example

{
  "error_code": "ERR_UNKNOWN",
  "title": "Something went wrong",
  "message": "We're sorry, an unexpected error occurred. Please try again or contact support.",
  "suggestion": "If this keeps happening, try refreshing the page.",
  "locale": "en-IE",
  "is_fallback": true
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}