Create a Claim

`POST` request to `/claims` to create a Claim.

POST to /claims

Creates an offchain Claim. Consider pairing this with createTriple for onchain Claim creation. The Intuition Portal user journey for creating a Claim combines both of these interactions.

POST https://api.intuition.systems/claims
   await fetch(`${apiUrl}/claims`, {
      method: 'POST',
      "headers": {
        "Content-Type": "application/json",
        "x-api-key": <API_KEY>
      },
      "body": {
        "subject": "bxxxxxxx-6xxx-4xxx-8xxx-3xxxxxxxxxxx", // id of the subject Identity
        "predicate": "bxxxxxxx-6xxx-4xxx-8xxx-3xxxxxxxxxxx", // id of the predicate Identity
        "object": "bxxxxxxx-6xxx-4xxx-8xxx-3xxxxxxxxxxx", // id of the object Identity
        "creator": "0x...81", // Ethereum address of the Claim creator
      }
    })

Security

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

Headers

  • Content-Type: application/json

  • x-api-key: <API_Key>

Body Parameters

Response

If a Claim is successfully created you'll receive the Claim object for the new Claim.

{
 
},

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

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

Last updated