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

# List files (client portal)

> List files in a directory for a client with filtering, sorting, and pagination



## OpenAPI

````yaml /api-reference/cx/swagger.json post /cp/{client}/files/_list
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /cp/{client}/files/_list:
    post:
      tags:
        - client-portal
      summary: List files (client portal)
      description: >-
        List files in a directory for a client with filtering, sorting, and
        pagination
      parameters:
        - description: Client ID
          name: client
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pkg_routes_cp_files.ListFilesRequest'
        description: List files request
        required: true
      responses:
        '200':
          description: File list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_cp_files.ListFilesResponse'
        '400':
          description: Bad request - invalid client ID, parent ID, or request body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - no access to folder
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Client not found
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_cp_files.ListFilesRequest:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/types.ListPagination'
        parent:
          type: string
        sort:
          $ref: '#/components/schemas/types.ListSort'
    pkg_routes_cp_files.ListFilesResponse:
      type: object
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.File'
        total:
          type: integer
    types.ListPagination:
      type: object
      properties:
        limit:
          type: integer
        skip:
          type: integer
    types.ListSort:
      type: object
      properties:
        field:
          type: string
        last: {}
        order:
          type: integer
    legacytypes.File:
      type: object
      properties:
        _id:
          type: string
        absolute_path:
          type: string
        access:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.FileAccess'
        activity:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Activity'
        client:
          $ref: '#/components/schemas/legacytypes.Client'
        collaborators:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.CollaboratorAccess'
        comments:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Comment'
        context:
          description: Context is used to process the file
          type: string
        cp_upload:
          description: >-
            If the file was uploaded by a client or collaborator, we'll have a
            client upload record for tracking notifications
          allOf:
            - $ref: '#/components/schemas/legacytypes.ExternalUpload'
        created_at:
          type: string
        created_by:
          type: string
        created_by_type:
          type: string
        deleted_at:
          type: string
        favorite:
          type: boolean
        fields:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Field'
        file_links:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.FileLink'
        form:
          $ref: '#/components/schemas/legacytypes.FormTemplate'
        hidden:
          type: boolean
        lock:
          description: For Office 365 file editing/WOPI
          allOf:
            - $ref: '#/components/schemas/legacytypes.FileLock'
        locked:
          type: boolean
        mime_type:
          type: string
        modified_at:
          type: string
        name:
          type: string
        parent:
          type: string
        path:
          description: For returning
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Parent'
        responses:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.FormResponse'
        share_root:
          type: string
        size:
          type: integer
        team:
          type: string
        type:
          description: File mimetype or "folder"
          type: string
        upload_completed_at:
          type: string
        upload_keys:
          description: >-
            If this is a folder and this is set, then users can anonymously
            upload to this folder if they have the link
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.UploadKey'
        url:
          description: Presigned URL to download the file
          type: string
        writeable:
          description: True if this user is able to write to the file
          type: boolean
    legacytypes.FileAccess:
      type: object
      properties:
        scope:
          type: string
        target:
          description: user | team | client
          type: string
        type:
          type: string
    legacytypes.Activity:
      type: object
      properties:
        _id:
          type: string
        action:
          type: string
        changes:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Change'
        client:
          type: string
        on_id:
          type: string
        on_py:
          type: integer
        on_type:
          type: string
        team:
          type: string
        timestamp:
          type: string
        user:
          type: string
    legacytypes.Client:
      type: object
      properties:
        _id:
          type: string
        activity:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Activity'
        address:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Address'
        admin_note:
          description: Internal Admin
          type: string
        allow_multiple_payrolls:
          type: boolean
        assignee_tasks:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.AssigneeTasks'
        assignees:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Assignee'
        billing:
          description: >-
            Billing for services the team provides to this company and its
            plans.
          allOf:
            - $ref: '#/components/schemas/legacytypes.ClientBilling'
        billing_list_metrics:
          $ref: '#/components/schemas/legacytypes.BillingListMetrics'
        business_type:
          description: Business details
          type: string
        census_collection_columns:
          description: >-
            CensusCollectionColumns overrides the team default. Nil means
            inherit.
          type: array
          items:
            $ref: '#/components/schemas/sharedtypes.CensusColumnKey'
        census_status:
          type: string
        census_task:
          type: string
        comments:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Comment'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.ClientContact'
        created_at:
          type: string
        deals:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Deal'
        deleted_at:
          type: string
        directory:
          type: string
        efast:
          description: EFAST
          allOf:
            - $ref: '#/components/schemas/legacytypes.Efast'
        ein:
          type: string
        ein_normalized:
          description: >-
            EINNormalized is sharedtypes.NormalizeEIN(EIN): 9 digits, or empty
            when

            EIN is blank or malformed. Written with every EIN change; match on
            this.
          type: string
        employees:
          type: integer
        external:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.ExternalContact'
        fields:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Field'
        financial_advisor:
          $ref: '#/components/schemas/legacytypes.Person'
        fye:
          description: Fiscal year end
          type: string
        history:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.ClientSummary'
        ignore_emails:
          type: boolean
        ignore_previous_service:
          type: boolean
        last_follow_up:
          description: Automated reminders
          type: string
        live_sessions:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.ClientLiveSession'
        locations:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Location'
        meetings:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Meeting'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Message'
        n_active_projects:
          type: integer
        n_plans:
          type: integer
        naics_code:
          type: string
        name:
          type: string
        notes:
          type: string
        notices:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.NoticeProgress'
        payroll:
          description: Payroll
          allOf:
            - $ref: '#/components/schemas/legacytypes.PayrollConfig'
        payroll_status:
          type: string
        phone:
          type: string
        plan_consultant:
          $ref: '#/components/schemas/legacytypes.Person'
        plans:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.RetirementPlan'
        primary_contact:
          description: Resolved list/table cells (not stored)
          allOf:
            - $ref: '#/components/schemas/legacytypes.Person'
        primary_id:
          type: string
        primary_team:
          description: >-
            Cross-team collaboration

            When collaborations for clients/plans are accepted, the resources
            are copied over to the team that accepted the collaboration.

            The clients/plans will have unique IDs but will be linked to the
            original client/plan to maintain a 2-way sync.
          type: string
        primary_team_name:
          description: >-
            If the above properties are nil or omitted, the client/plan is owned
            by the team that created it.
          type: string
        projects:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Project'
        pulse:
          $ref: '#/components/schemas/legacytypes.Pulse'
        pulse_total:
          description: For returning when loading
          type: integer
        shared:
          type: string
        shared_folders:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.File'
        skipped_census_fields:
          description: Census Scrubbing Config
          type: array
          items:
            type: string
        status:
          type: string
        suggested_tasks:
          type: array
          items:
            type: string
        summary:
          type: array
          items:
            type: string
        summary_for_client:
          type: array
          items:
            type: string
        summary_stale:
          type: boolean
        tags:
          type: array
          items:
            type: string
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Task'
        team:
          type: string
        total_value:
          type: number
        view:
          type: string
        website:
          type: string
        won_value:
          description: Calculated values
          type: number
    legacytypes.CollaboratorAccess:
      type: object
      properties:
        email:
          type: string
        scope:
          type: string
        shared_at:
          type: string
        shared_by:
          type: string
        team:
          type: string
    legacytypes.Comment:
      type: object
      properties:
        _id:
          type: string
        client:
          type: string
        content:
          type: string
        deleted_at:
          type: string
        likes:
          type: array
          items:
            type: string
        on_id:
          type: string
        on_type:
          type: string
        reply_to:
          type: string
        team:
          type: string
        timestamp:
          type: string
        user:
          type: string
    legacytypes.ExternalUpload:
      type: object
      properties:
        client:
          type: string
        notified_at:
          type: string
        type:
          type: string
        user:
          type: string
    legacytypes.Field:
      type: object
      properties:
        key:
          type: string
        value: {}
    legacytypes.FileLink:
      type: object
      properties:
        _id:
          type: string
        created_at:
          type: string
        created_by:
          type: string
        created_by_type:
          type: string
        deleted_at:
          type: string
        expires_at:
          type: string
        file:
          type: string
        name:
          type: string
        number_of_uses:
          type: integer
        team:
          type: string
        token:
          type: string
        used_at:
          type: string
        uses:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.FileLinkUse'
    legacytypes.FormTemplate:
      type: object
      properties:
        _id:
          type: string
        created_at:
          type: string
        deleted_at:
          type: string
        description:
          type: string
        fields:
          type: string
        hidden:
          type: boolean
        incomplete:
          type: integer
        info:
          type: object
          additionalProperties: true
        most_recent:
          description: For returning
          type: string
        pdf:
          type: string
        public:
          type: boolean
        questions:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.FormQuestion'
        replace_pdf:
          type: boolean
        tags:
          type: array
          items:
            type: string
        team:
          type: string
        title:
          type: string
        total:
          type: integer
        type:
          type: string
    legacytypes.FileLock:
      type: object
      properties:
        expires_at:
          type: string
        key:
          type: string
        owner:
          type: string
    legacytypes.Parent:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
    legacytypes.FormResponse:
      type: object
      properties:
        _id:
          type: string
        client:
          description: If filled out by client
          type: string
        completed_at:
          type: integer
        contact:
          description: If filled out by contact
          type: string
        deleted_at:
          type: integer
        device_agent:
          type: string
        fields:
          type: string
        form:
          type: string
        ip:
          type: string
        opened_at:
          type: integer
        pdf:
          description: Keep track of responses
          type: string
        responder:
          description: If filled out by unauthenticated user
          allOf:
            - $ref: '#/components/schemas/legacytypes.FormResponder'
        responses:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Response'
        sent_at:
          type: integer
        team:
          type: string
        user:
          type: string
    legacytypes.UploadKey:
      type: object
      properties:
        email:
          type: string
        key:
          type: string
    legacytypes.Change:
      type: object
      properties:
        data:
          type: string
        field:
          type: string
        from:
          type: string
        to:
          type: string
    legacytypes.Address:
      type: object
      properties:
        attn:
          type: string
        city:
          type: string
        country:
          type: string
        desc:
          type: string
        state:
          type: string
        street:
          type: string
        street2:
          type: string
        unit:
          type: string
        zip:
          type: string
    legacytypes.AssigneeTasks:
      type: object
      properties:
        _id:
          type: string
        completed_tasks:
          type: integer
        projects:
          type: array
          items:
            type: string
        started_tasks:
          type: integer
        total_tasks:
          type: integer
    legacytypes.Assignee:
      type: object
      properties:
        deal:
          type: string
        hide_from_client:
          type: boolean
        plan:
          description: Is the assignee specifically tied to a plan or deal?
          type: string
        role:
          type: string
        shared:
          description: For returning
          type: boolean
        user:
          type: string
    legacytypes.ClientBilling:
      type: object
      properties:
        accounting:
          $ref: '#/components/schemas/legacytypes.ClientBillingAccounting'
        billing_contact_role:
          type: string
        currency:
          type: string
        invoice_grouping:
          type: string
        payer_client:
          type: string
        revision:
          type: integer
        status:
          type: string
        terms_days:
          type: integer
    legacytypes.BillingListMetrics:
      type: object
      properties:
        annual_recurring_revenue_minor:
          type: integer
        currency:
          type: string
        fee_schedule:
          type: string
        fee_schedule_name:
          type: string
        fee_schedule_version:
          type: integer
        last_invoice:
          type: string
        next_invoice_date:
          type: string
        total_billed_minor:
          type: integer
        total_collected_minor:
          type: integer
        unbilled_minor:
          type: integer
    sharedtypes.CensusColumnKey:
      type: string
      enum:
        - first_name
        - last_name
        - ssn
        - birth_date
        - hire_date
        - terminated
        - termination_date
        - termination_reason
        - rehire_date
        - hours_worked
        - employment_type
        - employee_category
        - gross_compensation
        - statutory_compensation
        - gross_minus_exclusions
        - hpi_compensation
        - new_compensation_group
        - prevailing_wage
        - compensation_from_entry
        - pre_tax_deferral
        - roth_deferral
        - match_contribution
        - safe_harbor_match
        - qaca_match
        - safe_harbor_non_elective
        - profit_sharing
        - division_code
        - ct_group_code
      x-enum-varnames:
        - CensusColumnFirstName
        - CensusColumnLastName
        - CensusColumnSSN
        - CensusColumnBirthDate
        - CensusColumnHireDate
        - CensusColumnTerminated
        - CensusColumnTerminationDate
        - CensusColumnTerminationReason
        - CensusColumnRehireDate
        - CensusColumnHoursWorked
        - CensusColumnEmploymentType
        - CensusColumnEmployeeCategory
        - CensusColumnGrossCompensation
        - CensusColumnStatutoryCompensation
        - CensusColumnGrossMinusExclusions
        - CensusColumnHPICompensation
        - CensusColumnNewCompensationGroup
        - CensusColumnPrevailingWage
        - CensusColumnCompensationFromEntry
        - CensusColumnPreTaxDeferral
        - CensusColumnRothDeferral
        - CensusColumnMatchContribution
        - CensusColumnSafeHarborMatch
        - CensusColumnQACAMatch
        - CensusColumnSafeHarborNonElective
        - CensusColumnProfitSharing
        - CensusColumnDivisionCode
        - CensusColumnCTGroupCode
    legacytypes.ClientContact:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/legacytypes.Contact'
        deal:
          type: string
        ignore_emails:
          type: boolean
        inactive:
          type: boolean
        invite:
          $ref: '#/components/schemas/legacytypes.Invitation'
        plan:
          description: Are the contacts specifically tied to a plan or deal?
          type: string
        role:
          type: string
        shared:
          type: boolean
        user:
          description: For returning
          allOf:
            - $ref: '#/components/schemas/legacytypes.User'
    legacytypes.Deal:
      type: object
      properties:
        _id:
          type: string
        client:
          type: string
        close_date:
          type: string
        close_probability:
          description: Override values
          type: number
        closed_at:
          description: >-
            Set when the deal status changes to Won/Lost/Abandoned; cleared when
            reopened
          type: string
        closed_reason:
          description: >-
            Deal status is one of: "Open", "Won", "Lost", "Abandoned"

            Set when the deal is Lost or Abandoned; cleared when reopened or
            marked Won
          type: string
        closed_reason_detail:
          type: string
        created_at:
          type: string
        deleted_at:
          type: string
        ein:
          type: string
        funnel:
          type: string
        last_activity:
          type: string
        n_messages:
          type: integer
        n_tasks:
          type: integer
        name:
          type: string
        owner:
          type: string
        plan:
          type: string
        plan_number:
          type: string
        proposal_count:
          type: integer
        proposals:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.LinkedProposalSummary'
        pulse:
          description: For returning
          type: integer
        source:
          type: string
        stage:
          type: string
        status:
          type: string
        tags:
          type: array
          items:
            type: string
        team:
          type: string
        unread:
          type: boolean
        value:
          type: number
    legacytypes.Efast:
      type: object
      properties:
        admin:
          $ref: '#/components/schemas/legacytypes.EfastCreds'
        dfe:
          $ref: '#/components/schemas/legacytypes.EfastCreds'
        electronic:
          $ref: '#/components/schemas/legacytypes.EfastCreds'
        sponsor:
          $ref: '#/components/schemas/legacytypes.EfastCreds'
    legacytypes.ExternalContact:
      type: object
      properties:
        collaborator:
          description: Cross-team collaboration
          allOf:
            - $ref: '#/components/schemas/legacytypes.Collaborator'
        contact:
          $ref: '#/components/schemas/legacytypes.Contact'
        deal:
          type: string
        hide_from_client:
          type: boolean
        inactive:
          type: boolean
        plan:
          description: Are the contacts specifically tied to a plan or deal?
          type: string
        role:
          type: string
        shared:
          description: For returning
          type: boolean
    legacytypes.Person:
      type: object
      properties:
        _id:
          type: string
        email:
          type: string
        name:
          type: string
        role:
          type: string
    legacytypes.ClientSummary:
      type: object
      properties:
        _id:
          type: string
        client:
          type: string
        date:
          type: string
        factors:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/legacytypes.ClientFactor'
        pulse:
          $ref: '#/components/schemas/legacytypes.Pulse'
        team:
          type: string
    legacytypes.ClientLiveSession:
      type: object
      properties:
        _id:
          type: string
        client:
          type: string
        ended_at:
          type: string
        ip_address:
          type: string
        key_events:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.ClientLiveSessionKeyEvent'
        last_event_at:
          type: string
        started_at:
          type: string
        team:
          type: string
        url:
          type: string
        user:
          type: string
        user_agent:
          type: string
    legacytypes.Location:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/legacytypes.Address'
        client_payroll:
          type: string
        code:
          type: string
        external_id:
          description: provider location id
          type: string
        name:
          type: string
        plan:
          description: MEP/PEP location → plan
          type: string
        source:
          description: provider | manual
          type: string
    legacytypes.Meeting:
      type: object
      properties:
        _id:
          type: string
        added_tasks:
          type: array
          items:
            type: string
        attendees:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.MeetingAttendee'
        client:
          type: string
        created_at:
          type: string
        date:
          type: string
        deleted_at:
          type: string
        duration:
          type: number
        format:
          type: string
        location:
          type: string
        notes:
          type: string
        raw_transcript:
          type: string
        tasks:
          type: array
          items:
            type: string
        team:
          type: string
        transcript:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.MeetingTranscriptSpeech'
    legacytypes.Message:
      type: object
      properties:
        _id:
          type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Attachment'
        bcc:
          type: string
        bookmark:
          type: boolean
        brief:
          description: Single-line summary
          type: string
        cc:
          type: string
        checksum:
          description: Checksum for de-duplication
          type: string
        clients:
          description: Is this message to/from a client?
          type: array
          items:
            type: string
        created_at:
          type: string
        date:
          type: string
        deleted_at:
          type: string
        domains:
          type: array
          items:
            type: string
        draft:
          type: boolean
        from:
          type: string
        html:
          type: string
        importance:
          type: integer
        in_reply_to:
          type: string
        internal:
          description: Is this message to/from only internal users?
          type: boolean
        message_folders:
          description: >-
            MessageFolders references the `folders` catalog rows this message
            belongs to

            (by their local ObjectID) — the per-mailbox equivalent of Tags
            (which is a

            team-wide label system). Each catalog row carries the provider's
            external_id;

            storing the local _id keeps renames free and gives referential
            integrity.

            Gmail = multi-label, Outlook = single-folder; the array models both.
          type: array
          items:
            type: string
        outbox:
          description: Magical stuff
          type: boolean
        private:
          description: >-
            The private flag is used if the message is from/to only internal
            admins (regardless of how many external users) that have the
            memberships.email.private flag set.

            This prevents other users from seeing external messages that may be
            private.
          type: boolean
        read:
          type: string
        references:
          type: string
        reply:
          type: string
        requires_response:
          type: boolean
        responses:
          type: array
          items:
            type: string
        safe_for_everyone:
          type: boolean
        schedule_id:
          description: >-
            ScheduleID is the Nylas message-schedule id returned by a native
            send_at

            (scheduled) send. A scheduled send returns no final message id, so
            the

            eventual Sent-folder message.created can't reconcile onto this row
            by

            unique_key; the webhook matches the resulting outbound message back
            to this

            row by schedule_id instead (Nylas migration, Stage 4).
          type: string
        schedule_send_at:
          description: Schedule sending this at a specific time
          type: string
        secure:
          type: boolean
        send_failed:
          description: >-
            SendFailed marks a message whose provider-side send failed (Nylas

            message.send_failed webhook — typically a scheduled send) so the UI
            can

            flag it for the user to retry.
          type: boolean
        send_scheduled:
          type: boolean
        send_state:
          description: >-
            SendState records the provider-reported delivery state. Mirror of
            types.Message.
          type: string
        sentiment:
          type: integer
        source:
          type: string
        source_history_id:
          type: string
        source_id:
          type: string
        subject:
          type: string
        summary:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        tasks:
          type: array
          items:
            type: string
        team:
          type: string
        text:
          type: string
        thread:
          type: string
        to:
          type: string
        unique_key:
          type: string
        user:
          type: string
    legacytypes.NoticeProgress:
      type: object
      properties:
        _id:
          type: string
        date:
          type: string
        file:
          type: string
        name:
          type: string
        opened:
          type: integer
        total:
          type: integer
    legacytypes.PayrollConfig:
      type: object
      properties:
        active:
          type: boolean
        connect360:
          type: boolean
        connection_id:
          description: Finch Connect ID
          type: string
        credentials:
          type: string
        error:
          type: string
        frequency:
          type: string
        integration:
          type: string
        last_sync:
          type: string
        mapping:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMapping'
        message:
          type: string
        pending_reports:
          type: integer
        provider:
          type: string
        providers:
          type: array
          items:
            type: string
        session_expires_at:
          description: Finch Connect Session Expiry
          type: string
        session_id:
          description: Finch Connect Session ID
          type: string
        source:
          type: string
        status:
          type: string
        statuses:
          type: array
          items:
            type: string
        trigger:
          description: The trigger that initiated the sync
          type: string
    legacytypes.RetirementPlan:
      type: object
      properties:
        _id:
          type: string
        accounts:
          description: Investment accounts
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.InvestmentAccount'
        activity:
          description: For returning when loading
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Activity'
        assignee_tasks:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.AssigneeTasks'
        audit_rejected_at:
          type: string
        audit_requested_at:
          description: Audit
          type: string
        billing:
          $ref: '#/components/schemas/legacytypes.PlanBilling'
        billing_list_metrics:
          $ref: '#/components/schemas/legacytypes.BillingListMetrics'
        bond:
          type: number
        carrier:
          type: string
        client:
          type: string
        client_name:
          description: Resolved list/table cells (not stored)
          type: string
        client_pulse:
          $ref: '#/components/schemas/legacytypes.Pulse'
        client_pulse_total:
          type: integer
        client_status:
          type: string
        code:
          type: string
        comments:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Comment'
        compliance_status:
          description: 5500 Status
          type: object
          additionalProperties: true
        created_at:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PlanYearData'
        deleted_at:
          type: string
        effective_on:
          type: string
        employees:
          type: integer
        fields:
          description: Custom fields
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Field'
        financial_advisor:
          $ref: '#/components/schemas/legacytypes.Person'
        ftw_census_grid:
          description: Very specific stuff...
          type: string
        last_modified:
          description: >-
            Stamped by every user-originated plan write (via the sync notify
            path)

            and by sync applies (to the incoming payload's lastModified). LWW
            basis.
          type: string
        name:
          type: string
        notes:
          type: string
        owner_id:
          type: string
        owner_team:
          description: >-
            Cross-team collaboration

            When collaborations for clients/plans are accepted, the resources
            are copied over to the team that accepted the collaboration.

            The clients/plans will have unique IDs but will be linked to the
            original client/plan to maintain a 2-way sync.
          type: string
        parent_plan:
          description: MEPS/PEPS
          type: string
        participants:
          description: Cached data to avoid re-computation
          type: integer
        plan_consultant:
          $ref: '#/components/schemas/legacytypes.Person'
        plan_structure:
          type: string
        plan_years:
          description: Plan year-specific projects to store details
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PlanYearProject'
        primary_contact:
          $ref: '#/components/schemas/legacytypes.Person'
        primary_team_name:
          description: >-
            If the above properties are nil or omitted, the client/plan is owned
            by the team that created it.
          type: string
        projects:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Project'
        provisions:
          description: Provisions
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Provision'
        pye:
          description: Plan specifics
          type: string
        rk:
          description: Record-keeper
          type: object
          properties:
            _id:
              type: string
            contract_number:
              type: string
            login:
              type: string
            name:
              description: Overrides for non-supported record-keepers
              type: string
            payroll_integration_provider:
              type: string
            payroll_integration_type:
              description: Manually set payroll integration with the record-keeper
              type: string
            tpa_login:
              type: string
        sequence:
          type: integer
        status:
          type: string
        ta:
          description: >-
            TA plan sync (Trust Accounting). Set when this plan is linked to a
            TA

            plan; business_key is TA's internalPlanId, captured at link time for
            the

            UI badge (create-time only — never updated by sync).
          allOf:
            - $ref: '#/components/schemas/legacytypes.TALink'
        tags:
          type: array
          items:
            type: string
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Task'
        team:
          type: string
        template_instantiation:
          description: >-
            TemplateInstantiation records the immutable source and idempotency
            key

            used when this operational plan was created from a template.
          allOf:
            - $ref: >-
                #/components/schemas/legacytypes.RetirementPlanTemplateInstantiation
        totals:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.TransactionTotals'
        tye:
          description: Tax Year End
          type: string
        type:
          type: string
        view:
          type: string
    legacytypes.Project:
      type: object
      properties:
        _id:
          type: string
        access:
          description: >-
            Access control - this is essentially just a list of user IDs who
            have tasks in this project that are assigned to them.

            R/W access is controlled by the individual use scopes
          type: array
          items:
            type: string
        activity:
          description: For returning when loading
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Activity'
        audit_blueprint_id:
          description: >-
            Audit-specific fields (set when auditor approves and selects a
            blueprint)
          type: string
        audit_blueprint_name:
          description: Denormalized blueprint name for display
          type: string
        audit_folder_id:
          description: MongoDB ObjectID of the shared audit folder
          type: string
        audit_id:
          description: Postgres UUID of the audit record (set after approval)
          type: string
        billing:
          $ref: '#/components/schemas/legacytypes.ProjectBilling'
        branches:
          description: >-
            Template branch definitions for previewing unlaunched conditional
            task groups
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Branch'
        category:
          description: >-
            Category - inherited from project template (e.g. "plan_audit",
            "audit_request")
          type: string
        client:
          type: string
        client_name:
          type: string
        client_request:
          description: >-
            If this was a client request, the request form file ID is attached
            here
          type: string
        comments:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Comment'
        completed_at:
          type: string
        created_at:
          description: Time tracking
          type: string
        deal:
          type: string
        deal_name:
          type: string
        deal_object:
          $ref: '#/components/schemas/legacytypes.Deal'
        deleted_at:
          type: string
        description:
          type: string
        due:
          type: string
        effective_billing_fee_item:
          description: >-
            EffectiveBillingFeeItem is resolved from a project override or its
            source template.
          type: string
        effective_billing_fee_item_name:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Field'
        hours_logged:
          description: >-
            HoursLogged is minutes logged across the project's tasks
            (work_logs.time_spent).
          type: integer
        in_queue:
          type: boolean
        incomplete_tasks:
          type: integer
        lead:
          type: string
        lead_group:
          description: >-
            Queue routing — separate from lead so resolved user and queue
            linkage coexist
          type: string
        next:
          description: Return variables for list
          allOf:
            - $ref: '#/components/schemas/legacytypes.Task'
        plan:
          type: string
        plan_name:
          type: string
        plan_year:
          type: integer
        queued_at:
          type: string
        starred:
          type: array
          items:
            type: string
        status:
          description: Status (this is based on the status of tasks within the project)
          type: string
        status_id:
          description: >-
            StatusId - maps to the shared statuses lookup table in Postgres
            (e.g. 1=pending_review, 2=in_progress)

            Used for audit projects and will be extended to other project types
            in the future
          type: integer
        tags:
          type: array
          items:
            type: string
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Task'
        team:
          type: string
        team_wide_access:
          description: >-
            Team-wide access - if true, all team members have access to this
            project
          type: boolean
        template:
          type: string
        title:
          type: string
        total_tasks:
          type: integer
        view:
          type: string
    legacytypes.Pulse:
      type: object
      properties:
        calculated_at:
          description: Last Todo/Client calculation
          type: string
        client:
          description: 0-3
          type: integer
        messages:
          description: 0-4
          type: integer
        messages_reason:
          type: string
        override:
          description: '-2 to +2'
          type: integer
        todo:
          description: 0-3
          type: integer
    legacytypes.Task:
      type: object
      properties:
        _id:
          type: string
        access:
          description: >-
            Access control - this is essentially just a list of user IDs who
            have tasks the project this task belongs to that are assigned to
            them.
          type: array
          items:
            type: string
        activity:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Activity'
        assignee:
          type: string
        audit_milestone:
          description: >-
            AuditMilestone identifies the audit-hub milestone this task is
            associated with.

            Populated from the project template at launch; consumed by the audit
            hub UI to

            badge tasks with their stage. Only meaningful when the project is an
            audit.
          type: string
        automation:
          description: An automation may be used to complete the task
          type: string
        automation_config:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Field'
        automation_data: {}
        automation_logs:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.AutomationLog'
        automation_queued_at:
          description: >-
            AutomationQueuedAt is the dispatch claim set by /auto/_run (distinct
            from StartedAt).
          type: string
        automation_timing:
          description: >-
            AutomationTiming, when non-nil, schedules the automation to run
            later

            instead of immediately (nil = immediate). See AutomationTiming in

            project_template.go.
          allOf:
            - $ref: '#/components/schemas/legacytypes.AutomationTiming'
        billable:
          type: boolean
        blocked_fields:
          description: >-
            BlockingFields are project field keys that must be populated before
            the

            task can be completed. Unlike FieldsToComplete, these cannot be
            overridden.
          type: array
          items:
            type: string
        branch:
          description: >-
            Branch marks this live task as a conditional task group entry point
            placeholder,

            referencing the branch _id on the project's template.
          type: string
        client:
          type: string
        client_task_data:
          description: JSON data for the client task
          allOf:
            - $ref: '#/components/schemas/legacytypes.ClientTaskData'
        client_task_type:
          description: >-
            If this is a task for the client to do, a client task type should be
            set - eg. "Census Data Collection", "Census Data Review",
            "Participant Notices", "Fill Web or Document Form", "Testing
            Corrections", "Other"
          type: string
        completed_at:
          type: string
        created_at:
          description: Time tracking
          type: string
        deleted_at:
          type: string
        description:
          type: string
        due:
          type: string
        fields_to_complete:
          description: >-
            If the task belongs to a project, it can require collecting
            specified fields for the project
          type: array
          items:
            type: string
        flagged_at:
          description: By automation
          type: string
        follows_lead:
          description: >-
            FollowsLead — task assignee mirrors the project lead (set at launch
            for "Project Lead" tasks)
          type: boolean
        in_queue:
          type: boolean
        internal_task_data:
          description: JSON data for the internal task
          allOf:
            - $ref: '#/components/schemas/legacytypes.InternalTaskData'
        internal_task_type:
          description: >-
            If this is a special type (eg. payroll mapping, form selection,
            etc.), an internal task type should be set.
          type: string
        last_follow_up:
          type: string
        log_completion_to:
          type: string
        log_completion_type:
          description: Log completion time to project variable?
          type: string
        meeting:
          $ref: '#/components/schemas/legacytypes.Meeting'
        message:
          description: For returning when loading
          allOf:
            - $ref: '#/components/schemas/legacytypes.Message'
        next_at:
          type: string
        notes:
          type: string
        order:
          description: If the task is part of a project, the order should be tracked
          type: integer
        plan:
          type: string
        priority:
          type: integer
        project:
          type: string
        queue_group:
          description: >-
            Queue routing — separate from assignee so resolved user and queue
            linkage coexist
          type: string
        queued_at:
          type: string
        scheduled_at:
          description: >-
            ScheduledAt is the absolute UTC instant a scheduled automation
            should fire,

            computed once from AutomationTiming at scheduling time (ENG-8103).

            Semantics: {ScheduledAt set, StartedAt nil} = pending;

            StartedAt set = claimed/fired; AutomationTiming nil = immediate.
          type: string
        skipped:
          description: >-
            Skipped is set when a branch entry point was completed with its
            conditions

            unmet, so the branch's tasks were never launched.
          type: boolean
        started_at:
          type: string
        suggestion:
          type: integer
        team:
          type: string
        team_wide_access:
          description: >-
            Team-wide access - if true, all team members have access to this
            project
          type: boolean
        template:
          type: string
        work_logs:
          description: Work logs
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.WorkLog'
    legacytypes.FileLinkUse:
      type: object
      properties:
        ip_address:
          type: string
        used_at:
          type: string
    legacytypes.FormQuestion:
      type: object
      properties:
        _id:
          type: string
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Condition'
        data:
          type: object
          additionalProperties: true
        default: {}
        hint:
          type: string
        key:
          type: string
        link:
          type: string
        multiple:
          type: boolean
        on_type:
          type: string
        options:
          type: array
          items:
            type: string
        required:
          type: boolean
        title:
          type: string
        type:
          type: string
    legacytypes.FormResponder:
      type: object
      properties:
        email:
          type: string
        name:
          type: string
    legacytypes.Response:
      type: object
      properties:
        key:
          type: string
        link:
          type: string
        on_type:
          type: string
        page:
          type: string
        question:
          type: string
        timestamp:
          type: string
        title:
          type: string
        type:
          type: string
        value: {}
    legacytypes.ClientBillingAccounting:
      type: object
      properties:
        customer_id:
          type: string
        customer_version:
          type: string
        integration:
          type: string
        last_synced_at:
          type: string
        mapping_status:
          type: string
    legacytypes.Contact:
      type: object
      properties:
        _id:
          description: Unique identifier
          type: string
        address:
          $ref: '#/components/schemas/legacytypes.Address'
        client:
          $ref: '#/components/schemas/legacytypes.ShortClient'
        clients:
          description: For searching
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.ClientRole'
        company:
          type: string
        confirmed:
          type: boolean
        created_at:
          type: string
        email:
          type: array
          items:
            type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Field'
        n_companies:
          type: integer
        n_deals:
          type: integer
        n_employers:
          type: integer
        n_plans:
          type: integer
        name:
          type: string
        notes:
          type: string
        phone:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Phone'
        phone_number:
          description: >-
            Resolved list/table cells (not stored). PhoneNumber/PhoneType are
            the

            first phone on the record. The n_* counts are association totals.
          type: string
        phone_type:
          type: string
        preferred_name:
          type: string
        suffix:
          type: string
        tags:
          type: array
          items:
            type: string
        team:
          description: What team does this contact belong to?
          type: string
        title:
          type: string
    legacytypes.Invitation:
      type: object
      properties:
        _id:
          type: string
        accepted_on:
          type: string
        client:
          description: >-
            If the invitation is to join a team, the client ID is not set. If
            it's to join a client, the client ID is set
          type: string
        contact:
          description: >-
            Contact the client portal invitation was sent to, so it can follow
            that contact's email changes
          type: string
        deleted_at:
          type: string
        email:
          type: string
        from:
          description: User ID
          type: string
        last_follow_up:
          type: string
        name:
          description: Invitation user details
          type: string
        scopes:
          type: array
          items:
            type: string
        sent_on:
          type: string
        team:
          type: string
        title:
          type: string
        user:
          type: string
    legacytypes.User:
      type: object
      properties:
        _id:
          type: string
        clients:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.ClientAccess'
        community:
          description: Community role (eg. "Moderator")
          type: string
        created_on:
          type: string
        deleted_at:
          type: string
        email:
          type: string
        memberships:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Membership'
        mfa_enabled:
          description: Is MFA enabled?
          type: boolean
        mfa_secret:
          description: The secret for MFA TOTP
          type: string
        mfa_verified_at:
          type: string
        name:
          type: string
        out_of_office:
          description: Availability for queue routing (user-level, not per-team)
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.OOOWindow'
        password:
          type: string
        phone:
          type: string
        signature:
          type: string
        team:
          description: The team the user is logged in to
          type: string
        theme:
          description: light | dark | system (default)
          type: string
        timezone:
          description: IANA tz when team.use_user_timezone
          type: string
        validation_code:
          description: The validation code for the user
          type: string
    legacytypes.LinkedProposalSummary:
      type: object
      properties:
        _id:
          type: string
        created_at:
          type: string
        name:
          type: string
        plan_type:
          type: string
        progress:
          type: number
        status:
          type: string
        updated_at:
          type: string
    legacytypes.EfastCreds:
      type: object
      properties:
        pin:
          type: string
        user_id:
          type: string
    legacytypes.Collaborator:
      type: object
      properties:
        accepted_at:
          type: string
        cp_access:
          type: boolean
        declined_at:
          type: string
        participant_data_access_approved_at:
          type: string
        participant_data_access_approved_by:
          type: string
        participant_data_access_requested_at:
          description: Special sharing permissions for participant data access
          type: string
        read_only:
          type: boolean
        shared_at:
          type: string
        shared_by_user:
          type: string
        shared_with_email:
          type: string
        shared_with_team:
          type: string
        shared_with_user:
          type: string
    legacytypes.ClientFactor:
      type: object
      properties:
        score:
          type: number
        summary:
          type: array
          items:
            type: string
    legacytypes.ClientLiveSessionKeyEvent:
      type: object
      properties:
        description:
          type: string
        timestamp:
          type: string
        type:
          type: string
    legacytypes.MeetingAttendee:
      type: object
      properties:
        address:
          type: string
        name:
          type: string
        user:
          type: string
    legacytypes.MeetingTranscriptSpeech:
      type: object
      properties:
        speaker:
          type: string
        text:
          type: string
        timestamp:
          description: in seconds
          type: number
    legacytypes.Attachment:
      type: object
      properties:
        content_id:
          type: string
        file:
          type: string
        filename:
          type: string
        isInline:
          type: boolean
        size:
          type: integer
        source_id:
          type: string
        url:
          type: string
    legacytypes.PayrollAPIMapping:
      type: object
      properties:
        ee_pre_tax:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        ee_roth:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        er_match:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        er_non_elective:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        er_qaca_match:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        er_safe_harbor_match:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        er_safe_harbor_non_elective:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        hpi_compensation:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        ignore:
          description: >-
            Fields to ignore - if there is a new field that's not in this list,
            we will flag for review
          type: array
          items:
            type: string
        loan_repayment:
          description: >-
            Loan repayments (spec 5.10): collected into
            employee_census.loan_payments, not compensation.
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        plan:
          description: For each field, we take the sum of all sources
          type: string
        plan_compensation:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        prevailing_wage:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
        statutory_compensation:
          description: This is the base salary
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PayrollAPIMappingSource'
    legacytypes.InvestmentAccount:
      type: object
      properties:
        _id:
          type: string
        closed_at:
          type: string
        created_at:
          type: string
        deleted_at:
          type: string
        employee:
          type: string
        format:
          description: Data extraction format
          type: string
        name:
          description: Payee/FBO
          type: string
        notes:
          type: string
        number:
          description: Account details
          type: string
        opened_at:
          type: string
        plan:
          type: string
        provider:
          type: string
        remote_id:
          type: string
        remote_source:
          description: Reference to external system
          type: string
        status:
          type: string
        team:
          type: string
        type:
          type: string
    legacytypes.PlanBilling:
      type: object
      properties:
        accounting:
          $ref: '#/components/schemas/legacytypes.PlanBillingAccounting'
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PlanBillingAssignment'
        quantity_selections:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PlanBillingQuantitySelection'
        revenue_share_override:
          $ref: '#/components/schemas/legacytypes.RevenueSharePolicyOverride'
        revision:
          type: integer
        service_end:
          type: string
        service_start:
          type: string
        service_status:
          type: string
    legacytypes.PlanYearData:
      type: object
      properties:
        assets:
          type: number
        ee_contributions:
          type: number
        er_contributions:
          type: number
        withdrawals:
          type: number
        year:
          type: integer
    legacytypes.PlanYearProject:
      type: object
      properties:
        project:
          type: string
        year:
          type: integer
    legacytypes.Provision:
      type: object
      properties:
        _id:
          type: string
        ai_provenance:
          $ref: '#/components/schemas/legacytypes.AIPlanDocumentProvenance'
        amendment:
          description: ID for amendment document
          type: string
        client:
          type: string
        created_at:
          type: string
        deleted_at:
          type: string
        document_customer_id:
          type: string
        document_provider:
          type: string
        document_provider_id:
          type: string
        effective_on:
          type: string
        effective_until:
          type: string
        parent_provision:
          description: MEPS/PEPS
          type: string
        plan:
          type: string
        raw:
          description: Raw Provisions
          type: object
          additionalProperties: true
        specs:
          description: DC Standard (401(k), 403(b), MPP)
          type: object
          additionalProperties: true
        team:
          type: string
        type:
          description: Original, Amendment, Variation
          type: string
        variables:
          description: >-
            List of keys allowed to be changed. Only parent provisions have
            variables
          type: array
          items:
            type: string
        version:
          type: string
        year:
          description: Versioning
          type: integer
    legacytypes.TALink:
      type: object
      properties:
        business_key:
          type: string
        plan_id:
          type: string
        synced_at:
          type: string
    legacytypes.RetirementPlanTemplateInstantiation:
      type: object
      properties:
        created_at:
          type: string
        created_by:
          type: string
        request_key:
          type: string
        template:
          type: string
    legacytypes.TransactionTotals:
      type: object
      properties:
        ee:
          type: number
        er:
          type: number
        gc:
          type: number
        year:
          type: integer
    legacytypes.ProjectBilling:
      type: object
      properties:
        amount_override_minor:
          type: integer
        billable:
          type: boolean
        charge:
          type: string
        configuration_source:
          type: string
        contract_amount_minor:
          type: integer
        decision_at:
          type: string
        decision_by:
          type: string
        decision_reason:
          type: string
        default_quantity:
          $ref: '#/components/schemas/primitive.Decimal128'
        fee_item:
          type: string
        invoice:
          type: string
        occurrence_key:
          type: string
        override_at:
          type: string
        override_by:
          type: string
        override_reason:
          type: string
        quantity:
          $ref: '#/components/schemas/primitive.Decimal128'
        quantity_field_key:
          type: string
        revision:
          type: integer
        service_date:
          type: string
        status:
          type: string
    legacytypes.Branch:
      type: object
      properties:
        _id:
          type: string
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Condition'
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.TaskTemplate'
    legacytypes.AutomationLog:
      type: object
      properties:
        code:
          description: |-
            Code is a stable machine-readable reason (e.g. "missing_fields") so
            clients can branch on it without parsing Message.
          type: string
        execution_time:
          type: number
        message:
          type: string
        timestamp:
          type: string
        traceback:
          type: string
        type:
          type: string
    legacytypes.AutomationTiming:
      type: object
      properties:
        anchor:
          type: string
        date:
          description: YYYY-MM-DD, team-local; AnchorDate only
          type: string
        run_after_days:
          description: >-
            Anchor "" (AnchorTrigger): days after the automation is reached, >=
            0.

            AnchorProjectDue: days from the project's due date, signed; negative
            is

            before. AnchorDate: unused, must be 0.
          type: integer
        run_hour:
          description: 0..23, wall-clock in the team's local timezone
          type: integer
    legacytypes.ClientTaskData:
      type: object
      properties:
        allow_skip_census_upload:
          type: string
        census_upload_instructions:
          type: string
        census_v2_employee_data_policy:
          $ref: '#/components/schemas/sharedtypes.CensusV2EmployeeDataPolicy'
        census_v2_export_field:
          type: string
        census_v2_export_file_type:
          type: string
        census_v2_flow_preset:
          $ref: '#/components/schemas/sharedtypes.CensusV2FlowPreset'
        client_editable:
          description: If true, the client can edit the form
          type: boolean
        destination:
          type: string
        download_file:
          type: string
        file_upload:
          type: string
        follow_up_interval:
          type: integer
        follow_up_to:
          type: array
          items:
            type: string
        form_file:
          type: string
        form_response:
          description: Results
          type: string
        form_template:
          type: string
        last_follow_up:
          type: string
        notice_file:
          type: string
        payroll_connect_instructions:
          description: >-
            Census Data Collection portal instructions (literal text or a v1

            "=..." expression; evaluated server-side before reaching the
            portal).
          type: string
        payroll_enabled:
          type: string
        payroll_upload_instructions:
          type: string
        py:
          type: string
        show:
          description: Show boolean
          type: boolean
        signature_type:
          type: string
        submit_task_id:
          type: string
        upload_file:
          type: string
        url:
          type: string
        w2_upload_instructions:
          type: string
    legacytypes.InternalTaskData:
      type: object
      properties:
        efast_data:
          $ref: '#/components/schemas/legacytypes.EFastData'
        form_id:
          type: string
        py:
          type: string
        task_type:
          type: string
        url:
          type: string
    legacytypes.WorkLog:
      type: object
      properties:
        _id:
          type: string
        ended_at:
          type: string
        notes:
          type: string
        started_at:
          type: string
        time_spent:
          type: integer
        user:
          type: string
    legacytypes.Condition:
      type: object
      properties:
        expression:
          type: string
        op:
          type: string
        value:
          type: string
    legacytypes.ShortClient:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
    legacytypes.ClientRole:
      type: object
      properties:
        _id:
          type: string
        inactive:
          type: boolean
        name:
          type: string
        role:
          type: string
    legacytypes.Phone:
      type: object
      properties:
        extension:
          type: string
        number:
          type: string
        type:
          type: string
        verified:
          description: |-
            Verified is a TPA-set flag on mobile/cell numbers. Cleared when the
            number or type changes; portal updates cannot set it.
          type: boolean
    legacytypes.ClientAccess:
      type: object
      properties:
        accepted_on:
          type: string
        client:
          type: string
        contact:
          type: string
        invited_on:
          type: string
        scopes:
          type: array
          items:
            type: string
        team:
          type: string
    legacytypes.Membership:
      type: object
      properties:
        about:
          type: string
        accepted_on:
          type: string
        api_keys:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.APIKey'
        email:
          $ref: '#/components/schemas/legacytypes.EmailConfig'
        email_signature:
          type: string
        filters:
          $ref: '#/components/schemas/legacytypes.Filters'
        invited_on:
          type: string
        preferences:
          $ref: '#/components/schemas/legacytypes.Preferences'
        scopes:
          type: array
          items:
            type: string
        starred_pages:
          type: array
          items:
            type: string
        suspended:
          type: boolean
        team:
          type: string
        title:
          type: string
        working_hours:
          description: Per-team working hours override for queue routing capacity
          allOf:
            - $ref: '#/components/schemas/legacytypes.WorkingHoursConfig'
    legacytypes.OOOWindow:
      type: object
      properties:
        end:
          type: string
        note:
          type: string
        start:
          type: string
    legacytypes.PayrollAPIMappingSource:
      type: object
      properties:
        minus:
          description: >-
            If any of these are empty, we won't look at them. At least one has
            to be set
          type: boolean
        name:
          description: The name of the source
          type: string
        type:
          description: 'The type of source: Earnings, Taxes, Contributions'
          type: string
    legacytypes.PlanBillingAccounting:
      type: object
      properties:
        customer_id:
          type: string
        dimension_id:
          type: string
        integration:
          type: string
        last_synced_at:
          type: string
        plan_external_id:
          type: string
    legacytypes.PlanBillingAssignment:
      type: object
      properties:
        agreement_file:
          type: string
        effective_from:
          type: string
        effective_to:
          type: string
        key:
          type: string
        override_revisions:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PlanBillingOverrideRevision'
        schedule:
          type: string
    legacytypes.PlanBillingQuantitySelection:
      type: object
      properties:
        period:
          $ref: '#/components/schemas/legacytypes.BillingPeriod'
        purpose:
          type: string
        rule_key:
          type: string
        snapshot:
          type: string
    legacytypes.RevenueSharePolicyOverride:
      type: object
      properties:
        effective_from:
          type: string
        patches:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.BillingPatch'
        policy:
          type: string
        policy_version:
          type: integer
    legacytypes.AIPlanDocumentProvenance:
      type: object
      properties:
        coverage:
          $ref: '#/components/schemas/legacytypes.AIPlanDocumentCoverage'
        extraction_id:
          type: string
        issues:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.AIPlanDocumentReviewIssue'
        model_version:
          type: string
        prompt_version:
          type: string
        requires_review:
          type: boolean
        source_file_id:
          type: string
        source_sha256:
          type: string
        target_catalog_id:
          type: string
        target_catalog_version:
          type: string
        warnings:
          $ref: '#/components/schemas/legacytypes.AIPlanDocumentWarningSummary'
    primitive.Decimal128:
      type: object
    legacytypes.TaskTemplate:
      type: object
      properties:
        assignee:
          type: string
        assignee_group:
          description: >-
            Client team member/role or project variable (eg. assignee:{role} or
            data:{key})
          type: string
        audit_milestone:
          description: >-
            AuditMilestone links this task template to a milestone in audit-hub.
            Propagated

            to live tasks at project launch so the audit hub UI can badge each
            task with its

            stage (Kickoff, Fieldwork, Partner Review, etc.).
          type: string
        automation:
          description: Automation
          type: string
        automation_config:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.Field'
        automation_timing:
          description: >-
            AutomationTiming, when non-nil, schedules the automation to run
            later

            (N days after the task starts, at a wall-clock hour in the team's
            local

            timezone) instead of immediately. nil = run immediately. A pointer
            (not a

            value) so the all-zero config {RunAfterDays:0, RunHour:0} = "same
            day,

            midnight" is a valid, distinguishable schedule rather than "unset".
          allOf:
            - $ref: '#/components/schemas/legacytypes.AutomationTiming'
        billable:
          description: >-
            Billable includes this task's work-log time in hours-logged project
            fees.
          type: boolean
        billing_decision:
          description: >-
            BillingDecision identifies the task that collects the project's
            required

            billable/not-billable decision.
          type: boolean
        blocked_fields:
          description: >-
            BlockingFields are project field keys that must be populated before
            the

            task can be completed. Unlike FieldsToComplete, these cannot be
            overridden.
          type: array
          items:
            type: string
        branch:
          description: >-
            Branch marks this task as a conditional task group entry point
            referencing

            ProjectTemplate.Branches[]._id. Entry points carry only Description
            and Branch;

            all other configuration must be empty.
          type: string
        client_task_data:
          $ref: '#/components/schemas/legacytypes.ClientTaskDataTemplate'
        client_task_type:
          type: string
        description:
          type: string
        due_after_days:
          type: integer
        due_since_ready:
          type: integer
        due_static:
          description: >-
            Due - can either be a specific date or relative to the project
            launch date
          type: string
        fields_to_complete:
          type: array
          items:
            type: string
        internal_task_data:
          $ref: '#/components/schemas/legacytypes.InternalTaskDataTemplate'
        internal_task_type:
          type: string
        log_completion_to:
          type: string
        log_completion_type:
          description: Log completion time to project variable?
          type: string
        notes:
          type: string
        required:
          description: Required tasks cannot be deleted on plan_audit templates/projects
          type: boolean
    sharedtypes.CensusV2EmployeeDataPolicy:
      type: string
      enum:
        - any
        - payroll_or_census
        - census_only
        - census_or_w2
        - w2_only
      x-enum-varnames:
        - CensusV2EmployeeDataPolicyAny
        - CensusV2EmployeeDataPolicyPayrollOrCensus
        - CensusV2EmployeeDataPolicyCensusOnly
        - CensusV2EmployeeDataPolicyCensusOrW2
        - CensusV2EmployeeDataPolicyW2Only
    sharedtypes.CensusV2FlowPreset:
      type: string
      enum:
        - company_contacts_ownership_payroll_census
        - company_contacts_ownership
        - payroll_census_only
      x-enum-varnames:
        - CensusV2FlowPresetCompanyContactsOwnershipPayrollCensus
        - CensusV2FlowPresetCompanyContactsOwnership
        - CensusV2FlowPresetPayrollCensusOnly
    legacytypes.EFastData:
      type: object
      properties:
        attachments:
          type: array
          items: {}
        dcg_attachments:
          type: array
          items: {}
        file_names:
          type: array
          items:
            type: string
        form:
          type: string
        schedule_instances:
          type: object
          additionalProperties:
            type: array
            items: {}
        schedules:
          type: array
          items:
            type: string
    legacytypes.APIKey:
      type: object
      properties:
        created_by:
          type: string
        created_on:
          type: string
        name:
          type: string
        secret:
          type: string
    legacytypes.EmailConfig:
      type: object
      properties:
        access_token:
          description: >-
            AccessToken/RefreshToken are the legacy provider OAuth tokens. Kept
            dormant

            during the Nylas migration for rollback safety — Nylas owns token
            refresh

            once a grant exists, so these are not written for Backend == "nylas"
            accounts.
          type: string
        address:
          type: string
        auto_reply:
          type: boolean
        auto_reply_body:
          type: string
        auto_reply_from:
          type: string
        auto_reply_subject:
          type: string
        auto_reply_to:
          type: string
        backend:
          type: string
        connected_at:
          type: string
        error:
          type: string
        errored_at:
          type: string
        grant_id:
          description: >-
            Nylas migration fields. GrantID is the Nylas grant scoping all
            per-account

            API calls; GrantStatus mirrors the Nylas grant state
            (valid|invalid|expired);

            Backend == "nylas" is the per-account switch every send/sync code
            path checks.
          type: string
        grant_status:
          type: string
        last_sync:
          type: string
        private:
          type: boolean
        provider:
          type: string
        refresh_token:
          type: string
        status:
          type: string
        sync_mutex:
          type: boolean
    legacytypes.Filters:
      type: object
      properties:
        client:
          type: object
          additionalProperties: true
        message:
          type: object
          additionalProperties: true
        plan:
          type: object
          additionalProperties: true
        project:
          type: object
          additionalProperties: true
        task:
          type: object
          additionalProperties: true
    legacytypes.Preferences:
      type: object
      properties:
        email_on_assignments:
          type: boolean
        email_on_assists:
          type: boolean
        email_on_client_actions:
          type: boolean
        email_on_client_updates:
          type: boolean
        email_on_community:
          type: boolean
        email_on_mentions:
          type: boolean
        email_on_overdue:
          type: boolean
        email_on_shared_files:
          type: boolean
        hide_emails_on_my_dashboard:
          type: boolean
        hide_next_task_columns:
          type: array
          items:
            type: string
        hide_pulse_activity_on_my_dashboard:
          type: boolean
        record_tile_order:
          description: >-
            RecordTileOrder is the user's sidebar tile order per record page,
            keyed

            by page ("company", "plan") (ENG-9131).
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    legacytypes.WorkingHoursConfig:
      type: object
      properties:
        schedule:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.WorkingHoursSchedule'
        timezone:
          description: IANA tz
          type: string
        use_user_timezone:
          type: boolean
    legacytypes.PlanBillingOverrideRevision:
      type: object
      properties:
        additional_rules:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.FeeScheduleRule'
        effective_from:
          type: string
        number:
          type: integer
        published_at:
          type: string
        published_by:
          type: string
        reason:
          type: string
        rule_patches:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.PlanBillingRulePatch'
        schedule_patch:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.BillingPatch'
    legacytypes.BillingPeriod:
      type: object
      properties:
        end:
          type: string
        start:
          type: string
    legacytypes.BillingPatch:
      type: object
      properties:
        path:
          type: string
        value: {}
    legacytypes.AIPlanDocumentCoverage:
      type: object
      properties:
        all:
          $ref: '#/components/schemas/legacytypes.AIPlanDocumentCoverageCount'
        catalog_id:
          type: string
        catalog_version:
          type: string
        key:
          $ref: '#/components/schemas/legacytypes.AIPlanDocumentCoverageCount'
    legacytypes.AIPlanDocumentReviewIssue:
      type: object
      properties:
        citations:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.AIPlanDocumentCitation'
        domain:
          type: string
        field:
          type: string
        group:
          type: string
        message:
          type: string
        review:
          type: string
        status:
          type: string
    legacytypes.AIPlanDocumentWarningSummary:
      type: object
      properties:
        by_domain:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        by_field:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        by_page:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        by_status:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.AIPlanDocumentWarning'
    legacytypes.ClientTaskDataTemplate:
      type: object
      properties:
        allow_skip_census_upload:
          type: string
        census_upload_instructions:
          type: string
        census_v2_employee_data_policy:
          $ref: '#/components/schemas/sharedtypes.CensusV2EmployeeDataPolicy'
        census_v2_export_field:
          type: string
        census_v2_export_file_type:
          type: string
        census_v2_flow_preset:
          $ref: '#/components/schemas/sharedtypes.CensusV2FlowPreset'
        destination:
          type: string
        download_file:
          type: string
        file_upload:
          type: string
        follow_up_interval:
          type: integer
        follow_up_to:
          type: array
          items:
            type: string
        form_file:
          type: string
        form_template:
          type: string
        notice_file:
          type: string
        payroll_connect_instructions:
          description: Census Data Collection portal instructions — see ClientTaskData.
          type: string
        payroll_enabled:
          type: string
        payroll_upload_instructions:
          type: string
        py:
          type: string
        show:
          type: boolean
        signature_type:
          type: string
        url:
          type: string
        w2_upload_instructions:
          type: string
    legacytypes.InternalTaskDataTemplate:
      type: object
      properties:
        form_id:
          type: string
        py:
          type: string
        task_type:
          type: string
        url:
          type: string
    legacytypes.WorkingHoursSchedule:
      type: object
      properties:
        end_time:
          description: HH:MM
          type: string
        start_time:
          description: HH:MM
          type: string
        weekday:
          description: monday, tuesday, ...
          type: string
    legacytypes.FeeScheduleRule:
      type: object
      properties:
        basis:
          type: string
        billing_type:
          type: string
        enabled:
          type: boolean
        estimate:
          $ref: '#/components/schemas/legacytypes.FeeEstimateConfig'
        fee_item:
          type: string
        invoice_description:
          type: string
        invoice_frequency:
          type: string
        key:
          type: string
        maximum_minor:
          type: integer
        minimum_minor:
          type: integer
        pricing:
          $ref: '#/components/schemas/legacytypes.FeePricing'
        project_invoice_timing:
          type: string
        proposal_one_time:
          type: boolean
        proration:
          type: string
        quantity_policy:
          $ref: '#/components/schemas/legacytypes.FeeQuantityPolicy'
        quoted_period:
          type: string
        revenue_stream:
          type: string
        sort_order:
          type: integer
        trigger:
          type: string
    legacytypes.PlanBillingRulePatch:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.BillingPatch'
        rule_key:
          type: string
    legacytypes.AIPlanDocumentCoverageCount:
      type: object
      properties:
        denominator:
          type: integer
        numerator:
          type: integer
        percent:
          type: integer
    legacytypes.AIPlanDocumentCitation:
      type: object
      properties:
        page:
          type: integer
    legacytypes.AIPlanDocumentWarning:
      type: object
      properties:
        domain:
          type: string
        field:
          type: string
        id:
          type: string
        message:
          type: string
        pages:
          type: array
          items:
            type: integer
        review:
          type: string
        status:
          type: string
    legacytypes.FeeEstimateConfig:
      type: object
      properties:
        enabled:
          type: boolean
        quantity_policy:
          $ref: '#/components/schemas/legacytypes.FeeQuantityPolicy'
        true_up:
          $ref: '#/components/schemas/legacytypes.FeeTrueUpConfiguration'
    legacytypes.FeePricing:
      type: object
      properties:
        amount_minor:
          type: integer
        method:
          type: string
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/legacytypes.FeePricingTier'
        unit_rate:
          $ref: '#/components/schemas/primitive.Decimal128'
    legacytypes.FeeQuantityPolicy:
      type: object
      properties:
        as_of:
          type: string
        maximum_age_days:
          type: integer
        metric:
          type: string
        require_approval:
          type: boolean
        source:
          type: string
    legacytypes.FeeTrueUpConfiguration:
      type: object
      properties:
        actual_quantity_policy:
          $ref: '#/components/schemas/legacytypes.FeeQuantityPolicy'
        enabled:
          type: boolean
        negative_treatment:
          type: string
        positive_timing:
          type: string
        trigger:
          type: string
    legacytypes.FeePricingTier:
      type: object
      properties:
        amount_minor:
          type: integer
        rate:
          $ref: '#/components/schemas/primitive.Decimal128'
        up_to:
          $ref: '#/components/schemas/primitive.Decimal128'
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

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