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

# List one member's XP history, newest first

> The member's own ledger rows, newest first, with the sentence a member reads for each. Page with `limit` and the opaque `next_cursor`. `trigger_event_id` names the signed ingest event a row was paid for, so an amount can be joined to the action that earned it. Scoped to the member named in the path: a user outside your organization answers 404, exactly as `GET /v1/users/{userId}` does.



## OpenAPI

````yaml https://api.develop.fourdos.dev/openapi/partner.json get /v1/users/{userId}/xp-history
openapi: 3.1.0
info:
  title: 4D OS Partner API
  version: 0.1.0
  description: >-
    REST API for 4D OS partners. Authenticate with your organization API key:
    `Authorization: Bearer <key>`.


    Requests and responses are JSON with `snake_case` field names. Errors share
    one envelope: `{ "error": { "code", "status", "message", "details"? } }`.


    Mutating endpoints that declare it accept an `Idempotency-Key` header so
    retries are safe.


    Bulk-migrating members? See the [Migrating to 4D
    guide](https://docs.fourdos.dev/walkthroughs/migrate-existing-members) for
    the canonical import schema, a worked example, and the `/v1/imports`
    sequence.
servers:
  - url: https://api.develop.fourdos.dev
security:
  - partnerApiKey: []
tags:
  - name: Users
    description: Create, read, and manage users and their org membership
  - name: Imports
    description: Bulk member import jobs (staging → validate → commit)
  - name: API keys
    description: Issue, list, and revoke server-side organization API keys
  - name: Modules
    description: >-
      Publish private modules, install visible modules, and manage their
      credentials
  - name: Ingest
    description: Receive signed native events from an installed module
  - name: Engagement
    description: Browser event tracking (publishable keys) and tracking-key management
  - name: Revenue
    description: Report sales and refunds for the club's revenue dashboards
  - name: Ad delivery
    description: Fill a club site's ad slots, for anonymous or signed-in fans
  - name: Ad entries
    description: Fans entering a sponsor's draw, reported by the club's backend
paths:
  /v1/users/{userId}/xp-history:
    get:
      tags:
        - Users
      summary: List one member's XP history, newest first
      description: >-
        The member's own ledger rows, newest first, with the sentence a member
        reads for each. Page with `limit` and the opaque `next_cursor`.
        `trigger_event_id` names the signed ingest event a row was paid for, so
        an amount can be joined to the action that earned it. Scoped to the
        member named in the path: a user outside your organization answers 404,
        exactly as `GET /v1/users/{userId}` does.
      operationId: listMemberXpHistory
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 25
        - name: cursor
          in: query
          required: false
          description: Opaque cursor from a previous response's `page_info.next_cursor`.
          schema:
            type: string
      responses:
        '200':
          description: A page of the member's XP history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemberXpHistoryPage'
        '401':
          description: Authentication is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found in this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    MemberXpHistoryPage:
      type: object
      properties:
        entries:
          type: array
          items:
            $ref: '#/components/schemas/MemberXpHistoryEntry'
        page_info:
          type: object
          properties:
            next_cursor:
              type:
                - string
                - 'null'
              description: Pass back as `cursor` for the next page; null on the last page.
            has_more:
              type: boolean
          required:
            - next_cursor
            - has_more
      required:
        - entries
        - page_info
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            status:
              type: integer
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - status
            - message
      required:
        - error
    MemberXpHistoryEntry:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          description: The ledger entry kind, e.g. `accrual` or `redemption`.
        direction:
          type: string
          enum:
            - earn
            - spend
          description: '`amount` never carries a sign.'
        amount:
          type: string
          description: A positive integer as a decimal string.
        created_at:
          type: string
          format: date-time
        phrase:
          type: string
          description: The plain sentence the member reads for this row.
        funding:
          type:
            - object
            - 'null'
          properties:
            class:
              type: string
              enum:
                - club
                - sponsor
            campaign_name:
              type:
                - string
                - 'null'
          required:
            - class
            - campaign_name
        reward_name:
          type:
            - string
            - 'null'
        cap_applied:
          type: boolean
          description: True when a daily or per-rule cap reduced the award.
        trigger_event_id:
          type:
            - string
            - 'null'
          description: >-
            The signed ingest event this row was paid for; null for a row with
            no trigger. Match it against the `canonical_event_id` your `POST
            /v1/ingest` call returned to say which XP came from which action. Do
            not correlate on timestamps.
      required:
        - id
        - type
        - direction
        - amount
        - created_at
        - phrase
        - funding
        - reward_name
        - cap_applied
        - trigger_event_id
  securitySchemes:
    partnerApiKey:
      type: http
      scheme: bearer
      description: >-
        Organization API key (`org_...`) sent as `Authorization: Bearer <key>`.
        Keys are scoped to one organization; every request operates within that
        tenant.

````

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