Get subscriptions

Learn how to get your user's subscriptions

Description

The following route enables you to get your user's subscriptions.

Endpoint

GET https://sentry.aleno.ai/subscriptions

Query parameters

To get all subscriptions, simply remove the query parameter userIds (it is optional): GET /users

Payload

No payload.

CURL example

curl -X GET \
  'https://sentry.aleno.ai/subscriptions?userIds=3627716d-2b62-4cbd-802e-ed19d91400fe,9e8ab37c-343b-465c-a418-2fbe51109af4' \
  -H 'accept: application/json' \
  -H 'Authorization: YOUR_API_KEY'

Result

Returns a list of objects, each representing a subscription detail, structured as follows:

{
    "data": [
   {
      "subscription":{
         "id":"56307502-bc7e-47bb-862e-1f2f8f4ffa83",
         "userId":"6a9455ce-bd61-4229-8190-c60073b62054",
         "metricKey":"eth_token_total_tvl_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
         "startWindowTimestamp":"1714984204",
         "threshold":0.0001,
         "createdAt":"2024-05-06T08:30:04.244Z",
         "updatedAt":"2024-05-06T08:30:04.244Z"
      },
      "metric":{
         "key":"eth_token_total_tvl_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
         "chainId":"eth",
         "type":"token_total_tvl",
         "name":"WETH total tvl",
         "info":{
            "token":{
               "address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
               "chainId":"eth",
               "name":"Wrapped Ether",
               "symbol":"WETH",
               "decimals":18,
               "isTracked":true
            }
         }
      }
   },
   {
      "subscription":{
         "id":"1a8518cf-c481-4c61-bd75-6f827b8b561f",
         "userId":"6a9455ce-bd61-4229-8190-c60073b62054",
         "metricKey":"eth_token_total_supply_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
         "startWindowTimestamp":"1714984204",
         "threshold":0.0001,
         "createdAt":"2024-05-06T08:30:04.244Z",
         "updatedAt":"2024-05-06T08:30:04.244Z"
      },
      "metric":{
         "key":"eth_token_total_supply_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
         "chainId":"eth",
         "type":"token_total_supply",
         "name":"WETH total supply",
         "info":{
            "token":{
               "address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
               "chainId":"eth",
               "name":"Wrapped Ether",
               "symbol":"WETH",
               "decimals":18,
               "isTracked":true
            }
         }
      }
   }
]
}

Last updated