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

# Create fund

> Creates a partner-managed DAF using the acting user identity and partnerAccountIdentifier idempotency.

      The acting user is resolved in one of two ways:
      - Tech-platform impersonation: a partner API key plus the `x-endaoment-user-id` user header (or partner OIDC bearer).
      - API-key-only body resolution: a partner API key plus a body `partnerUserIdentifier` and no impersonation header,
        available when partner inflow routes are enabled. The identifier selects a partner-owned, previously provisioned user.

      When both a header/OIDC user and a body `partnerUserIdentifier` are supplied they must resolve to the same user;
      a contradiction is rejected with `400` and an identifier that does not match a user for this partner is `404`.



## OpenAPI

````yaml https://api.endaoment.org/oas-json post /v1/funds/partner
openapi: 3.0.0
info:
  title: Endaoment API
  description: >-
    The official Endaoment API endpoints. Dev (canary) = newest features;
    Staging (stable) = pre-production.
  version: 0.0.0-dev
  contact: {}
servers:
  - url: https://api.endaoment.org
    description: Production
security: []
tags:
  - name: Partner Endpoints
    description: Tech-platform partner server-to-server APIs
  - name: Authentication
    description: OAuth callers, API keys, and session verification
  - name: Funds
    description: Donor-advised fund lifecycle
  - name: Donations
    description: Donation pledges, supported assets, and impact totals
  - name: Portfolios
    description: Investment portfolio catalog
  - name: Nonprofit Organizations
    description: Nonprofit lookup, subprojects, and missing-org intake
  - name: Grant Transfers
    description: Grant and entity transfers
  - name: Collaboration
    description: Collaborator recommendations and fund collaboration
  - name: Activity
    description: Public and scoped activity feeds
paths:
  /v1/funds/partner:
    post:
      tags:
        - Partner Endpoints
      summary: Create fund
      description: >-
        Creates a partner-managed DAF using the acting user identity and
        partnerAccountIdentifier idempotency.

              The acting user is resolved in one of two ways:
              - Tech-platform impersonation: a partner API key plus the `x-endaoment-user-id` user header (or partner OIDC bearer).
              - API-key-only body resolution: a partner API key plus a body `partnerUserIdentifier` and no impersonation header,
                available when partner inflow routes are enabled. The identifier selects a partner-owned, previously provisioned user.

              When both a header/OIDC user and a body `partnerUserIdentifier` are supplied they must resolve to the same user;
              a contradiction is rejected with `400` and an identifier that does not match a user for this partner is `404`.
      operationId: FundsController_processPartnerFund_v1
      parameters:
        - name: x-endaoment-user-id
          in: header
          description: >-
            UUID of the Endaoment user to act as. Optional when a body
            `partnerUserIdentifier` is supplied on an API-key-only request (no
            impersonation header).
          required: false
          schema:
            type: string
        - name: x-api-key
          in: header
          description: >-
            Partner API key. Required for server-to-server partner flows; omit
            when the caller presents a registered OAuth client access token via
            Bearer auth.
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerCreateFundInputDto'
      responses:
        '200':
          description: An existing partner-managed fund was returned idempotently.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundDetailsDto'
        '201':
          description: >-
            A new partner-managed fund has been successfully created and
            processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundDetailsDto'
        '400':
          description: >-
            Invalid fund input, or a body `partnerUserIdentifier` that
            contradicts the authenticated/impersonated user.
        '401':
          description: >-
            Missing or invalid partner auth, or no acting user could be
            resolved.
        '403':
          description: >-
            Partner is authenticated but not configured to create partner funds
            (lacks `canManageUsers`).
        '404':
          description: >-
            The supplied partnerUserIdentifier did not match a provisioned user
            for the authenticated partner.
        '409':
          description: >-
            The partnerAccountIdentifier is already associated with another user
            for this partner.
      security:
        - ApiKey: []
        - bearer: []
components:
  schemas:
    PartnerCreateFundInputDto:
      type: object
      properties:
        name:
          type: string
          description: Name of the fund
          maxLength: 255
          example: Lovelace Family DAF
        description:
          type: string
          description: >-
            Description of the fund. Defaults to the partner DAF name when
            omitted.
          example: A family DAF managed through a partner integration
        type:
          type: string
          description: Type of the fund being created.
          enum:
            - Private
            - Transparent
          example: Private
        partnerUserIdentifier:
          type: string
          description: >-
            Opaque partner-generated identifier for the acting user. Used only
            to resolve or corroborate the user; it is not stored on the fund or
            returned in the response.
          example: c3f8b2e4-9d1a-4f6b-8e2c-7a5d90c41b3f
          minLength: 8
          maxLength: 64
          pattern: ^[\x20-\x7E]{8,64}$
        partnerAccountIdentifier:
          type: string
          description: >-
            Opaque partner-generated identifier for this fund, used as the
            partner-scoped idempotency key. Must be 8-64 printable ASCII
            characters; leading/trailing whitespace is trimmed before
            validation.
          example: a7e21d94-5c3f-4b8a-9f60-2e4d8c1b7a53
          minLength: 8
          maxLength: 64
          pattern: ^[\x20-\x7E]{8,64}$
      required:
        - name
        - partnerAccountIdentifier
    FundDetailsDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the fund
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Name of the fund
          example: Doe Family Foundation
        type:
          type: string
          description: Access type of the fund
          enum:
            - Private
            - Community
            - Transparent
            - ImpactPool
          example: Private
        manager:
          description: >-
            Basic information about the fund manager. The manager has technical
            capability to interact with the blockchain and perform programmatic
            functions.
          allOf:
            - $ref: '#/components/schemas/FundManager'
        chainId:
          type: object
          description: Chain ID where the fund is deployed
          example: 1
        deploymentTransactionHash:
          type: object
          description: Transaction hash of the deployment transaction
          example: '0xf89f7da1e5d79dcb1b8863d0926fe41204785b443ce2d1dca4bf50070c492567'
          nullable: true
        contractAddress:
          type: object
          description: Contract address of the fund
          example: '0x1234567890123456789012345678901234567890'
          nullable: true
        advisor:
          description: >-
            Fund advisor information. The advisor is tied to a real-world
            person/entity and acts as the public contact for the fund. This can
            be the same person as the manager or someone the manager acts on
            behalf of.
          allOf:
            - $ref: '#/components/schemas/FundAdvisor'
        featuredIndex:
          type: number
          description: >-
            Index determining the fund's position in featured listings. Lower
            numbers appear first
          example: 1
        usdcBalance:
          type: string
          description: >-
            Current synced USDC balance in the smallest currency unit (1000000 =
            1 USD). This does not account for asynchronous grants, asynchronous
            entity transfers, or asynchronous investments that may still be
            processing.
          example: '20500000'
        availableBalance:
          type: string
          description: >-
            Amount available to grant or transfer in the smallest currency unit
            (1000000 = 1 USD), adjusted for invested value, in-transit portfolio
            operations, and pending asynchronous transfers.
          example: '21000000'
        lastBalanceSyncUtc:
          type: object
          description: UTC timestamp of the last balance sync
          example: '2024-03-14T12:00:00Z'
          nullable: true
        description:
          type: string
          description: Detailed description of the fund
          example: A family foundation dedicated to supporting educational initiatives
        shortDescription:
          type: object
          description: Brief description of the fund
          example: Supporting education
          nullable: true
        vanityUrl:
          type: object
          description: Custom URL identifier for the fund
          example: doe-family-foundation
          nullable: true
        paypalId:
          type: object
          description: PayPal merchant ID associated with the fund
          nullable: true
          example: 123e4567-e89b-12d3-a456-426614174000
        logo:
          type: object
          description: URL of the fund's logo image
          example: https://example.com/logo.png
          nullable: true
        createdAtUtc:
          type: string
          description: UTC timestamp of fund creation
          example: '2024-01-01T00:00:00Z'
        updatedAtUtc:
          type: string
          description: UTC timestamp of last fund update
          example: '2024-03-14T12:00:00Z'
        lifetimeDonationsUsdc:
          type: string
          description: >-
            Total lifetime donations received in USDC, in the smallest currency
            unit (1000000 = 1 USD)
          example: '1000000000'
        staffNotes:
          type: string
          description: Internal notes about the fund (staff only)
          nullable: true
        category:
          type: object
          description: Category of the fund (e.g., Education, Health)
          example: Education
          nullable: true
        inboundFeeBps:
          type: number
          description: >-
            The fee charged for inbound operations in basis points (1 basis
            point = 0.01%)
          example: 25
        outboundFeeBps:
          type: number
          description: >-
            The fee charged for outbound operations in basis points (1 basis
            point = 0.01%)
          example: 50
        customFeeDetail:
          type: object
          description: >-
            Details about why this fund has custom fees. Only set if either
            inbound or outbound fee is custom
          example: Special Community Fund Agreement
          nullable: true
        grantsGiven:
          type: number
          description: Total number of grants given by this fund
          example: 10
        inTransitBuyUsdcAmount:
          type: string
          description: >-
            Amount of USDC pending purchase in the smallest currency unit
            (1000000 = 1 USD)
          example: '5000000'
        inTransitSellUsdcAmount:
          type: string
          description: >-
            Amount of USDC pending sale in the smallest currency unit (1000000 =
            1 USD)
          example: '3000000'
        investedUsdc:
          type: string
          description: >-
            Total amount invested in USDC, in the smallest currency unit
            (1000000 = 1 USD)
          example: '50000000'
        totalGrantedUsdc:
          type: string
          description: >-
            Total amount granted in USDC, in the smallest currency unit (1000000
            = 1 USD)
          example: '25000000'
        processingTransfersTotalUsdc:
          type: string
          description: >-
            Total amount in processing transfers in USDC, in the smallest
            currency unit (1000000 = 1 USD)
          example: '1000000'
        illiquidBalance:
          type: string
          description: >-
            Total balance in illiquid portfolios in USDC, in the smallest
            currency unit (1000000 = 1 USD)
          example: '10000000'
        poolDetails:
          description: >-
            Impact Pool specific details. Only available for Impact Pool type
            funds
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/ImpactPoolDetailsDto'
        expectedDeploymentInfo:
          description: >-
            Information needed for on-chain deployment. Only available for funds
            not yet deployed
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/ExpectedDeploymentInfoDto'
      required:
        - id
        - name
        - type
        - manager
        - chainId
        - advisor
        - featuredIndex
        - usdcBalance
        - availableBalance
        - description
        - createdAtUtc
        - updatedAtUtc
        - lifetimeDonationsUsdc
        - inboundFeeBps
        - outboundFeeBps
        - grantsGiven
        - inTransitBuyUsdcAmount
        - inTransitSellUsdcAmount
        - investedUsdc
        - totalGrantedUsdc
        - processingTransfersTotalUsdc
        - illiquidBalance
        - poolDetails
        - expectedDeploymentInfo
    FundManager:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the fund manager
          example: 123e4567-e89b-12d3-a456-426614174000
        walletAddress:
          type: string
          description: Ethereum wallet address of the fund manager
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
      required:
        - id
        - walletAddress
    FundAdvisor:
      type: object
      properties:
        firstName:
          type: string
          description: First name of the fund advisor
          example: John
        lastName:
          type: string
          description: Last name of the fund advisor
          example: Doe
      required:
        - firstName
        - lastName
    ImpactPoolDetailsDto:
      type: object
      properties:
        eligibleEntities:
          type: string
          description: Entities that are eligible for Impact Pool distributions
          enum:
            - Organizations
          example: Organizations
        algorithmType:
          type: string
          description: Algorithm used to calculate distributions
          enum:
            - QuadraticFunding
          example: QuadraticFunding
        distributionSchedule:
          type: string
          description: Human-readable distribution schedule
          example: Quarterly
        distributionPercentage:
          type: number
          description: Percentage of fund NAV to be distributed (0.25 = 25%, 0.125 = 12.5%)
          example: 0.25
          minimum: 0
          maximum: 1
        eligibleVotes:
          type: string
          description: Types of actions that count as votes for distribution
          enum:
            - GrantsAndDonations
          example: GrantsAndDonations
        voteWeight:
          type: string
          description: Method for calculating vote weights
          enum:
            - UsdcValue
          example: UsdcValue
      required:
        - eligibleEntities
        - algorithmType
        - distributionSchedule
        - distributionPercentage
        - eligibleVotes
        - voteWeight
    ExpectedDeploymentInfoDto:
      type: object
      properties:
        expectedManagerAddress:
          type: string
          description: >-
            Ethereum address of the fund manager used to compute the on-chain
            address
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
        expectedSalt:
          type: string
          description: Encoded bytes32 salt used to compute the on-chain address
          example: '0x0000000000000000000000000000000000000000000000000000000000000123'
        expectedComputedAddress:
          type: string
          description: >-
            Expected on-chain address computed using the manager address and
            salt. Must be verified before deployment
          example: '0x1234567890123456789012345678901234567890'
        expectedChainId:
          type: object
          description: Chain ID where the fund should be deployed
          example: 1
      required:
        - expectedManagerAddress
        - expectedSalt
        - expectedComputedAddress
        - expectedChainId
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````