Skip to content

Register WebSocket credential

POST /api/user/register-websocket

Create - or return the existing - persistent WebSocket credential for your account. The response contains the public WebSocket URL and an API key to present when connecting; once connected you receive a TxNotification message for each transaction status change. The credential is stable across calls. Authenticate with either an api-key header or an Authorization Bearer JWT. No request body is required.

Authentication

Send your API key in the api-key header.

Responses

Status Description
200 The WebSocket credential.
401 Authentication failed. Plausible codes: AUTH_001, AUTH_002, AUTH_004, AUTH_005.
500 Server error. Plausible codes: SYSTEM_001.
200 response
{
  "success": true,
  "data": {
    "wsUrl": "wss://photon.example.com/ws",
    "apiKey": "ws_4c8e0b2d4f6a8c0e2b4d6f8a0c2e4b6d"
  },
  "timestamp": "2026-07-29T12:34:56.789Z"
}
401 response
{
  "success": false,
  "error": {
    "code": "AUTH_001",
    "message": "Unauthorized access",
    "category": "AUTH",
    "traceId": "6f2c1e0a-8b4d-4c1e-9f3a-2d5b7c8e9a01"
  },
  "timestamp": "2026-07-29T12:34:56.789Z"
}
500 response
{
  "success": false,
  "error": {
    "code": "SYSTEM_001",
    "message": "Database operation failed",
    "category": "SYSTEM",
    "traceId": "6f2c1e0a-8b4d-4c1e-9f3a-2d5b7c8e9a01"
  },
  "timestamp": "2026-07-29T12:34:56.789Z"
}