AdminTest error handling

Test error handling

Admin-only debug endpoint that intentionally throws different types of errors to verify Sentry integration and error reporting pipelines. Supports synchronous errors, asynchronous errors, TypeError (property access on undefined), and validation errors. This endpoint should never return a 200 response in normal usage. Requires dual authentication: X-Admin-API-Key header and a JWT with @smartphonekey.com email domain.

curl -X GET "https://api.spkey.co/admin/test-error?type=sync" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "message": "example_string"
}
GET
/admin/test-error
GET
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (JWT)
Bearer Tokenstring
Required

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.
API Key (header: X-API-Key)
X-API-Keystring
Required

API key for B2B organization access. Provided during organization onboarding.

API key for B2B organization access. Provided during organization onboarding.
query
typestring

Type of error to throw

Options: sync, async, type, validation
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (JWT). JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

header
X-API-Keystring
Required

API Key for authentication. API key for B2B organization access. Provided during organization onboarding.

Query Parameters

typestring

Type of error to throw

Allowed values:syncasynctypevalidation

Responses

messagestring
Required