bitcain docs
API Reference

Real time

WebSocket and real-time notification endpoints

Subscribe to a real-time channel (Legacy)

POST
/api/realtime/subscribe

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

channel*string

Channel name to subscribe to

filters?

Optional channel filters

Response Body

application/json

application/json

curl -X POST "https://loading/api/realtime/subscribe" \  -H "Content-Type: application/json" \  -d '{    "channel": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Unsubscribe from a real-time channel (Legacy)

POST
/api/realtime/unsubscribe

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

channel*string

Channel name to unsubscribe from

Response Body

application/json

application/json

curl -X POST "https://loading/api/realtime/unsubscribe" \  -H "Content-Type: application/json" \  -d '{    "channel": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List available real-time channels (Legacy)

GET
/api/realtime/channels

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/realtime/channels"
{}

Send Notification

POST
/api/notifications/send

Request Body

application/json

message*string

Notification message text

title?|

Optional notification title

channel?string

Target notification channel

Default"slack"
Value in"slack" | "email" | "telegram" | "push" | "websocket" | "sms" | "webhook" | "discord"
priority?string

Notification priority level

Default"medium"
Value in"low" | "medium" | "high" | "critical"
metadata?|

Additional metadata

Response Body

application/json

application/json

curl -X POST "https://loading/api/notifications/send" \  -H "Content-Type: application/json" \  -d '{    "message": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Send Trade Alert

POST
/api/notifications/trade-alert

Request Body

application/json

trade_type*string

Type of trade (buy/sell)

symbol*string

Trading symbol (e.g., BTC/USDT)

amount*number

Trade amount

price*number

Execution price

profit_loss?|

Profit/loss amount

channels?array<>|

List of channels to notify

Response Body

application/json

application/json

curl -X POST "https://loading/api/notifications/trade-alert" \  -H "Content-Type: application/json" \  -d '{    "trade_type": "string",    "symbol": "string",    "amount": 0,    "price": 0  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Send System Alert

POST
/api/notifications/system-alert

Request Body

application/json

alert_type*string

Type of alert (error, warning, info)

message*string

Alert message

severity?string

Alert severity level

Default"medium"
Value in"low" | "medium" | "high" | "critical"
channels?array<>|

List of channels to notify

Response Body

application/json

application/json

curl -X POST "https://loading/api/notifications/system-alert" \  -H "Content-Type: application/json" \  -d '{    "alert_type": "string",    "message": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Notification Status

GET
/api/notifications/status

Response Body

application/json

curl -X GET "https://loading/api/notifications/status"
{}

Get user notifications

GET
/api/notifications

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

limit?integer

Maximum number of results

Default50
Range1 <= value <= 100
offset?integer

Number of results to skip

Default0
Range0 <= value
unread_only?boolean

Filter for unread notifications only

Defaultfalse
notification_type?|

Filter by notification type

Response Body

application/json

application/json

curl -X GET "https://loading/api/notifications"
{
  "notifications": [
    {
      "type": "alert",
      "title": "string",
      "message": "string",
      "notification_metadata": {},
      "link": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
      "read_at": "2019-08-24T14:15:22Z",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total": 0,
  "limit": 0,
  "offset": 0,
  "unread_count": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get unread notification count

GET
/api/notifications/unread-count

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/notifications/unread-count"
{
  "unread_count": 0
}

Mark notification as read

PATCH
/api/notifications/{notification_id}/read

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

notification_id*string

Response Body

application/json

application/json

curl -X PATCH "https://loading/api/notifications/string/read"
{
  "type": "alert",
  "title": "string",
  "message": "string",
  "notification_metadata": {},
  "link": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "read_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Mark all notifications as read

POST
/api/notifications/mark-all-read

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X POST "https://loading/api/notifications/mark-all-read"
{
  "marked_count": 0,
  "message": "string"
}

Send test notification to specific channel

POST
/api/notifications/test-channel

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

channel*string

Channel to test (email, push, websocket, sms, webhook, slack, discord, telegram)

Response Body

application/json

application/json

curl -X POST "https://loading/api/notifications/test-channel" \  -H "Content-Type: application/json" \  -d '{    "channel": "string"  }'
{
  "success": true,
  "message": "string",
  "channel": "string",
  "details": {}
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Subscribe to push notifications

POST
/api/push/subscribe

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

endpoint*string

Push notification endpoint URL

keys.p256dh*string

Public key for encryption (p256dh)

keys.auth*string

Authentication secret

user_agent?|

Browser user agent string

device_name?|

Device/browser name

Response Body

application/json

application/json

curl -X POST "https://loading/api/push/subscribe" \  -H "Content-Type: application/json" \  -d '{    "endpoint": "string",    "keys.p256dh": "string",    "keys.auth": "string"  }'
{
  "success": true,
  "message": "string",
  "subscription": {
    "endpoint": "string",
    "p256dh_key": "string",
    "auth_key": "string",
    "user_agent": "string",
    "device_name": "string",
    "metadata": {},
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "last_used_at": "2019-08-24T14:15:22Z"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Unsubscribe from push notifications

DELETE
/api/push/unsubscribe

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

endpoint*string

Push notification endpoint URL to remove

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/push/unsubscribe" \  -H "Content-Type: application/json" \  -d '{    "endpoint": "string"  }'
{
  "success": true,
  "message": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get push subscription status

GET
/api/push/status

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/push/status"
{
  "is_subscribed": true,
  "subscription_count": 0,
  "subscriptions": [
    {
      "endpoint": "string",
      "p256dh_key": "string",
      "auth_key": "string",
      "user_agent": "string",
      "device_name": "string",
      "metadata": {},
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "last_used_at": "2019-08-24T14:15:22Z"
    }
  ]
}

Send test push notification

POST
/api/push/test

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X POST "https://loading/api/push/test"
{}