> ## Documentation Index
> Fetch the complete documentation index at: https://docs.grainledger.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List donors



## OpenAPI

````yaml /openapi.json get /api/v1/donors
openapi: 3.0.3
info:
  title: Grain API
  description: >-
    Church accounting and donor management API. Use an organization API key for
    server automation or OAuth 2.1 (Sign in with Grain) for applications acting
    on behalf of users. Unmanaged OAuth requests require X-Organization-Id;
    Grain-managed OAuth apps may list authorized organizations first. API keys
    infer the organization.
  version: 1.3.0
servers:
  - url: https://api.grainledger.com
    description: API Server
security:
  - ApiKeyAuth: []
  - GrainOAuth2: []
  - BearerAuth: []
tags:
  - name: Funds
    description: Active funds available for integration mapping
  - name: Coding Reference Data
    description: Accounts, dimensions, and vendors used to code transactions
  - name: Transactions
    description: Bank transactions, coding, approval, and receipts
  - name: Bills
    description: Vendor bills from creation through payment
  - name: Donors
    description: Donor records and household relationships
  - name: Contributions
    description: Giving records with fund assignment and settlement
  - name: Giving Batches
    description: Contribution groups with derived totals and lifecycle state
  - name: Settlements
    description: Provider deposits with recorded and linked-contribution totals
  - name: Pledges
    description: Pledge campaigns and fulfillment tracking
  - name: Pledge Card Imports
    description: Submit structured pledge card data for review
  - name: Households
    description: Household groupings and primary contacts
  - name: Organizations
    description: Organizations the current Grain OAuth app is authorized to access
paths:
  /api/v1/donors:
    get:
      tags:
        - Donors
      summary: List donors
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Limit'
        - name: search
          in: query
          schema:
            type: string
        - name: householdRef
          in: query
          schema:
            type: string
        - name: isActive
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
        - name: hasGiven
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
        - name: lastGiftFrom
          in: query
          schema:
            type: string
            format: date
        - name: lastGiftTo
          in: query
          schema:
            type: string
            format: date
        - name: states
          in: query
          description: Comma-separated state values.
          schema:
            type: string
        - name: cities
          in: query
          description: Comma-separated city values.
          schema:
            type: string
        - name: zipCodes
          in: query
          description: Comma-separated postal codes.
          schema:
            type: string
        - name: membershipStatuses
          in: query
          description: Comma-separated membership statuses.
          schema:
            type: string
        - name: donorTypes
          in: query
          description: Comma-separated donor types.
          schema:
            type: string
        - name: givingAmountMin
          in: query
          schema:
            type: number
        - name: givingAmountMax
          in: query
          schema:
            type: number
        - name: hasEmail
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
        - name: hasPhone
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
        - name: sortBy
          in: query
          schema:
            type: string
            enum:
              - name
              - totalGiving
              - createdAt
            default: name
        - name: sortOrder
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
      responses:
        '200':
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
          description: Paginated donors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DonorListResponse'
              examples:
                default:
                  $ref: '#/components/examples/DonorListExample'
        '400':
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
          description: Bad request (missing header or invalid input)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
          description: Unauthorized (missing or invalid Bearer token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
          description: Forbidden (no access to organization or action)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
        '409':
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
          description: >-
            Conflict (duplicate, cross-resource ownership conflict, concurrent
            change, or accounting-frozen resource)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              description: >-
                Server-generated ID linking this request to API activity and
                audit records.
              schema:
                type: string
                format: uuid
components:
  parameters:
    OrganizationId:
      name: X-Organization-Id
      in: header
      required: false
      schema:
        type: string
      description: >-
        Required with OAuth access tokens for resource requests. Omit only for
        GET /api/v1/organizations. Optional with organization API keys; if
        supplied with an API key, it must match the key's organization.
      example: cm123abc456def
    Page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
        minimum: 1
      description: Page number (1-based)
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 20
        minimum: 1
        maximum: 1000
      description: Records per page
  schemas:
    DonorListResponse:
      type: object
      properties:
        donors:
          type: array
          items:
            $ref: '#/components/schemas/DonorSummary'
        pagination:
          $ref: '#/components/schemas/Pagination'
    Error:
      type: object
      description: >-
        Every error response is valid JSON with this shape. The HTTP status code
        carries the outcome; `code` is a stable machine-readable form of it.
      required:
        - code
        - message
      properties:
        code:
          type: string
          enum:
            - bad_request
            - unauthorized
            - forbidden
            - not_found
            - conflict
            - unprocessable_entity
            - payload_too_large
            - rate_limited
            - internal_server_error
          example: forbidden
        message:
          type: string
          example: You do not have access to this organization.
        error:
          type: string
          deprecated: true
          description: Deprecated alias for `message`. Read `message` instead.
          example: You do not have access to this organization.
        details:
          type: object
          description: >-
            Present for schema validation failures. Contains safe top-level
            field names and validation codes, never submitted values.
          properties:
            fields:
              type: array
              maxItems: 20
              items:
                type: object
                required:
                  - field
                  - code
                properties:
                  field:
                    type: string
                    example: amount
                  code:
                    type: string
                    example: invalid_type
    DonorSummary:
      type: object
      description: >-
        Compact donor identity, household, membership, and giving summary used
        in list and relationship responses.
      properties:
        id:
          type: string
        firstName:
          type: string
          nullable: true
        lastName:
          type: string
          nullable: true
        organizationName:
          type: string
          nullable: true
        donorType:
          type: string
          enum:
            - INDIVIDUAL
            - HOUSEHOLD
            - ORGANIZATION
            - DAF_CUSTODIAN
            - FOUNDATION
            - ESTATE
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        householdRef:
          type: string
          nullable: true
        householdName:
          type: string
          nullable: true
        householdPosition:
          type: string
          nullable: true
          enum:
            - PRIMARY
            - SPOUSE
            - CHILD
            - OTHER
        isPrimaryContact:
          type: boolean
        membershipStatus:
          type: string
          nullable: true
          enum:
            - VISITOR
            - REGULAR_ATTENDER
            - MEMBER
            - INACTIVE
            - FORMER
        isActive:
          type: boolean
        totalGiving:
          type: number
        givingTrend:
          type: number
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    Pagination:
      type: object
      properties:
        page:
          type: integer
          example: 1
        limit:
          type: integer
          example: 20
        total:
          type: integer
          example: 142
        totalPages:
          type: integer
          example: 8
  examples:
    DonorListExample:
      value:
        donors:
          - id: cm456def789ghi
            firstName: Sarah
            lastName: Johnson
            email: sarah@gracechurch.org
            donorType: INDIVIDUAL
        pagination:
          page: 1
          limit: 20
          total: 142
          totalPages: 8
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: grain_live_… or grain_test_…
      description: >-
        Organization API key created in Grain Settings → API. The key determines
        the organization and is limited to its assigned resource scopes. Write
        scopes imply the corresponding read scope.
    GrainOAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://auth.grainledger.com/auth/v1/oauth/authorize
          tokenUrl: https://auth.grainledger.com/auth/v1/oauth/token
          scopes:
            openid: OpenID Connect
            email: Email address
            profile: Profile information
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth access token (JWT)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.