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

# Get AI assistant conversation history

> Returns paginated conversation turns for the authenticated athlete. Supply `deal_type` + `job_id` for a deal-specific view, or omit both for the unified thread. For `deal_type=fan_req`, `job_id` is `fan_request_service.id`. Each database turn is expanded into the same athlete and assistant chat items used before the loop migration, and matching assistant turns are marked as read. Assistant items may contain either the historical/v3 semantic `context_resolution` shape or the `version=loop-1` trace shape. Top-level `scope`, `context_mode`, `job_id`, and `resolved_job_ids` remain compatible for both shapes; loop values are derived from successful trace evidence. Loop portfolio history may carry optional strict compact portfolio_state metadata for trusted follow-ups; raw arguments, full rows, and full tool results remain excluded. Existing job-support and no-deal support escalation turns may include the same sanitized summary and review-only `support_action` returned by chat; the athlete must explicitly send the mailto. Safe no-deal knowledge history remains text/source-only with null job_id and empty resolved_job_ids.



## OpenAPI

````yaml /storage/api-docs/api-docs.json get /athlete/ai-athlete-assistant/history
openapi: 3.0.0
info:
  title: MOGL Core API
  description: >-
    MOGL Platform Core API — powering athlete NIL deals, brand partnerships,
    agent management, payments, messaging, and more.
     *
     * ## Authentication
     * - **JWT Bearer Token**: Most endpoints require a Bearer token obtained via `/api/login`.
     * - **Server-to-Server API Key**: Internal/lambda/cron endpoints use an `X-API-KEY` header.
     *
     * ## Rate Limiting
     * - Registration & login endpoints: 4–15 requests per minute
     * - Public/influencer endpoints: 200 requests per minute
     * - Authenticated endpoints: standard Laravel throttle
  version: 1.0.0
servers:
  - url: http://localhost/mogl/mogl-backend/api
    description: Local
  - url: https://dev-api.mogl.online/api
    description: Dev
  - url: https://staging-api.mogl.online/api
    description: Staging
  - url: https://api.mogl.online/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Login, registration, password reset
  - name: User Registration - Common
    description: Common user registration & email check
  - name: User Registration - Athlete
    description: Athlete registration & onboarding steps
  - name: User Registration - Partner
    description: Partner/Brand registration & onboarding steps
  - name: User Registration - Agent
    description: Agent registration & onboarding steps
  - name: User Registration - Fan
    description: Fan registration & onboarding steps
  - name: User Profile
    description: User profile management, settings, social media
  - name: Athlete
    description: 'Athlete-specific endpoints: search, details, availability'
  - name: Athlete - Availability Confirmation
    description: Post-hiring availability confirmation workflow
  - name: Athlete - NIL Feed
    description: Athlete NIL feed and partner search
  - name: Athlete - AI Assistant
    description: >-
      AI-powered job assistant for athletes — chat, conversation history, read
      state, and clarification drafts
  - name: Athlete - AI Waitlist
    description: AI Athlete Assistant waitlist status, social proof, and joining
  - name: Partner
    description: Partner/Brand-specific endpoints
  - name: Partner - External Job
    description: External job link & applicant management
  - name: Partner - Deliverable Report
    description: Deliverable detail reports for brands
  - name: Partner - Screening Questions
    description: Screening question reports
  - name: Partner - Contract Management
    description: Brand contract management with athletes
  - name: Partner - Content Library
    description: Brand content library for deliverable assets
  - name: Agent
    description: Agent profile, athlete management, contracts
  - name: Agent - Athletes
    description: Agent-athlete relationship management
  - name: Agent - Stripe
    description: Agent payment methods & billing via Stripe
  - name: Agent - Contracts
    description: Agent athlete contract management
  - name: Agent - Availability Confirmation
    description: Agent managing athlete job availability
  - name: Jobs
    description: Job/deal CRUD, search, invitations, hiring, deliverables
  - name: Deals
    description: Deal listing, my deals, bulk operations
  - name: Deal Folder
    description: >-
      Deal folder file workflow — uploads, replacements, approvals, revisions,
      comments. Accessible by athlete, partner/brand, agent, and iOS clients
      (per-action authorisation enforced server-side).
  - name: Deal Folder iOS API
    description: >-
      iOS-only direct-to-S3 multipart upload endpoints for deal folder files
      (initiate/complete for new uploads and replacements). Web clients should
      use the standard `Deal Folder` upload/replace endpoints instead.
  - name: Chat
    description: Messaging, chat contacts, notifications
  - name: Notifications
    description: Notification preferences, in-app notifications
  - name: Payments
    description: Stripe payments, payment history, cards, bulk pay
  - name: Subscription
    description: Brand subscription plans & management
  - name: Public Pages
    description: Public content endpoints (no auth required)
  - name: Public - Influencer/SEO
    description: Public influencer discovery, sitemaps, directories
  - name: Services
    description: Athlete service marketplace
  - name: iOS Device
    description: iOS device tokens, live activities
  - name: Onboarding Tutorial
    description: Onboarding tutorial progress
  - name: MOGL Rosters
    description: Roster management & display
  - name: Internal / Cron
    description: Server-to-server and cron job endpoints
  - name: Internal - AI Athlete Assistant Tools
    description: >-
      Dual-authenticated, athlete-scoped tool gateway used only by the AI
      service
  - name: Affiliate
    description: Athlete affiliate links & tracking
paths:
  /athlete/ai-athlete-assistant/history:
    get:
      tags:
        - Athlete - AI Assistant
      summary: Get AI assistant conversation history
      description: >-
        Returns paginated conversation turns for the authenticated athlete.
        Supply `deal_type` + `job_id` for a deal-specific view, or omit both for
        the unified thread. For `deal_type=fan_req`, `job_id` is
        `fan_request_service.id`. Each database turn is expanded into the same
        athlete and assistant chat items used before the loop migration, and
        matching assistant turns are marked as read. Assistant items may contain
        either the historical/v3 semantic `context_resolution` shape or the
        `version=loop-1` trace shape. Top-level `scope`, `context_mode`,
        `job_id`, and `resolved_job_ids` remain compatible for both shapes; loop
        values are derived from successful trace evidence. Loop portfolio
        history may carry optional strict compact portfolio_state metadata for
        trusted follow-ups; raw arguments, full rows, and full tool results
        remain excluded. Existing job-support and no-deal support escalation
        turns may include the same sanitized summary and review-only
        `support_action` returned by chat; the athlete must explicitly send the
        mailto. Safe no-deal knowledge history remains text/source-only with
        null job_id and empty resolved_job_ids.
      operationId: aiAthleteAssistantHistory
      parameters:
        - name: deal_type
          in: query
          description: Deal kind. Defaults to job when only job_id is supplied.
          required: false
          schema:
            type: string
            enum:
              - job
              - fan_req
            example: job
        - name: job_id
          in: query
          description: >-
            Partner job id when deal_type=job; fan_request_service.id when
            deal_type=fan_req. Omit with deal_type to return the unified thread.
          required: false
          schema:
            type: integer
            minimum: 1
            example: 42
        - name: sort
          in: query
          description: >-
            Sort by creation time. `-created_at` returns newest first;
            `+created_at` returns oldest first.
          required: false
          schema:
            type: string
            default: '-created_at'
            enum:
              - '-created_at'
              - +created_at
            example: '-created_at'
        - name: page
          in: query
          description: Page number (default 1).
          required: false
          schema:
            type: integer
            example: 1
        - name: limit
          in: query
          description: Items per page (default 10).
          required: false
          schema:
            type: integer
            example: 10
        - name: page_limit
          in: query
          description: >-
            Alternative to `limit`. Takes precedence over `limit` if both are
            provided.
          required: false
          schema:
            type: integer
            example: 10
      responses:
        '200':
          description: Paginated conversation history.
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AthleteAiAssistantMessageItem'
                  meta:
                    properties:
                      current_page:
                        type: integer
                        example: 1
                      from:
                        type: integer
                        example: 1
                      last_page:
                        type: integer
                        example: 5
                      path:
                        type: string
                        example: >-
                          https://api.mogl.online/api/athlete/ai-athlete-assistant/history
                      per_page:
                        type: integer
                        example: 10
                      to:
                        type: integer
                        example: 10
                      total:
                        type: integer
                        example: 48
                    type: object
                  links:
                    properties:
                      first:
                        type: string
                        example: >-
                          https://api.mogl.online/api/athlete/ai-athlete-assistant/history?page=1
                      last:
                        type: string
                        example: >-
                          https://api.mogl.online/api/athlete/ai-athlete-assistant/history?page=5
                      prev:
                        type: string
                        example: null
                        nullable: true
                      next:
                        type: string
                        example: >-
                          https://api.mogl.online/api/athlete/ai-athlete-assistant/history?page=2
                        nullable: true
                    type: object
                type: object
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    AthleteAiAssistantMessageItem:
      required:
        - sender
        - message
        - is_read
        - session_id
      properties:
        turn_id:
          type: integer
          example: 546
          nullable: true
        sender:
          type: string
          enum:
            - athlete
            - assistant
          example: assistant
        sender_id:
          type: integer
          example: null
          nullable: true
        message:
          type: string
          example: MOGL connects athletes with brands for paid NIL opportunities.
        is_read:
          type: string
          enum:
            - '0'
            - '1'
          example: '1'
        created_at:
          type: string
          format: date-time
          example: '2026-07-22T06:46:17Z'
          nullable: true
        conversation_id:
          description: Chat response only.
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        session_id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        deal_type:
          description: Deal kind for this turn. Null for no-deal assistant_help turns.
          type: string
          enum:
            - job
            - fan_req
          example: null
          nullable: true
        job_id:
          description: >-
            Partner job id when deal_type=job; fan_request_service.id when
            deal_type=fan_req. Null for no-deal assistant_help turns, including
            support_contact and knowledge_lookup.
          type: integer
          example: null
          nullable: true
        response_type:
          $ref: '#/components/schemas/AthleteAiAssistantResponseType'
        source_ids:
          description: >-
            Assistant items only. A knowledge_lookup direct answer identifies
            the curated KB source here; support_contact commonly returns an
            empty array.
          type: array
          items:
            type: string
          example:
            - athlete_kb:what-is-mogl
        confidence:
          description: Assistant items only.
          type: number
          format: float
          maximum: 1
          minimum: 0
          example: 0.9
        scope:
          type: string
          enum:
            - athlete
            - deal
          example: athlete
        context_mode:
          type: string
          enum:
            - athlete_portfolio
            - single_deal
            - multi_deal
            - assistant_help
            - clarification
          example: assistant_help
        resolved_job_ids:
          description: >-
            Non-null authorized job IDs resolved for the turn. Empty for no-deal
            assistant_help turns.
          type: array
          items:
            type: integer
            minimum: 1
          maxItems: 20
          example: []
        context_resolution:
          description: >-
            Assistant items only. `version=loop-1` selects the bounded-loop
            trace shape; objects without that discriminator use the
            historical/v3 semantic-routing shape. anyOf is intentional because
            historical records are permissive and may overlap the strict loop
            shape during the compatibility window. Null or omitted on athlete
            items and legacy assistant records that have no persisted typed
            resolution. Neither shape exposes raw model proposals, raw tool
            arguments, or full tool results; loop-1 may include strict compact
            portfolio continuity state.
          nullable: true
          anyOf:
            - $ref: '#/components/schemas/AthleteAiAssistantContextResolution'
            - $ref: '#/components/schemas/AthleteAiAssistantContextResolutionLoop1'
        continuation_cursor:
          description: >-
            V3 compatibility cursor emitted only for a truncated portfolio list
            that requested list output. Loop turns normally omit it and resolve
            portfolio requests through tools. It does not apply to text-only
            deal ambiguity and never promises continuation for arbitrary lists.
          type: string
          example: null
          nullable: true
        abstain_reason:
          type: string
          example: null
          nullable: true
        support_request_summary:
          description: >-
            Assistant items only. Sanitized support-facing summary exposed for
            eligible response_type=escalation turns, including no-deal
            assistant_help/support_contact; omitted or null otherwise. Contact
            details, URLs, internal routing terms, and untrusted IDs are
            removed.
          type: string
          maxLength: 500
          example: The athlete needs help resolving a payout issue.
          nullable: true
        support_action:
          oneOf:
            - $ref: '#/components/schemas/AthleteAiAssistantSupportAction'
          nullable: true
          description: >-
            Assistant items only. May be present for existing job-support
            escalation or no-deal assistant_help/support_contact when the
            backend can build a review-only pre-filled mailto. The athlete must
            click, review, and send it; the backend never auto-sends. Omitted or
            null for knowledge_lookup and other turns.
        quick_button_suggestions:
          description: >-
            Assistant items only. Always empty on ordinary athlete-prompted loop
            turns. On the v3 rollback path, may contain two or three authorized,
            ID-suffixed deal labels for a backend-owned ambiguous-deal routing
            clarification. Proactive availability welcome turns are persisted
            outside the loop and may retain server-owned suggestions such as
            Tell me about the deal and Rough schedule please. Their text
            expresses intent only; the originating job remains server-owned and
            is projected separately to the loop as trusted assistant-history
            continuity.
          type: array
          items:
            type: string
          maxItems: 3
        clarification_draft:
          oneOf:
            - $ref: '#/components/schemas/AthleteAiAssistantClarificationDraft'
          nullable: true
          description: >-
            Non-null for draft-bearing answer-stage job responses, including
            direct_answer_with_clarification. Null for backend-owned routing
            clarification even when response_type=clarification, and null for
            all no-deal assistant_help turns, including support_contact and
            knowledge_lookup.
        superseded_clarification_drafts:
          description: Chat response only; pending drafts replaced by this turn.
          type: array
          items:
            $ref: '#/components/schemas/AthleteAiAssistantClarificationDraft'
      type: object
    UnauthorizedResponse:
      properties:
        message:
          type: string
          example: Unauthenticated.
      type: object
    AthleteAiAssistantResponseType:
      description: >-
        How the assistant resolved the turn. In the answer stage,
        `direct_answer_with_clarification` means known facts answered the
        question but brand follow-up is recommended; draft-bearing job responses
        require a non-null clarification_draft and empty
        quick_button_suggestions. A backend-owned routing clarification may also
        use `clarification`, but returns no draft and may include bounded
        authorized deal-choice buttons. `escalation` remains available for
        job-scoped support and may also be returned for a no-deal
        `assistant_help` / `support_contact` turn; any mailto action is
        review-only and is never sent automatically.
      type: string
      enum:
        - direct_answer
        - direct_answer_with_clarification
        - clarification
        - abstain
        - escalation
      example: direct_answer
    AthleteAiAssistantContextResolution:
      description: >-
        Historical and v3 rollback semantic-routing persistence shape. Present
        on turns created before the loop migration and on new turns when the
        server-side loop flag is disabled. The AI service interprets free text
        and returns an advisory typed resolution; Laravel rejects noncanonical,
        unauthorized, or contradictory proposals before serializing this
        enforced result. A canonical `assistant_help` proposal has no proposed
        job IDs or deal metadata, uses null portfolio and history-anchor
        metadata, has empty clarification metadata, and sets
        `clarification_required=false`. Its public resolution likewise has null
        singular IDs and deal_type plus non-null empty `resolved_job_ids`,
        `requested_actions`, and clarification arrays. `support_contact` and
        `knowledge_lookup` are additive help topics; existing deal, portfolio,
        clarification, and job-support behavior remains supported. This object
        never exposes the raw model proposal. A fresh portfolio_query has no
        history anchor; portfolio_follow_up and natural portfolio_continuation
        resolutions must validate an exact bounded assistant turn.
        portfolio_groups and portfolio_group_candidates are server-owned
        continuity metadata.
      properties:
        scope:
          description: >-
            Compatibility scope. Canonical assistant_help resolutions use
            athlete.
          type: string
          enum:
            - athlete
            - deal
          example: athlete
        context_mode:
          type: string
          enum:
            - athlete_portfolio
            - single_deal
            - multi_deal
            - assistant_help
            - clarification
          example: assistant_help
        legacy_context_mode:
          description: Compatibility context-mode alias.
          type: string
          enum:
            - portfolio_current
            - portfolio_historical
            - deal
            - multi_deal
            - assistant_help
            - clarification
          example: assistant_help
        requested_job_id:
          description: >-
            Compatibility requested deal ID. Null for canonical assistant_help
            resolutions.
          type: integer
          minimum: 1
          example: null
          nullable: true
        resolved_job_id:
          description: >-
            Compatibility singular resolved deal ID. Null for canonical
            assistant_help resolutions.
          type: integer
          minimum: 1
          example: null
          nullable: true
        resolved_job_ids:
          description: >-
            Non-null authorized resolved job IDs. Empty for canonical
            assistant_help, portfolio, clarification, and no-match routes.
          type: array
          items:
            type: integer
            minimum: 1
          maxItems: 20
          example: []
        resolution_reason:
          description: >-
            Reason for the validated server resolution. portfolio_query is a
            fresh offset-zero request without a referenced turn;
            portfolio_follow_up uses an anchored prior status/count;
            portfolio_continuation uses either an explicitly validated cursor or
            an anchored prior portfolio cursor. Semantic reasons remain advisory
            until Laravel enforces their complete shape, confidence,
            authorization, and history references.
          type: string
          enum:
            - explicit_reference
            - inherited
            - semantic_match
            - explicit_job_label
            - displayed_list_reference
            - legacy_hint
            - ambiguous
            - no_match
            - off_topic
            - portfolio_query
            - portfolio_follow_up
            - portfolio_continuation
            - assistant_help
            - trigger
          example: portfolio_follow_up
        confidence:
          type: number
          format: float
          maximum: 1
          minimum: 0
          example: 1
        candidate_count:
          type: integer
          minimum: 0
          example: 2
          nullable: true
        truncated:
          type: boolean
          example: false
        lifecycle_mode:
          type: string
          enum:
            - all
            - current
            - historical
          example: all
          nullable: true
        portfolio_offset:
          type: integer
          minimum: 0
          example: 0
          nullable: true
        response_mode:
          type: string
          enum:
            - summary
            - detail
          example: detail
          nullable: true
        requested_segment:
          description: Requested portfolio segment. Null on canonical deal selections.
          type: string
          enum:
            - all
            - active
            - work_remaining
            - in_progress
            - submitted
            - resubmit_needed
            - awaiting_payment
            - applied
            - invited
            - paid
            - voided
            - cancelled
            - rejected
          example: null
          nullable: true
        requested_actions:
          description: >-
            Public enforced actions array. Non-empty for portfolio routes and
            empty for deal, help, and no-match routes; internal canonical AI
            deal proposals use null before Laravel serialization.
          type: array
          items:
            type: string
            enum:
              - overview
              - count
              - list
              - guidance
          maxItems: 4
          example: []
        referenced_count:
          description: >-
            Optional count derived by Laravel from the validated referenced
            turn's server-owned status metadata. It is never trusted from the
            client or model and never limits returned rows.
          type: integer
          minimum: 0
          example: 3
          nullable: true
        count_mismatch:
          description: >-
            For a resolved portfolio follow-up, true exactly when
            referenced_count differs from the current authorized total_count.
          type: boolean
          example: true
          nullable: true
        referenced_turn_id:
          description: >-
            Validated identifier of the bounded prior assistant turn used by a
            portfolio follow-up, natural continuation, or status ambiguity. Null
            for canonical deal selections, a fresh portfolio_query, and an
            explicit portfolio_cursor fast path.
          type: string
          example: null
          nullable: true
        help_topic:
          description: >-
            Validated topic only for context_mode=assistant_help.
            support_contact requests review-only MOGL Support contact;
            knowledge_lookup requests a curated KB answer. Null on every
            non-help route.
          type: string
          enum:
            - portfolio_statuses
            - mogl_overview
            - support_contact
            - knowledge_lookup
          example: knowledge_lookup
          nullable: true
        clarification_segments:
          description: >-
            Non-null validated deal-status choices for an ambiguous status
            reference. Empty on canonical assistant_help and deal selections.
          type: array
          items:
            type: string
            enum:
              - all
              - active
              - work_remaining
              - in_progress
              - submitted
              - resubmit_needed
              - awaiting_payment
              - applied
              - invited
              - paid
              - voided
              - cancelled
              - rejected
          maxItems: 5
          example: []
        clarification_required:
          description: >-
            Whether the enforced resolution requires clarification before an
            answer-stage turn. False for canonical assistant_help.
          type: boolean
          example: false
        portfolio_groups:
          description: >-
            Bounded server-owned status/count metadata persisted only for later
            continuity; never accepted from the model as authoritative.
          type: array
          items:
            $ref: '#/components/schemas/AthleteAiAssistantPortfolioGroup'
          maxItems: 20
        portfolio_group_candidates:
          description: >-
            Server-owned candidate status/count metadata for an ambiguous status
            reference.
          type: array
          items:
            $ref: '#/components/schemas/AthleteAiAssistantPortfolioGroup'
          maxItems: 20
        displayed_job_ids:
          description: Current authorized portfolio rows rendered on this turn.
          type: array
          items:
            type: integer
            minimum: 1
          maxItems: 20
        deal_type:
          description: >-
            Resolved deal kind for compatible single-deal routes. Null for
            canonical assistant_help.
          type: string
          enum:
            - job
            - fan_req
          example: null
          nullable: true
        choice_count:
          description: >-
            Present for routing ambiguity and counts hidden authorized deal
            choices after raw choices are removed. It is explicitly zero for
            status-only ambiguity; deal ambiguity may exceed the maximum number
            of quick buttons.
          type: integer
          minimum: 0
          example: 0
      type: object
      additionalProperties: true
    AthleteAiAssistantContextResolutionLoop1:
      description: >-
        Loop-1 persistence shape for assistant turns created by the bounded tool
        loop. Laravel derives the coarse compatibility fields from successful,
        grounded current-turn evidence. Raw tool arguments/results remain
        excluded; optional strict portfolio_state retains only safe compact
        continuity metadata.
      required:
        - version
        - scope
        - context_mode
        - job_id
        - deal_type
        - resolved_job_id
        - resolved_job_ids
        - resolved_deals
        - resolution_reason
        - confidence
        - abstain_reason
        - tool_trace
        - used_tools
        - budget
        - grounding_coverage
      properties:
        version:
          type: string
          enum:
            - loop-1
          example: loop-1
        scope:
          type: string
          enum:
            - athlete
            - deal
          example: deal
        context_mode:
          type: string
          enum:
            - athlete_portfolio
            - single_deal
            - multi_deal
            - assistant_help
          example: single_deal
        job_id:
          description: Polymorphic single-deal ID; null unless context_mode is single_deal.
          type: integer
          minimum: 1
          example: 2833
          nullable: true
        deal_type:
          type: string
          enum:
            - job
            - fan_req
          example: job
          nullable: true
        resolved_job_id:
          description: Compatibility alias for job_id.
          type: integer
          minimum: 1
          example: 2833
          nullable: true
        resolved_job_ids:
          description: >-
            Grounded standard-job IDs; fan request IDs are represented only in
            resolved_deals.
          type: array
          items:
            type: integer
            minimum: 1
          maxItems: 20
          uniqueItems: true
          example:
            - 2833
        resolved_deals:
          type: array
          items:
            $ref: '#/components/schemas/AthleteAiAssistantLoopResolvedDeal'
          maxItems: 20
          uniqueItems: true
        resolution_reason:
          type: string
          enum:
            - tool_trace
            - assistant_help
          example: tool_trace
        confidence:
          type: number
          format: float
          maximum: 1
          minimum: 0
          example: 0.9
        abstain_reason:
          type: string
          maxLength: 200
          example: null
          nullable: true
        requested_job_id:
          description: Present as null for deterministic no-deal support compatibility.
          type: integer
          minimum: 1
          example: null
          nullable: true
        help_topic:
          description: Present only for deterministic no-deal support compatibility.
          type: string
          enum:
            - support_contact
          example: support_contact
        tool_trace:
          type: array
          items:
            $ref: '#/components/schemas/AthleteAiAssistantToolTraceEntry'
          maxItems: 8
        portfolio_state:
          oneOf:
            - $ref: '#/components/schemas/AthleteAiAssistantPortfolioTraceState'
          nullable: true
          description: >-
            Latest validated successful get_portfolio compatibility state for
            trusted immediate follow-ups. Omitted when the turn has no
            successful portfolio result.
        used_tools:
          description: Unique tools in first-invocation order.
          type: array
          items:
            type: string
            enum:
              - get_portfolio
              - search_deals
              - get_deal
              - get_timeline
              - search_kb
              - propose_brand_draft
              - propose_support
          maxItems: 7
          uniqueItems: true
          example:
            - search_deals
            - get_deal
        budget:
          $ref: '#/components/schemas/AthleteAiAssistantLoopBudget'
        grounding_coverage:
          description: >-
            Validated current-turn grounding coverage reported by the loop, from
            0 to 1.
          type: number
          format: float
          maximum: 1
          minimum: 0
          example: 1
      type: object
      additionalProperties: false
    AthleteAiAssistantSupportAction:
      description: >-
        Review-only action for contacting MOGL Support. Opening the mailto lets
        the athlete review the pre-filled email in their mail client; the
        athlete must explicitly send it, and the assistant never sends it
        automatically.
      required:
        - type
        - label
        - url
      properties:
        type:
          type: string
          enum:
            - mailto
          example: mailto
        label:
          type: string
          example: pre-filled in email here
        url:
          type: string
          format: uri
          example: >-
            mailto:athlete-support@mogl.online?subject=Help%20from%20the%20AI%20Athlete%20Assistant%20needed&body=The%20athlete%20needs%20help%20with%20a%20payout.
      type: object
    AthleteAiAssistantClarificationDraft:
      required:
        - id
        - status
        - draft_text
        - athlete_snippet
        - created_at
      properties:
        id:
          type: integer
          example: 81
        status:
          type: string
          enum:
            - pending
            - sent
            - responded
            - superseded
            - dismissed
          example: pending
        draft_text:
          description: >-
            Natural brand-facing text persisted only after proposal validation.
            Internal reason, telemetry, tool, and routing namespaces are not
            exposed.
          type: string
          example: >-
            Hey Wonolo, I don't see any instructions about footwear for the
            Instagram Reel. Is it okay if I wear sandals in the video?
        athlete_snippet:
          type: string
          example: >-
            Hey Wonolo, I don't see any instructions about footwear for the
            Instagram Reel. Is it okay if I wear sandals in the vide
        sent_chat_id:
          type: integer
          example: null
          nullable: true
        sent_text:
          type: string
          example: null
          nullable: true
        sent_at:
          type: string
          format: date-time
          example: null
          nullable: true
        responded_chat_id:
          type: integer
          example: null
          nullable: true
        responded_message_text:
          type: string
          example: null
          nullable: true
        responded_at:
          type: string
          format: date-time
          example: null
          nullable: true
        superseded_by_id:
          type: integer
          example: null
          nullable: true
        created_at:
          type: string
          format: date-time
          example: '2026-07-22T06:46:17Z'
        brand_id:
          description: Included when the draft is embedded in chat or history.
          type: integer
          example: 4
          nullable: true
        connection_id:
          description: >-
            Athlete-brand message thread ID; included when the draft is embedded
            in chat or history.
          type: integer
          example: 912
          nullable: true
      type: object
    AthleteAiAssistantPortfolioGroup:
      required:
        - segment
        - count
      properties:
        segment:
          type: string
          enum:
            - all
            - active
            - work_remaining
            - in_progress
            - submitted
            - resubmit_needed
            - awaiting_payment
            - applied
            - invited
            - paid
            - voided
            - cancelled
            - rejected
          example: awaiting_payment
        count:
          description: Server-owned count captured when the portfolio group was returned.
          type: integer
          minimum: 0
          example: 3
      type: object
      additionalProperties: false
    AthleteAiAssistantLoopResolvedDeal:
      description: >-
        Authorized deal relationship derived from grounded loop source IDs and
        persisted for compatibility history filters.
      required:
        - deal_type
        - deal_id
        - relationship_role
      properties:
        deal_type:
          type: string
          enum:
            - job
            - fan_req
          example: job
        deal_id:
          type: integer
          minimum: 1
          example: 2833
        relationship_role:
          type: string
          enum:
            - grounded
          example: grounded
      type: object
      additionalProperties: false
    AthleteAiAssistantToolTraceEntry:
      description: >-
        Compact record of one loop tool decision. Raw arguments, full deal rows,
        and full tool results are never persisted here; a successful portfolio
        call may retain only strict bounded PortfolioTraceState compatibility
        metadata.
      required:
        - tool
        - args_digest
        - outcome
        - error_code
        - duration_ms
        - source_ids
      properties:
        tool:
          type: string
          enum:
            - get_portfolio
            - search_deals
            - get_deal
            - get_timeline
            - search_kb
            - propose_brand_draft
            - propose_support
          example: get_deal
        args_digest:
          description: >-
            SHA-256 digest of canonical tool arguments; raw arguments are not
            exposed.
          type: string
          maxLength: 64
          minLength: 64
          pattern: ^[a-f0-9]{64}$
          example: 4f1c2ab8a1f006b464b5a237178df77b86f35233784076e92f9c4c98a80b88c2
        outcome:
          type: string
          enum:
            - success
            - error
            - invalid_params
            - duplicate
            - unavailable
          example: success
        error_code:
          type: string
          enum:
            - not_found
            - invalid_params
            - fan_deal_not_allowed
            - draft_not_allowed
            - unavailable
            - budget_exceeded
            - invalid_json
            - invalid_response
            - transport_failed
            - backend_5xx
            - unexpected_status
          example: null
          nullable: true
        duration_ms:
          type: integer
          minimum: 0
          example: 42
        source_ids:
          description: >-
            Bounded source identifiers returned by this tool decision. Only
            successful current-turn evidence may ground the public answer.
          type: array
          items:
            type: string
            maxLength: 200
            minLength: 1
          maxItems: 500
          uniqueItems: true
          example:
            - job:2833
            - timeline:9121
        portfolio_state:
          oneOf:
            - $ref: '#/components/schemas/AthleteAiAssistantPortfolioTraceState'
          nullable: true
          description: >-
            Optional only for a successful get_portfolio decision. Omitted for
            all other tools and failed portfolio calls.
      type: object
      additionalProperties: false
    AthleteAiAssistantPortfolioTraceState:
      description: >-
        Strict compact compatibility state from a successful normalized
        get_portfolio call. It persists only bounded request metadata, canonical
        counts, truncation, and ordered displayed standard-job IDs; full deal
        rows and raw tool payloads are excluded.
      required:
        - lifecycle_mode
        - requested_segment
        - requested_actions
        - response_mode
        - offset
        - requested_sort
        - page_size
        - ordering
        - referenced_count
        - summary_counts
        - total_count
        - returned_count
        - count_mismatch
        - truncated
        - displayed_job_ids
      properties:
        lifecycle_mode:
          type: string
          enum:
            - all
            - current
            - historical
          example: all
        requested_segment:
          type: string
          enum:
            - all
            - active
            - work_remaining
            - in_progress
            - submitted
            - resubmit_needed
            - awaiting_payment
            - applied
            - invited
            - paid
            - voided
            - cancelled
            - rejected
          example: awaiting_payment
        requested_actions:
          type: array
          items:
            type: string
            enum:
              - overview
              - count
              - list
              - guidance
          maxItems: 4
          minItems: 1
          uniqueItems: true
          example:
            - count
            - list
        response_mode:
          type: string
          enum:
            - summary
            - detail
          example: detail
        offset:
          description: >-
            Applied backend-order offset. Positive values require
            requested_actions to contain list.
          type: integer
          maximum: 10000
          minimum: 0
          example: 0
        requested_sort:
          type: string
          enum:
            - default
            - hired_at_desc
            - invited_at_desc
          example: default
        page_size:
          type: integer
          maximum: 20
          minimum: 1
          example: 20
        ordering:
          type: string
          enum:
            - summary_priority_then_due_date_then_hired_at_then_job_id
            - hired_at_desc_then_job_id
            - invited_at_desc_then_job_id
          example: summary_priority_then_due_date_then_hired_at_then_job_id
        referenced_count:
          type: integer
          maximum: 10000
          minimum: 0
          example: 3
          nullable: true
        summary_counts:
          $ref: '#/components/schemas/AthleteAiToolPortfolioSummaryCounts'
        total_count:
          description: Current canonical count for requested_segment.
          type: integer
          minimum: 0
          example: 2
        returned_count:
          type: integer
          maximum: 20
          minimum: 0
          example: 2
        count_mismatch:
          description: >-
            True exactly when non-null referenced_count differs from
            total_count.
          type: boolean
          example: true
        truncated:
          type: boolean
          example: false
        displayed_job_ids:
          description: >-
            Authorized standard-job IDs rendered on this turn, in backend
            display order. Empty for non-list actions.
          type: array
          items:
            type: integer
            minimum: 1
          maxItems: 20
          uniqueItems: true
          example:
            - 2833
            - 3014
      type: object
      additionalProperties: false
    AthleteAiAssistantLoopBudget:
      description: >-
        Persisted bounded-loop usage summary. Tool calls count actual
        executions; duplicate calls do not consume an execution slot.
      required:
        - model_calls
        - tool_calls
        - duration_ms
      properties:
        model_calls:
          type: integer
          maximum: 5
          minimum: 0
          example: 2
        tool_calls:
          type: integer
          maximum: 8
          minimum: 0
          example: 2
        duration_ms:
          type: integer
          minimum: 0
          example: 840
      type: object
      additionalProperties: false
    AthleteAiToolPortfolioSummaryCounts:
      required:
        - all
        - active
        - work_remaining
        - in_progress
        - submitted
        - resubmit_needed
        - awaiting_payment
        - applied
        - invited
        - paid
        - voided
        - cancelled
        - rejected
      properties:
        all:
          type: integer
          minimum: 0
          example: 6
        active:
          description: >-
            Deprecated compatibility count. Still in_progress + submitted +
            resubmit_needed.
          type: integer
          minimum: 0
          example: 3
        work_remaining:
          description: Athlete work remaining. Equals in_progress + resubmit_needed.
          type: integer
          minimum: 0
          example: 2
        in_progress:
          type: integer
          minimum: 0
          example: 1
        submitted:
          type: integer
          minimum: 0
          example: 1
        resubmit_needed:
          type: integer
          minimum: 0
          example: 1
        awaiting_payment:
          type: integer
          minimum: 0
          example: 1
        applied:
          type: integer
          minimum: 0
          example: 0
        invited:
          type: integer
          minimum: 0
          example: 0
        paid:
          type: integer
          minimum: 0
          example: 1
        voided:
          description: >-
            Exclusive count of fully voided deals. Partial-void deals keep their
            live primary state.
          type: integer
          minimum: 0
          example: 1
        cancelled:
          type: integer
          minimum: 0
          example: 0
        rejected:
          type: integer
          minimum: 0
          example: 0
      type: object
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        JWT Bearer token authentication. Use the /api/login endpoint to obtain a
        token.
      scheme: bearer
      bearerFormat: JWT

````