Fetch all Claims

`GET` request to `/claims` to retrieve all Claims in a paginated list.

GET to /claims

Retrieves a list of Claims. Returns a paginated list of Claims.

GET https://api.intuition.systems?<Query_Parameters>
   await fetch(`${apiUrl}/claims?${queryParams}`, {
      method: 'GET',
      "headers": {
        "Content-Type": "application/json",
        "x-api-key": <API_KEY>
      },
    })

Security

This request requires a valid API Key to be included with each request.

Headers

  • Content-Type: application/json

  • x-api-key: <API_Key>

Query Parameters

ParameterDescription

page

Current page in sequence

limit

number Max number of items returned on single page Example: 1

sortBy

string Field to sort by. Default is created_at Example: "creator"

direction

string - "desc" or "asc" Direction to sort. Default is desc Example: "desc"

Response

This includes the Paginated Response

{
    "page": 1, // The current page in pagination sequence
    "limit": 100, // The max number of items returned on a single page
    "total": 50, // Total number of items 
    "data": [{}] // Array of response items
}

You'll receive back a data array that is a paginated list of all available Claims.

{
  "page": 1,
  "limit": 100,
  "total": 79,
  "data": [{}],
  ]
}

Here is an example Zod schema and TypeScript interface you can use for the Claim:

export const ClaimSchema = z.object({
  claim_id: z.string(),
  vault_id: z.string(),
  counter_vault_id: z.string(),
  created_at: z.string().transform((date) => {
    const d = new Date(Number.parseInt(date))
    return d.toISOString()
  }), // unix timestamp
  updated_at: z.string(), // unix timestamp (last claim position update)
  creator: EmbedUserUserAggregatesSchema.optional(),
  subject: IdentitySchema,
  predicate: IdentitySchema,
  object: IdentitySchema,
  status: z.enum(['pending', 'complete']),
  for_num_positions: z.number(),
  for_assets_sum: z.string(), // bigint
  for_conviction_sum: z.string(), // bigint
  for_conviction_price: z.string(), // bigint
  against_num_positions: z.number(),
  against_assets_sum: z.string(), // bigint
  against_conviction_sum: z.string(), // bigint
  against_conviction_price: z.string(), // bigint
})

Response Codes

CodeDescription

200

Paginated list of Claims

400

Bad Request. Example: Unsupported value for sortBy query parameter.

Last updated