GET
/
api
/
loyalty
/
account_streaks
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});

const response = await client.loyalty.accountStreaks.getStreaks({
  loyaltyRuleId:
    'loyaltyRuleId=123e4567-e89b-12d3-a456-426614174001&loyaltyRuleId=123e4567-e89b-12d3-a456-426614174002',
});

console.log(response);
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174001",
    "createdAt": "2025-01-01T00:00:00.000Z",
    "updatedAt": "2025-01-01T00:00:00.000Z",
    "expiresAt": "2025-01-01T00:00:00.000Z",
    "streakCount": 10,
    "userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "loyaltyRuleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "walletAddress": "<string>",
    "milestone": [
      {
        "streakMilestone": 123,
        "streakAmount": 123
      }
    ]
  }
]

Authorizations

X-API-KEY
string
header
required

Query Parameters

userId
string

User id to filter by

Example:

"123e4567-e89b-12d3-a456-426614174001"

walletAddress
string

Wallet address to filter by

Example:

"0x1234567890123456789012345678901234567890"

loyaltyRuleId
required

Loyalty rule id(s) to filter by, array or single id

Example:

"loyaltyRuleId=123e4567-e89b-12d3-a456-426614174001&loyaltyRuleId=123e4567-e89b-12d3-a456-426614174002"

startingAfter
string

Pagination cursor to start after a specific resource ID

Example:

"123e4567-e89b-12d3-a456-426614174010"

limit
number
default:10

Maximum number of records to return (max 1000)

Required range: 1 <= x <= 1000
Example:

50

Response

200
application/json

200

Response schema for getting loyalty account streaks, null if no streak