Skip to main content
Custom claims are values Grantiva injects into the JWT minted after successful attestation. Define them once here; every subsequent token for your organization carries them. See Custom Claims Concepts for how each claim type is evaluated.

Authentication

/api/v1/claims requires a dashboard session (cookie-based) and organization membership.
  • Read and test operations (list, get, test, preview): any organization member.
  • Write operations (create, update, delete, bulk, reorder): Admin role or above.
A second surface, /api/v1/org/claims, exposes the same model to API keys for the CLI and scripts — see Console API.

Claim definition fields

Conditional rules

Each entry in conditionalRules:
  • operatorAND or OR, joining the conditions.
  • field — one of device_model, os_version, app_version, risk_score, attestation_count, country, jailbreak_detected, device_integrity, first_seen_days, suspicious_events.
  • Condition operator — one of equals, not_equals, greater_than, less_than, greater_than_or_equal, less_than_or_equal, contains, not_contains, starts_with, ends_with, regex, in_list, not_in_list.

External config (Enterprise)

authentication.type is one of basic, bearer, api_key, oauth2.

Validation rules

Reserved keys

subscription (any casing) is reserved — it is managed by Grantiva’s entitlement ingestion (Apple IAP / Stripe) and injected into tokens automatically. Creating a claim with this key returns 400 Bad Request. See Subscription Claims.

List claims

Returns all claim definitions for your organization, sorted by priority then key. Response

Get a claim

Returns a single claim definition (same shape as list entries).

Create a claim

Requires Admin role. Request body
Include exactly the type-specific field your claimType requires (staticValue, conditionalRules, dynamicExpression, or externalConfig). validationRules is optional for all types. Response — the created claim (same shape as list entries).

Update a claim

Requires Admin role. All fields optional; claimKey and claimType cannot be changed. Only the configuration field matching the claim’s existing type is applied.

Delete a claim

Requires Admin role. Response204 No Content

Bulk create

Requires Admin role. Body is a JSON array of create requests. All entries are validated first; the batch fails as a whole if the total would exceed your tier’s claim limit. Not available on the Free tier. Response — array of created claims.

Reorder claims

Requires Admin role. Request body
Array index becomes the new priority. IDs not found (or not owned by your organization) are skipped. Updates run in a single transaction. Response204 No Content

Test a claim configuration

Evaluates an unsaved claim configuration against a simulated device — nothing is persisted. Any member can call this. Request body
deviceProfile.keyId, riskScore, attestationCount, and jailbreakDetected are required when a profile is provided; the other profile fields are optional. Response

Preview a saved claim

Same as test, but evaluates an existing saved claim — the body contains only testContext. Returns the same response shape.

Tier limits

Limits count active claims only.

Errors

See also


Console API

/api/v1/org/claims is the same claim model reachable with an API key (Authorization: Bearer gpat_…/aat_…) as well as a dashboard session. It’s what the grantiva CLI uses. Top-level field names are snake_case on this surface; the nested conditional_rules, external_config, and validation_rules objects keep the same schema as /api/v1/claims. :claimRef accepts a claim UUID or a claim_key.

Endpoints

There is no bulk-create on this surface.

The console claim object

Create takes the same fields (minus id, created_at, updated_at), with the same validation and tier rules as /api/v1/claims. An update body with no updatable field returns 400.

Test and preview

Every device field is optional — unset values default to preview-device, risk score 0, and attestation count 1. POST /api/v1/org/claims/test takes the same context plus a claim object holding the unsaved definition.
Testing an external claim requires the Enterprise tier, because evaluation makes the server call your configured endpoint.

Errors