> ## 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 what each event pays

> One rule set per event type with active rules in your organization: the cases checked in order, the default, and the rules that pay on top. Retired and superseded rules are left out. Creating definitions needs a partner admin session and is not part of this reference.



## OpenAPI

````yaml https://api.develop.fourdos.dev/openapi/partner.json get /v1/xp/event-definitions
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: Consents
    description: Record, list and withdraw a member's consents and agreements
  - name: Rewards
    description: A member's reward catalog, claims and reward codes
  - name: XP
    description: >-
      A member's balance, earning headroom, expiry and boosts, and what each
      event pays
  - name: Tiers
    description: Read your organization's tier ladder
  - name: Webhooks
    description: Register webhook endpoints. Deliveries are not sent yet.
  - name: Events
    description: Refetch your organization's events from the last 30 days
  - 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/xp/event-definitions:
    get:
      tags:
        - XP
      summary: List what each event pays
      description: >-
        One rule set per event type with active rules in your organization: the
        cases checked in order, the default, and the rules that pay on top.
        Retired and superseded rules are left out. Creating definitions needs a
        partner admin session and is not part of this reference.
      operationId: listXpEventRuleSets
      responses:
        '200':
          description: The rule sets
          content:
            application/json:
              schema:
                type: object
                properties:
                  rule_sets:
                    type: array
                    items:
                      $ref: '#/components/schemas/XpEventRuleSet'
                required:
                  - rule_sets
        '401':
          description: '`UNAUTHORIZED`: no valid credential'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: '`FORBIDDEN`: a platform admin session with no active organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '`NOT_FOUND`: a session with no active organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - partnerApiKey: []
        - adminSession: []
        - memberSession: []
components:
  schemas:
    XpEventRuleSet:
      type: object
      properties:
        event_key:
          type: string
          description: The canonical event type, for example `engagement.quiz.completed`.
        resolution:
          type: string
          enum:
            - first_matching_case_else_default
          description: >-
            The first case whose condition matches pays; otherwise the default
            does.
        default:
          type:
            - object
            - 'null'
          properties:
            name:
              type:
                - string
                - 'null'
            amount:
              type:
                - string
                - 'null'
            funding_source:
              $ref: '#/components/schemas/XpFundingSource'
          required:
            - name
            - amount
            - funding_source
        cases:
          type: array
          items:
            type: object
            properties:
              name:
                type:
                  - string
                  - 'null'
              amount:
                type:
                  - string
                  - 'null'
              condition:
                type:
                  - object
                  - 'null'
                description: >-
                  `{ field, operator: "eq", value }` or `{ field, operator:
                  "in", values }`; null on the default.
                properties:
                  field:
                    type: string
                  operator:
                    type: string
                    enum:
                      - eq
                      - in
                  value:
                    type:
                      - string
                      - number
                      - boolean
                  values:
                    type: array
                    items:
                      type:
                        - string
                        - number
                        - boolean
              condition_summary:
                type:
                  - string
                  - 'null'
              funding_source:
                $ref: '#/components/schemas/XpFundingSource'
            required:
              - name
              - amount
              - condition
              - condition_summary
              - funding_source
        adds_on_top:
          type: array
          description: Rules that pay in addition to the case or default.
          items:
            type: object
            properties:
              name:
                type:
                  - string
                  - 'null'
              advanced_award:
                type:
                  - string
                  - 'null'
                enum:
                  - formula
                  - tiered
                  - conditional
                  - unreadable_source
                  - hand_authored
                  - unknown
                  - null
              funding_source:
                $ref: '#/components/schemas/XpFundingSource'
            required:
              - name
              - advanced_award
              - funding_source
      required:
        - event_key
        - resolution
        - default
        - cases
        - adds_on_top
    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
    XpFundingSource:
      type: object
      properties:
        kind:
          type: string
          enum:
            - engagement_reserve
            - sponsor_campaign
            - unreadable
        campaign_id:
          type:
            - string
            - 'null'
        campaign_name:
          type:
            - string
            - 'null'
      required:
        - kind
  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.
    adminSession:
      type: http
      scheme: bearer
      description: >-
        Partner admin session token sent as `Authorization: Bearer <token>`.
        Obtained by signing in (console or the email OTP endpoints) and
        completing the second factor; see the Authentication page.
    memberSession:
      type: http
      scheme: bearer
      description: >-
        A signed-in member's session token sent as `Authorization: Bearer
        <token>`. Accepted only on the operations that list it, and each of
        those says which user ids a member may name. Your backend uses the
        organization API key instead.

````

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