{
  "openapi": "3.0.3",
  "info": {
    "title": "GrowGelt API",
    "description": "RESTful API for the GrowGelt CRM platform. Supports donor management, donations, activities, pledges, events, and more.\n\n## Authentication\n\nAll requests require one of:\n- **API Key**: Pass via `X-API-Key` header (for external integrations)\n- **JWT Bearer**: Pass via `Authorization: Bearer <token>` header with `X-Tenant-Id` (for frontend)\n\n## Rate Limits\n- 60 requests/minute per API key\n- 10,000 requests/day per API key\n\n## Pagination\nAll list endpoints support `limit` (max 1000, default 500) and `offset` query parameters. Responses include `total` count.\n\n## Soft Delete\nCore entities (donors, donations, activities, pledges, etc.) use soft deletion. DELETE sets a `deleted_at` timestamp. Deleted records are automatically excluded from all GET requests. Pass `?include_deleted=true` to include them.\n\n## Filtering\nUse query parameters with suffixes:\n- `field=value` — exact match\n- `field_gte=value` — greater than or equal\n- `field_lte=value` — less than or equal\n- `field_gt=value` — greater than\n- `field_lt=value` — less than\n- `field_neq=value` — not equal\n- `field_in=a,b,c` — in list\n- `field_like=text` — case-insensitive partial match\n- `field_contains=a,b` — array contains\n- `field_is=null|true|false` — null/boolean check\n\n## Sorting\nUse `sort=field` (ascending) or `sort=-field` (descending). Comma-separate for multiple: `sort=-date,amount`\n\n## Search\nUse `search=text` to search across entity-specific searchable fields.",
    "version": "1.0.0",
    "contact": {
      "name": "GrowGelt Support",
      "url": "https://connect.growgelt.com"
    }
  },
  "servers": [
    {
      "url": "https://api.growgeltconnect.com",
      "description": "Production API"
    }
  ],
  "security": [
    { "ApiKeyAuth": [] }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Tenant API key (prefix: gg_)"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Supabase JWT token (requires X-Tenant-Id header)"
      }
    },
    "parameters": {
      "limitParam": {
        "name": "limit",
        "in": "query",
        "schema": { "type": "integer", "default": 500, "maximum": 1000 },
        "description": "Max records to return"
      },
      "offsetParam": {
        "name": "offset",
        "in": "query",
        "schema": { "type": "integer", "default": 0 },
        "description": "Number of records to skip"
      },
      "searchParam": {
        "name": "search",
        "in": "query",
        "schema": { "type": "string" },
        "description": "Full-text search across searchable fields"
      },
      "sortParam": {
        "name": "sort",
        "in": "query",
        "schema": { "type": "string" },
        "description": "Sort field(s). Prefix with - for descending. Example: -date,amount"
      },
      "selectParam": {
        "name": "select",
        "in": "query",
        "schema": { "type": "string", "default": "*" },
        "description": "Comma-separated list of fields to return"
      },
      "includeDeletedParam": {
        "name": "include_deleted",
        "in": "query",
        "schema": { "type": "boolean", "default": false },
        "description": "Include soft-deleted records in results"
      }
    },
    "schemas": {
      "PaginatedResponse": {
        "type": "object",
        "properties": {
          "data": { "type": "array", "items": {} },
          "total": { "type": "integer" },
          "limit": { "type": "integer" },
          "offset": { "type": "integer" }
        }
      },
      "SingleResponse": {
        "type": "object",
        "properties": {
          "data": { "type": "object" }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": { "type": "string" }
        }
      },
      "Donor": {
        "type": "object",
        "required": ["first_name", "last_name"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "first_name": { "type": "string" },
          "last_name": { "type": "string" },
          "email": { "type": "string", "format": "email", "nullable": true },
          "email_2": { "type": "string", "format": "email", "nullable": true },
          "phone": { "type": "string", "nullable": true },
          "phone_2": { "type": "string", "nullable": true },
          "additional_emails": { "type": "array", "items": { "type": "string" }, "nullable": true },
          "additional_phones": { "type": "array", "items": { "type": "string" }, "nullable": true },
          "address": { "type": "string", "nullable": true },
          "address_line_2": { "type": "string", "nullable": true },
          "city": { "type": "string", "nullable": true },
          "state": { "type": "string", "nullable": true },
          "zip": { "type": "string", "nullable": true },
          "donor_type": { "type": "string", "enum": ["individual", "organization", "household"], "default": "individual" },
          "status": { "type": "string", "enum": ["active", "at_risk", "lapsed", "prospect"], "nullable": true },
          "tier": { "type": "string", "enum": ["top3", "major", "mid", "entry"], "nullable": true },
          "tags": { "type": "array", "items": { "type": "string" }, "nullable": true },
          "organization_name": { "type": "string", "nullable": true },
          "household_name": { "type": "string", "nullable": true },
          "title": { "type": "string", "nullable": true },
          "middle_name": { "type": "string", "nullable": true },
          "maiden_name": { "type": "string", "nullable": true },
          "job_title": { "type": "string", "nullable": true },
          "is_jewish": { "type": "boolean", "default": false },
          "notes": { "type": "string", "nullable": true },
          "external_donor_id": { "type": "string", "nullable": true },
          "external_field": { "type": "string", "nullable": true },
          "lifetime_giving": { "type": "number", "readOnly": true },
          "this_year_giving": { "type": "number", "readOnly": true },
          "first_gift_date": { "type": "string", "format": "date", "readOnly": true, "nullable": true },
          "last_gift_date": { "type": "string", "format": "date", "readOnly": true, "nullable": true },
          "spouse_id": { "type": "string", "format": "uuid", "nullable": true },
          "do_not_contact": { "type": "boolean", "nullable": true },
          "email_opt_in": { "type": "boolean", "nullable": true },
          "sms_opt_in": { "type": "boolean", "nullable": true },
          "mail_opt_in": { "type": "boolean", "nullable": true },
          "phone_opt_in": { "type": "boolean", "nullable": true },
          "linkedin_url": { "type": "string", "nullable": true },
          "linkedin_only": { "type": "boolean", "default": false },
          "is_legacy_prospect": { "type": "boolean", "default": false },
          "is_major_donor_prospect": { "type": "boolean", "default": false },
          "is_chai_club_prospect": { "type": "boolean", "default": false },
          "cultivation_goal_amount": { "type": "number", "nullable": true },
          "cultivation_goal_date": { "type": "string", "format": "date", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true },
          "updated_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "Donation": {
        "type": "object",
        "required": ["donor_id", "amount"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "amount": { "type": "number" },
          "date": { "type": "string", "format": "date" },
          "type": { "type": "string", "enum": ["one_time", "recurring", "pledge_payment", "in_kind", "stock", "daf"], "default": "one_time" },
          "payment_method": { "type": "string", "nullable": true },
          "campaign": { "type": "string", "nullable": true },
          "gift_category": { "type": "string", "default": "general" },
          "source": { "type": "string", "nullable": true },
          "notes": { "type": "string", "nullable": true },
          "reference_number": { "type": "string", "nullable": true },
          "receipt_sent": { "type": "boolean", "nullable": true },
          "fee_amount": { "type": "number", "nullable": true },
          "non_deductible_amount": { "type": "number", "nullable": true },
          "soft_credit_amount": { "type": "number", "nullable": true },
          "deposit_date": { "type": "string", "format": "date", "nullable": true },
          "honor_memorial_type": { "type": "string", "nullable": true },
          "honor_memorial_name": { "type": "string", "nullable": true },
          "payment_provider": { "type": "string", "nullable": true },
          "provider_transaction_id": { "type": "string", "nullable": true },
          "thanked_at": { "type": "string", "format": "date-time", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true },
          "updated_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "Activity": {
        "type": "object",
        "required": ["title"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "title": { "type": "string" },
          "description": { "type": "string", "nullable": true },
          "activity_type": { "type": "string", "enum": ["call", "email", "meeting", "note", "task", "event", "mail", "text"], "nullable": true },
          "custom_type_key": { "type": "string", "nullable": true },
          "status": { "type": "string", "enum": ["pending", "in_progress", "completed", "cancelled"], "nullable": true },
          "priority": { "type": "string", "enum": ["low", "medium", "high", "urgent"], "nullable": true },
          "donor_id": { "type": "string", "format": "uuid", "nullable": true },
          "assigned_to": { "type": "string", "format": "uuid", "nullable": true },
          "due_date": { "type": "string", "format": "date-time", "nullable": true },
          "due_date_all_day": { "type": "boolean", "nullable": true },
          "completed_at": { "type": "string", "format": "date-time", "nullable": true },
          "snoozed_until": { "type": "string", "format": "date-time", "nullable": true },
          "notes": { "type": "string", "nullable": true },
          "event_id": { "type": "string", "format": "uuid", "nullable": true },
          "created_by_flow_id": { "type": "string", "format": "uuid", "nullable": true },
          "reminder_sent": { "type": "boolean", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true },
          "updated_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "Pledge": {
        "type": "object",
        "required": ["donor_id", "total_amount"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "total_amount": { "type": "number" },
          "paid_amount": { "type": "number", "readOnly": true },
          "balance": { "type": "number", "readOnly": true },
          "status": { "type": "string", "enum": ["active", "completed", "cancelled", "defaulted"], "nullable": true },
          "payment_frequency": { "type": "string", "nullable": true },
          "start_date": { "type": "string", "format": "date", "nullable": true },
          "end_date": { "type": "string", "format": "date", "nullable": true },
          "campaign": { "type": "string", "nullable": true },
          "notes": { "type": "string", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true },
          "updated_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "PledgePayment": {
        "type": "object",
        "required": ["pledge_id", "due_date", "amount"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "pledge_id": { "type": "string", "format": "uuid" },
          "due_date": { "type": "string", "format": "date" },
          "amount": { "type": "number" },
          "paid_amount": { "type": "number", "nullable": true },
          "paid_at": { "type": "string", "format": "date-time", "nullable": true },
          "donation_id": { "type": "string", "format": "uuid", "nullable": true },
          "reminder_sent": { "type": "boolean", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "Event": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "name": { "type": "string" },
          "description": { "type": "string", "nullable": true },
          "event_type": { "type": "string", "default": "custom" },
          "event_date": { "type": "string", "format": "date", "nullable": true },
          "location": { "type": "string", "nullable": true },
          "is_template": { "type": "boolean", "default": false },
          "holiday_key": { "type": "string", "nullable": true },
          "hebrew_year": { "type": "integer", "nullable": true },
          "hebrew_date_value": { "type": "string", "nullable": true },
          "hebrew_date_display": { "type": "string", "nullable": true },
          "attendance_count": { "type": "integer", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true },
          "updated_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "EventRsvp": {
        "type": "object",
        "required": ["event_id", "donor_id"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "event_id": { "type": "string", "format": "uuid" },
          "donor_id": { "type": "string", "format": "uuid" },
          "status": { "type": "string", "nullable": true },
          "registered_by": { "type": "string", "format": "uuid", "nullable": true },
          "registered_at": { "type": "string", "format": "date-time", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "Campaign": {
        "type": "object",
        "required": ["name", "slug"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "name": { "type": "string" },
          "slug": { "type": "string" },
          "description": { "type": "string", "nullable": true },
          "status": { "type": "string", "default": "active" },
          "goal_amount": { "type": "number", "nullable": true },
          "start_date": { "type": "string", "format": "date", "nullable": true },
          "end_date": { "type": "string", "format": "date", "nullable": true },
          "is_default": { "type": "boolean", "default": false },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "DonorNote": {
        "type": "object",
        "required": ["donor_id", "content"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "content": { "type": "string" },
          "note_type": { "type": "string", "default": "general" },
          "is_pinned": { "type": "boolean", "nullable": true },
          "activity_id": { "type": "string", "format": "uuid", "nullable": true },
          "donation_id": { "type": "string", "format": "uuid", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "DonorSpecialDate": {
        "type": "object",
        "required": ["donor_id", "date_value"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "date_type": { "type": "string", "default": "birthday" },
          "date_value": { "type": "string", "format": "date" },
          "custom_label": { "type": "string", "nullable": true },
          "use_hebrew_calendar": { "type": "boolean", "default": false },
          "hebrew_date_value": { "type": "string", "nullable": true },
          "hebrew_date_display": { "type": "string", "nullable": true },
          "after_nightfall": { "type": "boolean", "default": false },
          "year_known": { "type": "boolean", "default": true },
          "auto_create_activity": { "type": "boolean", "nullable": true },
          "reminder_days_before": { "type": "integer", "nullable": true },
          "notes": { "type": "string", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "DonorFavorite": {
        "type": "object",
        "required": ["donor_id", "user_id"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "user_id": { "type": "string", "format": "uuid" },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "DonorList": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "name": { "type": "string" },
          "description": { "type": "string", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "DonorListMember": {
        "type": "object",
        "required": ["list_id", "donor_id"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "list_id": { "type": "string", "format": "uuid" },
          "donor_id": { "type": "string", "format": "uuid" },
          "added_at": { "type": "string", "format": "date-time", "nullable": true },
          "added_by": { "type": "string", "format": "uuid", "nullable": true }
        }
      },
      "DonorSegment": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "name": { "type": "string" },
          "description": { "type": "string", "nullable": true },
          "entity_type": { "type": "string", "default": "donor" },
          "filter_criteria": { "type": "object" },
          "donor_count": { "type": "integer", "nullable": true },
          "last_calculated_at": { "type": "string", "format": "date-time", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "ActionFlow": {
        "type": "object",
        "required": ["name", "trigger_type"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "name": { "type": "string" },
          "description": { "type": "string", "nullable": true },
          "trigger_type": { "type": "string" },
          "trigger_config": { "type": "object", "nullable": true },
          "steps": { "type": "array", "nullable": true },
          "status": { "type": "string", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "DripEnrollment": {
        "type": "object",
        "required": ["action_flow_id", "donor_id"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "action_flow_id": { "type": "string", "format": "uuid" },
          "donor_id": { "type": "string", "format": "uuid" },
          "status": { "type": "string", "default": "active" },
          "current_step_index": { "type": "integer", "default": 0 },
          "enrolled_at": { "type": "string", "format": "date-time" },
          "next_send_at": { "type": "string", "format": "date-time", "nullable": true },
          "exited_at": { "type": "string", "format": "date-time", "nullable": true },
          "exit_reason": { "type": "string", "nullable": true },
          "exit_notes": { "type": "string", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "EmailThread": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "connection_id": { "type": "string", "format": "uuid" },
          "provider_thread_id": { "type": "string" },
          "subject": { "type": "string", "nullable": true },
          "is_archived": { "type": "boolean", "nullable": true },
          "is_read": { "type": "boolean", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "EmailOutbox": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "subject": { "type": "string", "nullable": true },
          "body_text": { "type": "string", "nullable": true },
          "status": { "type": "string" },
          "sent_at": { "type": "string", "format": "date-time", "nullable": true },
          "template_id": { "type": "string", "format": "uuid", "nullable": true },
          "connection_id": { "type": "string", "format": "uuid", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "EmailMessage": {
        "type": "object",
        "description": "Read-only. Individual messages within an email thread.",
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "thread_id": { "type": "string", "format": "uuid" },
          "from_email": { "type": "string" },
          "to_emails": { "type": "array", "items": { "type": "string" }, "nullable": true },
          "subject": { "type": "string", "nullable": true },
          "body_html": { "type": "string", "nullable": true },
          "body_text": { "type": "string", "nullable": true },
          "is_outbound": { "type": "boolean", "nullable": true },
          "sent_at": { "type": "string", "format": "date-time" },
          "has_attachments": { "type": "boolean", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "EmailTemplate": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "name": { "type": "string" },
          "subject": { "type": "string", "nullable": true },
          "category": { "type": "string", "nullable": true },
          "is_shared": { "type": "boolean", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "EmailDelegation": {
        "type": "object",
        "required": ["connection_id", "owner_user_id", "delegate_user_id", "permission_level"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "connection_id": { "type": "string", "format": "uuid" },
          "owner_user_id": { "type": "string", "format": "uuid" },
          "delegate_user_id": { "type": "string", "format": "uuid" },
          "permission_level": { "type": "string" },
          "revoked_at": { "type": "string", "format": "date-time", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "SmsLog": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donor_id": { "type": "string", "format": "uuid" },
          "to_number": { "type": "string" },
          "message_body": { "type": "string" },
          "status": { "type": "string" },
          "connection_id": { "type": "string", "format": "uuid", "nullable": true },
          "sent_by": { "type": "string", "format": "uuid", "nullable": true },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "WebhookEndpoint": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "name": { "type": "string" },
          "url_path": { "type": "string" },
          "is_active": { "type": "boolean" },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "FormMapping": {
        "type": "object",
        "required": ["webhook_endpoint_id", "form_name"],
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "webhook_endpoint_id": { "type": "string", "format": "uuid" },
          "form_name": { "type": "string" },
          "form_type": { "type": "string", "nullable": true },
          "is_active": { "type": "boolean" },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "ImportJob": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "file_name": { "type": "string" },
          "status": { "type": "string" },
          "import_type": { "type": "string" },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      },
      "ReceiptLog": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "format": "uuid", "readOnly": true },
          "donation_id": { "type": "string", "format": "uuid" },
          "donor_id": { "type": "string", "format": "uuid" },
          "receipt_number": { "type": "string" },
          "receipt_type": { "type": "string" },
          "generated_at": { "type": "string", "format": "date-time" },
          "created_at": { "type": "string", "format": "date-time", "readOnly": true }
        }
      }
    }
  },
  "tags": [
    { "name": "Donors", "description": "Manage contacts and donors" },
    { "name": "Donations", "description": "Record and manage gifts" },
    { "name": "Activities", "description": "Tasks, calls, meetings, and other touchpoints" },
    { "name": "Pledges", "description": "Manage pledges and scheduled payments" },
    { "name": "Events", "description": "Manage fundraising events and RSVPs" },
    { "name": "Campaigns", "description": "Campaign management" },
    { "name": "Notes", "description": "Donor notes" },
    { "name": "Special Dates", "description": "Birthdays, anniversaries, and custom dates" },
    { "name": "Favorites", "description": "Starred/favorited donors" },
    { "name": "Segments", "description": "Custom and platform donor segments" },
    { "name": "Lists", "description": "Static donor lists and memberships" },
    { "name": "Action Flows", "description": "Automated workflows and drip campaigns" },
    { "name": "Drip Campaigns", "description": "Drip sequences, enrollments, and send logs" },
    { "name": "Email", "description": "Email threads, messages, outbox, templates, and delegations" },
    { "name": "SMS", "description": "SMS logs and connections" },
    { "name": "Webhooks", "description": "Inbound webhook endpoints, events, and form mappings" },
    { "name": "Import", "description": "Data import jobs and rows" },
    { "name": "Receipts", "description": "Receipt logs and templates" },
    { "name": "Duplicates", "description": "Duplicate detection groups and dismissals" },
    { "name": "Enrichment", "description": "Contact enrichment logs" },
    { "name": "Operations", "description": "Bulk operation job queue" },
    { "name": "Chat", "description": "AI chat conversations and messages" },
    { "name": "Touchpoints", "description": "Touchpoint sequences and templates (read-only)" },
    { "name": "Settings", "description": "Profiles, tenants, roles, notification preferences, API keys, and thank-you templates" },
    { "name": "Audit", "description": "Audit logs and API request logs (read-only)" },
    { "name": "Overview", "description": "Aggregated dashboard statistics for contacts, donations, and activities" }
  ],
  "paths": {
    "/v1/donors": {
      "get": {
        "tags": ["Donors"],
        "summary": "List donors",
        "description": "**Searchable:** first_name, last_name, email, phone, organization_name, household_name\n\n**Filterable:** status, tier, donor_type, city, state, zip, is_jewish, tags, first_gift_date, last_gift_date, lifetime_giving, this_year_giving, spouse_id, do_not_contact, email_opt_in, mail_opt_in, sms_opt_in, phone_opt_in, is_legacy_prospect, is_major_donor_prospect, is_chai_club_prospect, linkedin_only, created_by, created_at, updated_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/sortParam" },
          { "$ref": "#/components/parameters/selectParam" },
          { "name": "status", "in": "query", "schema": { "type": "string", "enum": ["active", "at_risk", "lapsed", "prospect"] } },
          { "name": "tier", "in": "query", "schema": { "type": "string", "enum": ["top3", "major", "mid", "entry"] } },
          { "name": "donor_type", "in": "query", "schema": { "type": "string" } },
          { "name": "city", "in": "query", "schema": { "type": "string" } },
          { "name": "state", "in": "query", "schema": { "type": "string" } },
          { "name": "tags_contains", "in": "query", "schema": { "type": "string" }, "description": "Filter donors with specific tags (comma-separated)" },
          { "name": "lifetime_giving_gte", "in": "query", "schema": { "type": "number" }, "description": "Minimum lifetime giving" },
          { "name": "lifetime_giving_lte", "in": "query", "schema": { "type": "number" }, "description": "Maximum lifetime giving" },
          { "name": "do_not_contact_is", "in": "query", "schema": { "type": "string" }, "description": "true or false" },
          { "name": "is_jewish_is", "in": "query", "schema": { "type": "string" }, "description": "true or false" },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": {
          "200": { "description": "Paginated list of donors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedResponse" } } } },
          "401": { "description": "Unauthorized" }
        }
      },
      "post": {
        "tags": ["Donors"],
        "summary": "Create a donor",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Donor" } } } },
        "responses": {
          "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SingleResponse" } } } },
          "400": { "description": "Validation error" }
        }
      }
    },
    "/v1/donors/{id}": {
      "get": {
        "tags": ["Donors"],
        "summary": "Get a donor",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/selectParam" },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Donor details" }, "404": { "description": "Not found" } }
      },
      "patch": {
        "tags": ["Donors"],
        "summary": "Update a donor",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Donor" } } } },
        "responses": { "200": { "description": "Updated" }, "404": { "description": "Not found" } }
      },
      "delete": {
        "tags": ["Donors"],
        "summary": "Delete a donor (soft delete)",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Deleted" }, "404": { "description": "Not found" } }
      }
    },
    "/v1/donations": {
      "get": {
        "tags": ["Donations"],
        "summary": "List donations",
        "description": "**Searchable:** notes, reference_number, honor_memorial_name\n\n**Filterable:** amount, date, type, payment_method, campaign, donor_id, gift_category, source, receipt_sent, deposit_date, fee_amount, thanked_at, created_by, payment_provider, provider_transaction_id, non_deductible_amount, soft_credit_amount, honor_memorial_type, created_at, updated_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/sortParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "campaign", "in": "query", "schema": { "type": "string" } },
          { "name": "type", "in": "query", "schema": { "type": "string" } },
          { "name": "amount_gte", "in": "query", "schema": { "type": "number" } },
          { "name": "amount_lte", "in": "query", "schema": { "type": "number" } },
          { "name": "date_gte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "date_lte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Donations"],
        "summary": "Record a donation",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Donation" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/donations/{id}": {
      "get": {
        "tags": ["Donations"],
        "summary": "Get a donation",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Donation details" }, "404": { "description": "Not found" } }
      },
      "patch": {
        "tags": ["Donations"],
        "summary": "Update a donation",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Donation" } } } },
        "responses": { "200": { "description": "Updated" } }
      },
      "delete": {
        "tags": ["Donations"],
        "summary": "Delete a donation (soft delete)",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Deleted" } }
      }
    },
    "/v1/activities": {
      "get": {
        "tags": ["Activities"],
        "summary": "List activities",
        "description": "**Searchable:** title, description, notes\n\n**Filterable:** status, activity_type, priority, donor_id, assigned_to, due_date, completed_at, event_id, snoozed_until, created_by, custom_type_key, created_by_flow_id, due_date_all_day, reminder_sent, created_at, updated_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/sortParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "name": "activity_type", "in": "query", "schema": { "type": "string" } },
          { "name": "priority", "in": "query", "schema": { "type": "string" } },
          { "name": "assigned_to", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "due_date_gte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "due_date_lte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Activities"],
        "summary": "Create an activity",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Activity" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/activities/{id}": {
      "get": {
        "tags": ["Activities"],
        "summary": "Get an activity",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Activity details" }, "404": { "description": "Not found" } }
      },
      "patch": {
        "tags": ["Activities"],
        "summary": "Update an activity",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Activity" } } } },
        "responses": { "200": { "description": "Updated" } }
      },
      "delete": {
        "tags": ["Activities"],
        "summary": "Delete an activity (soft delete)",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Deleted" } }
      }
    },
    "/v1/pledges": {
      "get": {
        "tags": ["Pledges"],
        "summary": "List pledges",
        "description": "**Searchable:** notes\n\n**Filterable:** status, donor_id, payment_frequency, start_date, end_date, total_amount, paid_amount, balance, campaign, created_by, created_at, updated_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/sortParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Pledges"],
        "summary": "Create a pledge",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pledge" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/pledges/{id}": {
      "get": {
        "tags": ["Pledges"],
        "summary": "Get a pledge",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Pledge details" } }
      },
      "patch": {
        "tags": ["Pledges"],
        "summary": "Update a pledge",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pledge" } } } },
        "responses": { "200": { "description": "Updated" } }
      }
    },
    "/v1/pledge_payments": {
      "get": {
        "tags": ["Pledges"],
        "summary": "List pledge payments",
        "description": "**Filterable:** pledge_id (required), due_date, amount, paid_amount, paid_at, donation_id, reminder_sent, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "pledge_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Required. The pledge to list payments for." },
          { "name": "due_date_gte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "due_date_lte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "paid_at_is", "in": "query", "schema": { "type": "string" }, "description": "Use paid_at_is=null for unpaid" },
          { "name": "reminder_sent_is", "in": "query", "schema": { "type": "string" }, "description": "true or false" },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Pledges"],
        "summary": "Record a pledge payment",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PledgePayment" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/events": {
      "get": {
        "tags": ["Events"],
        "summary": "List events",
        "description": "**Searchable:** name, description, location\n\n**Filterable:** event_type, event_date, is_template, holiday_key, hebrew_year, attendance_count, created_by, created_at, updated_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/sortParam" },
          { "name": "event_type", "in": "query", "schema": { "type": "string" } },
          { "name": "event_date_gte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "event_date_lte", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "is_template_is", "in": "query", "schema": { "type": "string" }, "description": "true or false" },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Events"],
        "summary": "Create an event",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Event" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "tags": ["Events"],
        "summary": "Get an event",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Event details" } }
      },
      "patch": {
        "tags": ["Events"],
        "summary": "Update an event",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Event" } } } },
        "responses": { "200": { "description": "Updated" } }
      }
    },
    "/v1/event_rsvps": {
      "get": {
        "tags": ["Events"],
        "summary": "List event RSVPs",
        "description": "**Filterable:** event_id, donor_id, status, registered_by, registered_at, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "event_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Events"],
        "summary": "Create an RSVP",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventRsvp" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/campaigns": {
      "get": {
        "tags": ["Campaigns"],
        "summary": "List campaigns",
        "description": "**Searchable:** name, description\n\n**Filterable:** status, slug, is_default, start_date, end_date, goal_amount, created_by, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/sortParam" },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Campaigns"],
        "summary": "Create a campaign",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Campaign" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/campaigns/{id}": {
      "get": {
        "tags": ["Campaigns"],
        "summary": "Get a campaign",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Campaign details" } }
      },
      "patch": {
        "tags": ["Campaigns"],
        "summary": "Update a campaign",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Campaign" } } } },
        "responses": { "200": { "description": "Updated" } }
      }
    },
    "/v1/donor_notes": {
      "get": {
        "tags": ["Notes"],
        "summary": "List donor notes",
        "description": "**Searchable:** content\n\n**Filterable:** donor_id (required), note_type, is_pinned, activity_id, donation_id, created_by, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "donor_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "name": "note_type", "in": "query", "schema": { "type": "string" } },
          { "name": "is_pinned_is", "in": "query", "schema": { "type": "string" }, "description": "true or false" },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Notes"],
        "summary": "Create a note",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorNote" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/donor_special_dates": {
      "get": {
        "tags": ["Special Dates"],
        "summary": "List special dates",
        "description": "**Searchable:** custom_label, notes\n\n**Filterable:** donor_id, date_type, date_value, use_hebrew_calendar, auto_create_activity, reminder_days_before, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "date_type", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Special Dates"],
        "summary": "Create a special date",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorSpecialDate" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/donor_special_dates/{id}": {
      "get": {
        "tags": ["Special Dates"],
        "summary": "Get a special date",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Special date details" } }
      },
      "patch": {
        "tags": ["Special Dates"],
        "summary": "Update a special date",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorSpecialDate" } } } },
        "responses": { "200": { "description": "Updated" } }
      },
      "delete": {
        "tags": ["Special Dates"],
        "summary": "Delete a special date (soft delete)",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Deleted" } }
      }
    },
    "/v1/donor_favorites": {
      "get": {
        "tags": ["Favorites"],
        "summary": "List favorites",
        "description": "**Filterable:** donor_id, user_id, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "user_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Favorites"],
        "summary": "Favorite a donor",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorFavorite" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/donor_segments": {
      "get": {
        "tags": ["Segments"],
        "summary": "List custom segments",
        "description": "**Searchable:** name, description\n\n**Filterable:** entity_type, created_by, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Segments"],
        "summary": "Create a segment",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorSegment" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/donor_segments/{id}": {
      "get": {
        "tags": ["Segments"],
        "summary": "Get a segment",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Segment details" } }
      },
      "patch": {
        "tags": ["Segments"],
        "summary": "Update a segment",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorSegment" } } } },
        "responses": { "200": { "description": "Updated" } }
      }
    },
    "/v1/platform_segments": {
      "get": {
        "tags": ["Segments"],
        "summary": "List platform segments (read-only)",
        "description": "**Searchable:** name, description\n\n**Filterable:** slug, entity_type, is_active, sort_order",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/tenant_platform_segments": {
      "get": {
        "tags": ["Segments"],
        "summary": "List tenant platform segment settings",
        "description": "**Filterable:** platform_segment_id, is_enabled",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "is_enabled_is", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/donor_lists": {
      "get": {
        "tags": ["Lists"],
        "summary": "List donor lists",
        "description": "**Searchable:** name, description\n\n**Filterable:** created_by, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Lists"],
        "summary": "Create a donor list",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorList" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/donor_list_members": {
      "get": {
        "tags": ["Lists"],
        "summary": "List members of a donor list",
        "description": "**Filterable:** list_id (required), donor_id, added_by, added_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "list_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Lists"],
        "summary": "Add a donor to a list",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DonorListMember" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/action_flows": {
      "get": {
        "tags": ["Action Flows"],
        "summary": "List action flows",
        "description": "**Searchable:** name, description\n\n**Filterable:** status, trigger_type, created_by, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "$ref": "#/components/parameters/sortParam" },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "name": "trigger_type", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Action Flows"],
        "summary": "Create an action flow",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ActionFlow" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/action_flows/{id}": {
      "get": {
        "tags": ["Action Flows"],
        "summary": "Get an action flow",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Action flow details" } }
      },
      "patch": {
        "tags": ["Action Flows"],
        "summary": "Update an action flow",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ActionFlow" } } } },
        "responses": { "200": { "description": "Updated" } }
      }
    },
    "/v1/drip_enrollments": {
      "get": {
        "tags": ["Drip Campaigns"],
        "summary": "List drip enrollments",
        "description": "**Filterable:** action_flow_id, donor_id, status, enrolled_at, exited_at, exit_reason, next_send_at, current_step_index, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "action_flow_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Drip Campaigns"],
        "summary": "Create a drip enrollment",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DripEnrollment" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/drip_send_log": {
      "get": {
        "tags": ["Drip Campaigns"],
        "summary": "List drip send logs (read-only)",
        "description": "**Searchable:** subject, to_email\n\n**Filterable:** enrollment_id, donor_id, status, step_index, sent_at, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "enrollment_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/tenant_drip_sequences": {
      "get": {
        "tags": ["Drip Campaigns"],
        "summary": "List tenant drip sequences",
        "description": "**Searchable:** name\n\n**Filterable:** status, platform_sequence_id, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "status", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/tenant_drip_step_overrides": {
      "get": {
        "tags": ["Drip Campaigns"],
        "summary": "List tenant drip step overrides",
        "description": "**Filterable:** sequence_id, platform_step_id",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "sequence_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/platform_drip_sequences": {
      "get": {
        "tags": ["Drip Campaigns"],
        "summary": "List platform drip sequences (read-only)",
        "description": "**Searchable:** name\n\n**Filterable:** status, is_active, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/platform_drip_sequence_steps": {
      "get": {
        "tags": ["Drip Campaigns"],
        "summary": "List platform drip sequence steps (read-only)",
        "description": "**Searchable:** subject\n\n**Filterable:** sequence_id, step_index",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "sequence_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/email_threads": {
      "get": {
        "tags": ["Email"],
        "summary": "List email threads",
        "description": "**Searchable:** subject\n\n**Filterable:** donor_id, connection_id, provider_thread_id, is_archived, is_read, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "connection_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/email_messages": {
      "get": {
        "tags": ["Email"],
        "summary": "List email messages (read-only)",
        "description": "**Searchable:** subject, snippet\n\n**Filterable:** thread_id, from_email, is_outbound, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "thread_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "from_email", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/email_outbox": {
      "get": {
        "tags": ["Email"],
        "summary": "List outbox emails",
        "description": "**Searchable:** subject, body_text\n\n**Filterable:** donor_id, status, sent_at, template_id, connection_id, created_by, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/email_templates": {
      "get": {
        "tags": ["Email"],
        "summary": "List email templates",
        "description": "**Searchable:** name, subject\n\n**Filterable:** category, is_shared, created_by, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "category", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Email"],
        "summary": "Create an email template",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailTemplate" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/email_delegations": {
      "get": {
        "tags": ["Email"],
        "summary": "List email delegations",
        "description": "**Filterable:** connection_id, owner_user_id, delegate_user_id, permission_level, revoked_at, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "connection_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Email"],
        "summary": "Create an email delegation",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailDelegation" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/user_email_connections": {
      "get": {
        "tags": ["Email"],
        "summary": "List email connections",
        "description": "**Searchable:** email_address\n\n**Filterable:** user_id, provider, sync_enabled, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "user_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/email_engagement_events": {
      "get": {
        "tags": ["Email"],
        "summary": "List email engagement events (read-only)",
        "description": "**Filterable:** donor_id, event_type, source, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "event_type", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/sms_logs": {
      "get": {
        "tags": ["SMS"],
        "summary": "List SMS logs",
        "description": "**Searchable:** message_body, to_number\n\n**Filterable:** donor_id, status, connection_id, sent_by, created_at, deleted_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "$ref": "#/components/parameters/includeDeletedParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/tenant_sms_connections": {
      "get": {
        "tags": ["SMS"],
        "summary": "List SMS connections",
        "description": "**Filterable:** provider, is_active, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/webhook_endpoints": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "List webhook endpoints",
        "description": "**Searchable:** name, url_path\n\n**Filterable:** is_active, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Webhooks"],
        "summary": "Create a webhook endpoint",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEndpoint" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/webhook_events": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "List webhook events (read-only)",
        "description": "**Searchable:** event_type\n\n**Filterable:** endpoint_id, source, status, event_type, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "endpoint_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/form_mappings": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "List form mappings",
        "description": "**Searchable:** form_name\n\n**Filterable:** webhook_endpoint_id, form_type, is_active, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "webhook_endpoint_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Webhooks"],
        "summary": "Create a form mapping",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FormMapping" } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/import_jobs": {
      "get": {
        "tags": ["Import"],
        "summary": "List import jobs",
        "description": "**Searchable:** file_name\n\n**Filterable:** status, import_type, created_by, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "name": "import_type", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/import_rows": {
      "get": {
        "tags": ["Import"],
        "summary": "List import rows",
        "description": "**Filterable:** import_job_id, status, row_number",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "import_job_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/receipt_logs": {
      "get": {
        "tags": ["Receipts"],
        "summary": "List receipt logs",
        "description": "**Filterable:** donation_id, donor_id, receipt_number, receipt_type, generated_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "donation_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/receipt_templates": {
      "get": {
        "tags": ["Receipts"],
        "summary": "List receipt templates",
        "description": "**Searchable:** name\n\n**Filterable:** is_default, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/duplicate_groups": {
      "get": {
        "tags": ["Duplicates"],
        "summary": "List duplicate groups",
        "description": "**Searchable:** reason\n\n**Filterable:** status, confidence, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "status", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/duplicate_dismissals": {
      "get": {
        "tags": ["Duplicates"],
        "summary": "List duplicate dismissals",
        "description": "**Filterable:** donor_id_a, donor_id_b, dismissed_by, dismissed_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Duplicates"],
        "summary": "Dismiss a duplicate pair",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["donor_id_a", "donor_id_b"], "properties": { "donor_id_a": { "type": "string", "format": "uuid" }, "donor_id_b": { "type": "string", "format": "uuid" } } } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/enrichment_logs": {
      "get": {
        "tags": ["Enrichment"],
        "summary": "List enrichment logs (read-only)",
        "description": "**Filterable:** donor_id, status, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "status", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/enrichment_usage_log": {
      "get": {
        "tags": ["Enrichment"],
        "summary": "List enrichment usage (read-only)",
        "description": "**Filterable:** created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/operation_jobs": {
      "get": {
        "tags": ["Operations"],
        "summary": "List operation jobs",
        "description": "**Filterable:** status, entity_type, operation_type, conflict_key, created_by, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "status", "in": "query", "schema": { "type": "string" } },
          { "name": "entity_type", "in": "query", "schema": { "type": "string" } },
          { "name": "operation_type", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/chat_conversations": {
      "get": {
        "tags": ["Chat"],
        "summary": "List chat conversations",
        "description": "**Searchable:** title\n\n**Filterable:** user_id, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Chat"],
        "summary": "Create a conversation",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "nullable": true } } } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/chat_messages": {
      "get": {
        "tags": ["Chat"],
        "summary": "List chat messages",
        "description": "**Searchable:** content\n\n**Filterable:** conversation_id, role, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "conversation_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      },
      "post": {
        "tags": ["Chat"],
        "summary": "Create a message",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["conversation_id", "content", "role"], "properties": { "conversation_id": { "type": "string", "format": "uuid" }, "content": { "type": "string" }, "role": { "type": "string" } } } } } },
        "responses": { "201": { "description": "Created" } }
      }
    },
    "/v1/touchpoint_sequences": {
      "get": {
        "tags": ["Touchpoints"],
        "summary": "List touchpoint sequences (read-only)",
        "description": "**Searchable:** title, description\n\n**Filterable:** is_active, category, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/touchpoint_templates": {
      "get": {
        "tags": ["Touchpoints"],
        "summary": "List touchpoint templates (read-only)",
        "description": "**Searchable:** title, description\n\n**Filterable:** suggested_activity_type, category, is_active, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "category", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/profiles": {
      "get": {
        "tags": ["Settings"],
        "summary": "List profiles",
        "description": "**Searchable:** first_name, last_name, email\n\n**Filterable:** auth_user_id, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/profiles/{id}": {
      "get": {
        "tags": ["Settings"],
        "summary": "Get a profile",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Profile details" } }
      },
      "patch": {
        "tags": ["Settings"],
        "summary": "Update a profile",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Updated" } }
      }
    },
    "/v1/tenants": {
      "get": {
        "tags": ["Settings"],
        "summary": "List tenants",
        "description": "**Searchable:** name, slug\n\n**Filterable:** slug, status, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/user_roles": {
      "get": {
        "tags": ["Settings"],
        "summary": "List user roles",
        "description": "**Filterable:** user_id, tenant_role, platform_role, is_impersonated, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "user_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "tenant_role", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/notifications": {
      "get": {
        "tags": ["Settings"],
        "summary": "List notifications",
        "description": "**Searchable:** title, message\n\n**Filterable:** user_id, event_type, is_read, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "user_id", "in": "query", "schema": { "type": "string", "format": "uuid" } },
          { "name": "is_read_is", "in": "query", "schema": { "type": "string" }, "description": "true or false" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/activity_type_configs": {
      "get": {
        "tags": ["Settings"],
        "summary": "List activity type configurations",
        "description": "**Searchable:** label, type_key\n\n**Filterable:** type_key, is_active, is_platform_default, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/user_notification_preferences": {
      "get": {
        "tags": ["Settings"],
        "summary": "List notification preferences",
        "description": "**Filterable:** user_id, event_type, channel, is_enabled",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "user_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/tenant_api_keys": {
      "get": {
        "tags": ["Settings"],
        "summary": "List API keys",
        "description": "**Searchable:** name\n\n**Filterable:** is_active, created_at, expires_at, last_used_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/thank_you_templates": {
      "get": {
        "tags": ["Settings"],
        "summary": "List thank-you letter templates",
        "description": "**Searchable:** name\n\n**Filterable:** is_default, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/communication_preference_history": {
      "get": {
        "tags": ["Settings"],
        "summary": "List communication preference history (read-only)",
        "description": "**Filterable:** donor_id, changed_field, change_source, changed_by, changed_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "name": "donor_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/audit_log": {
      "get": {
        "tags": ["Audit"],
        "summary": "List audit log entries (read-only)",
        "description": "**Searchable:** action, table_name\n\n**Filterable:** user_id, table_name, action, record_id, source, is_platform_admin, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "table_name", "in": "query", "schema": { "type": "string" } },
          { "name": "action", "in": "query", "schema": { "type": "string" } },
          { "name": "user_id", "in": "query", "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/api_request_logs": {
      "get": {
        "tags": ["Audit"],
        "summary": "List API request logs (read-only)",
        "description": "**Searchable:** endpoint\n\n**Filterable:** api_key_id, method, status_code, endpoint, created_at",
        "parameters": [
          { "$ref": "#/components/parameters/limitParam" },
          { "$ref": "#/components/parameters/offsetParam" },
          { "$ref": "#/components/parameters/searchParam" },
          { "name": "method", "in": "query", "schema": { "type": "string" } },
          { "name": "status_code", "in": "query", "schema": { "type": "integer" } }
        ],
        "responses": { "200": { "description": "Paginated list" } }
      }
    },
    "/v1/overview/contacts": {
      "get": {
        "tags": ["Overview"],
        "summary": "Contacts overview",
        "description": "Returns aggregated contact/donor statistics including lifecycle counts, segment counts, tag counts, alphabet index, platform segments, and chai club IDs.",
        "parameters": [
          { "name": "major_threshold", "in": "query", "schema": { "type": "number" }, "description": "Major donor threshold amount" },
          { "name": "top3_threshold", "in": "query", "schema": { "type": "number" }, "description": "Top 3% donor threshold amount" },
          { "name": "at_risk_months", "in": "query", "schema": { "type": "integer", "default": 10 }, "description": "Months since last gift to be at risk" },
          { "name": "lapsed_months", "in": "query", "schema": { "type": "integer", "default": 24 }, "description": "Months since last gift to be lapsed" },
          { "name": "cold_months", "in": "query", "schema": { "type": "integer", "default": 60 }, "description": "Months since last gift to be cold" },
          { "name": "new_donor_days", "in": "query", "schema": { "type": "integer", "default": 30 }, "description": "Days since first gift to be new" }
        ],
        "responses": { "200": { "description": "Aggregated contact statistics" } }
      }
    },
    "/v1/overview/donations": {
      "get": {
        "tags": ["Overview"],
        "summary": "Donations overview",
        "description": "Returns aggregated donation statistics including monthly, YTD, lifetime giving, and retention rate.",
        "responses": { "200": { "description": "Aggregated donation statistics" } }
      }
    },
    "/v1/overview/activities": {
      "get": {
        "tags": ["Overview"],
        "summary": "Activities overview",
        "description": "Returns aggregated activity statistics including status breakdowns, type counts, and overdue counts.",
        "responses": { "200": { "description": "Aggregated activity statistics" } }
      }
    }
  }
}