Skip to main content
POST
/
v1
/
subscriptions
Create subscription
curl --request POST \
  --url https://api.ticksupply.com/v1/subscriptions \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "datastream_id": 123
}
'
{
  "id": "sub_550e8400e29b41d4a716446655440000",
  "status": "active",
  "datastream": {
    "datastream_id": 123,
    "exchange": "binance",
    "instrument": "BTCUSDT",
    "stream_type": "trade",
    "wire_format": "json"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "spans": [
    {
      "id": "spn_0194a1b2c3d4e5f6a7b8c9d0e1f2a3b4",
      "started_at": "2023-11-07T05:31:56Z",
      "ended_at": "2023-11-07T05:31:56Z"
    }
  ]
}

Authorizations

X-Api-Key
string
header
required

Your API key. Get one from the dashboard at https://app.ticksupply.com/api-keys

Headers

Idempotency-Key
string

Unique key for idempotent requests. If you retry a request with the same key, you'll receive the original response without the operation being performed again.

Maximum string length: 128

Body

application/json
datastream_id
integer<int64>
required

Datastream ID to subscribe to

Response

Subscription created successfully

id
string
required

Prefixed subscription ID (e.g., sub_550e8400e29b41d4a716446655440000)

Example:

"sub_550e8400e29b41d4a716446655440000"

status
enum<string>
required

Current subscription status

Available options:
active,
paused,
deleted
datastream
object
required

Simplified datastream information for catalog queries

created_at
string<date-time>
required

When the subscription was created

spans
object[]
required