Attributes

Attributes are custom key-value pairs attached to an organization. They let you store arbitrary metadata on an organization without extending the core schema — useful for subscription tiers, external system IDs, feature flags, and any other business data that belongs with the organization record.

Attribute Endpoints

MethodEndpointDescription
GET/realms/{realm_name}/organizations/{organization_id}/attributesList all attributes for an organization
PUT/realms/{realm_name}/organizations/{organization_id}/attributes/{key}Upsert an attribute by key
DELETE/realms/{realm_name}/organizations/{organization_id}/attributes/{key}Delete an attribute by key

Upsert Semantics

The PUT endpoint upserts by key: if the key already exists, its value is overwritten; if it does not exist, a new attribute is created. There is no separate create endpoint.

{
  "value": "enterprise"
}

Both key and value are required. An empty or missing value is rejected.

Attribute Fields

FieldTypeConstraintsDescription
idUUID v7Auto-generated identifier
organization_idUUIDThe organization this attribute belongs to
keyString1–255 characters, requiredAttribute name
valueStringRequiredAttribute value
created_atDateTime (UTC)Creation timestamp (set on first upsert, not updated on overwrites)

Example: Multiple Attributes

A typical organization might carry several attributes:

[
  {
    "id": "01936b2e-aaaa-7000-abcd-000000000001",
    "organization_id": "01936b2e-1234-7000-abcd-000000000001",
    "key": "plan",
    "value": "enterprise",
    "created_at": "2026-01-15T09:00:00Z"
  },
  {
    "id": "01936b2e-bbbb-7000-abcd-000000000002",
    "organization_id": "01936b2e-1234-7000-abcd-000000000001",
    "key": "stripe_customer_id",
    "value": "cus_Qx8mN2kLpR4t",
    "created_at": "2026-01-15T09:01:00Z"
  },
  {
    "id": "01936b2e-cccc-7000-abcd-000000000003",
    "organization_id": "01936b2e-1234-7000-abcd-000000000001",
    "key": "feature_advanced_reporting",
    "value": "true",
    "created_at": "2026-03-01T14:30:00Z"
  }
]

Real-World Uses

Key patternExample valueUse case
planfree, pro, enterpriseGate features by subscription tier
stripe_customer_idcus_Qx8mN2kLpR4tLink to billing provider
salesforce_account_id001Dn00000KjlHSIAZLink to CRM record
feature_<name>true / falsePer-org feature flags
max_seats50Enforce seat limits in application logic
onboarded_at2026-01-15Track onboarding completion

Values are always strings

Attributes store strings only. Numeric values (50), booleans (true), and dates (2026-01-15) are stored as their string representations. Your application is responsible for parsing them back to the appropriate type.