API Reference

Securelytix exposes three REST endpoints for tokenization, detokenization, and health monitoring. All endpoints accept and return JSON.

All endpoints accept and return JSON. Authentication uses a Bearer token (your API key) in the Authorization header.

POST /api/v1/tokenize

Replace sensitive values with format-preserving tokens while keeping your existing JSON structure intact.

bash · terminal
1curl -sS -X POST "http://localhost:8080/api/v1/tokenize" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "data": {
5 "email": "user@example.com",
6 "name": "user example"
7 }
8}'

Response (200 OK):

Returns the original JSON structure with sensitive values replaced by Securelytix tokens.

json · terminal
1{
2 "data": {
3 "email": "bujd@xhpsmhg.wiw_stx",
4 "name": "kngw uanitan_stx"
5 },
6 "request_id": "d3229946-6d0f-4ff6-96e8-775d751c076b",
7 "client_id": "stx_b96890c117de267449572500"
8}
StatusReasonBody
400Invalid value or unsupported type{ "error": "invalid_type", "message": "..." }
401Missing or invalid API key{ "error": "unauthorized" }
429User limit exceeded{ "error": "user_limit", "retry_after": 1 }
500Internal error (DB, license){ "error": "internal_error", "message": "..." }

POST /api/v1/detokenize

Reverse a token back to its original plaintext value. Call only from trusted services.

bash · terminal
1curl -sS -X POST "http://localhost:8080/api/v1/detokenize" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "data": {
5 "email": "bujd@xhpsmhg.wiw_stx",
6 "name": "kngw uanitan_stx"
7 }
8}'

Response (200 OK):

json · terminal
1{
2 "data": {
3 "email": "user@example.com",
4 "name": "user example"
5 },
6 "status": "success",
7 "request_id": "c9bf57af-e144-4197-bcc1-3b0c22b051e1",
8 "client_id": "stx_b96890c117de267449572500"
9}

Detokenize is a trust boundary

Only trusted backend services should have permission to call this endpoint. Any service with a valid API key can restore tokenized values to plaintext. Limit access to components that genuinely require sensitive data.

GET /health

Health check endpoint. No authentication required. Use for Kubernetes liveness and readiness probes.

json · terminal
1{
2 "status": "ok",
3 "timestamp": "2026-05-15T10:30:00Z",
4 "postgres": "ok",
5 "version": "1.0.5"
6}

Was this page helpful?