Ledga
PATCH/attribute-definitions/{key}

Update an attribute definition's label / indexed flag

Update a declared key's mutable metadata (label / indexed); the key itself is immutable. Requires the attributes:admin capability on the API key; a key without it receives 403 ATTRIBUTE_ADMIN_CAPABILITY_REQUIRED.

Parameters

NameInTypeDescription
keyrequired path string

Request body

FieldTypeDescription
label string
nullable
indexed boolean

Responses

200Attribute definition updated
{
  "success": true,
  "data": {
    "id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a",
    "key": "customer_id",
    "label": "Customer ID",
    "indexed": true,
    "usage_count": 1200,
    "created_at": "2026-01-15T10:30:00Z",
    "updated_at": "2026-01-15T10:30:00Z"
  }
}
401Unauthenticated
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
403Forbidden — missing the required 'attributes:admin' capability (ATTRIBUTE_ADMIN_CAPABILITY_REQUIRED)
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
404Attribute definition not found
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
422Validation error
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}

Examples

curl -X PATCH https://ledga.io/api/v1/attribute-definitions/{key} \
  -H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "label": "Customer ID",
  "indexed": false
}'

← All endpoints