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

# List earning rule activities

> 
<Info>

<Badge color="gray">Documentation in progress</Badge>

This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.

</Info>

Returns a cursor-paginated list of activities (audit trail) for a single earning rule.
The same field cannot be used in both ascending and descending order at once.
Default order is `-created_at`.

A successful call records no activity.



## OpenAPI

````yaml /openapi/loyalties-v2.json get /v2/loyalties/earning-rules/{earningRuleId}/activities
openapi: 3.1.0
info:
  title: Voucherify API - Loyalty v2
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v2/loyalties/earning-rules/{earningRuleId}/activities:
    parameters:
      - name: earningRuleId
        in: path
        required: true
        description: Identifies the earning rule. Format `lern_[a-f0-9]+`.
        schema:
          type: string
          pattern: ^lern_[a-f0-9]+$
    get:
      tags:
        - Earning Rules
      summary: List earning rule activities
      description: >-

        <Info>


        <Badge color="gray">Documentation in progress</Badge>


        This documentation is in progress. The parameters, fields, request and
        response bodies, and other data may be subject to change. If you need
        more information or you want to share feedback, contact [Voucherify
        support](https://www.voucherify.io/contact-support) or your Technical
        Account Manager.


        </Info>


        Returns a cursor-paginated list of activities (audit trail) for a single
        earning rule.

        The same field cannot be used in both ascending and descending order at
        once.

        Default order is `-created_at`.


        A successful call records no activity.
      operationId: listEarningRuleActivities
      parameters:
        - name: limit
          in: query
          required: false
          description: >-
            Limits the page size to an integer from 1 to 100. Defaults to 10. A
            numeric string is accepted and rounded to the nearest integer.
          schema:
            type:
              - number
              - string
              - 'null'
            minimum: 1
            maximum: 100
            default: 10
        - name: order
          in: query
          required: false
          description: >-
            Orders the results. Accepts one value or an array. Prefix a field
            with `-` for descending order. Defaults to `-created_at`. The same
            field cannot be used in both directions. Rows with the same sort
            value are then ordered by `id` ascending.
          explode: true
          schema:
            oneOf:
              - type: string
                enum:
                  - created_at
                  - '-created_at'
              - type: array
                items:
                  type: string
                  enum:
                    - created_at
                    - '-created_at'
              - type: 'null'
        - name: cursor
          in: query
          required: false
          description: >-
            Continues pagination. Pass the `cursor.next` value from a previous
            response. Format `lcrsaer_[a-f0-9]+`. The cursor matches the filters
            and order of that response.
          schema:
            type:
              - string
              - 'null'
            pattern: ^lcrsaer_[a-f0-9]+$
        - name: filters
          in: query
          required: false
          style: deepObject
          explode: true
          description: >-
            Filters the results. Pass a deep object, for example
            `filters[type][conditions][$is]=vl.earning_rule.updated`. Fields
            combine through `junction`, which defaults to `AND`. Omit `filters`
            to apply no field filter.
          schema:
            oneOf:
              - $ref: >-
                  #/components/schemas/LoyaltiesEarningRulesActivitiesListRequestQuery
              - type: 'null'
      responses:
        '200':
          description: Paginated list of earning rule activities
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/V2LoyaltiesEarningRulesActivitiesListResponseBody
        '400':
          description: >-
            Validation error - request body or query parameters failed
            validation, or the operation is not allowed in the current resource
            state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Internal server error:
                  value:
                    code: 500
                    key: api_error
                    message: >-
                      Something went wrong. Don't worry, your campaigns are
                      still safe and the Voucherify Team has been notified.
                      Check out our Help Center and forums for help, or head
                      back to home.
      security:
        - X-App-Id: []
          X-App-Token: []
        - bearerAuth: []
components:
  schemas:
    LoyaltiesEarningRulesActivitiesListRequestQuery:
      type: object
      description: >-
        Request query schema for **GET**
        `/v2/loyalties/earning-rules/{earningRuleId}/activities`.
      properties:
        junction:
          description: >-
            Joins the field filters. Allowed values are `AND` and `OR`. Defaults
            to `AND`.
          oneOf:
            - type: string
              enum:
                - AND
                - OR
            - type: 'null'
        id:
          description: >-
            Activity ID filter. Allowed conditions: `$is`, `$is_not` (single
            value), `$in`, `$not_in` (up to 100 values). Values must match
            `^laer_[a-f0-9]+$`. Can be `null`.
          oneOf:
            - type: object
              required:
                - conditions
              additionalProperties: false
              properties:
                conditions:
                  type: object
                  minProperties: 1
                  additionalProperties: false
                  properties:
                    $is:
                      description: >-
                        Matches one value. A string or a one-element array.
                        Format `laer_[a-f0-9]+`.
                      oneOf:
                        - type: string
                          pattern: ^laer_[a-f0-9]+$
                        - type: array
                          minItems: 1
                          maxItems: 1
                          items:
                            type: string
                            pattern: ^laer_[a-f0-9]+$
                    $is_not:
                      description: >-
                        Excludes one value. A string or a one-element array.
                        Format `laer_[a-f0-9]+`.
                      oneOf:
                        - type: string
                          pattern: ^laer_[a-f0-9]+$
                        - type: array
                          minItems: 1
                          maxItems: 1
                          items:
                            type: string
                            pattern: ^laer_[a-f0-9]+$
                    $in:
                      description: >-
                        Matches any of the values. A string or an array of 1 to
                        100 values. Format `laer_[a-f0-9]+`.
                      oneOf:
                        - type: string
                          pattern: ^laer_[a-f0-9]+$
                        - type: array
                          minItems: 1
                          maxItems: 100
                          items:
                            type: string
                            pattern: ^laer_[a-f0-9]+$
                    $not_in:
                      description: >-
                        Excludes any of the values. A string or an array of 1 to
                        100 values. Format `laer_[a-f0-9]+`.
                      oneOf:
                        - type: string
                          pattern: ^laer_[a-f0-9]+$
                        - type: array
                          minItems: 1
                          maxItems: 100
                          items:
                            type: string
                            pattern: ^laer_[a-f0-9]+$
            - type: 'null'
        type:
          description: >-
            Activity type filter (enum type). Allowed conditions: `$is`,
            `$is_not` (single value), `$in`, `$not_in` (up to 10 values). Can be
            `null`.
          oneOf:
            - type: object
              required:
                - conditions
              additionalProperties: false
              properties:
                conditions:
                  type: object
                  minProperties: 1
                  additionalProperties: false
                  properties:
                    $is:
                      description: Matches one value. A string or a one-element array.
                      oneOf:
                        - $ref: '#/components/schemas/EarningRuleActivityType'
                        - type: array
                          minItems: 1
                          maxItems: 1
                          items:
                            $ref: '#/components/schemas/EarningRuleActivityType'
                    $is_not:
                      description: Excludes one value. A string or a one-element array.
                      oneOf:
                        - $ref: '#/components/schemas/EarningRuleActivityType'
                        - type: array
                          minItems: 1
                          maxItems: 1
                          items:
                            $ref: '#/components/schemas/EarningRuleActivityType'
                    $in:
                      description: >-
                        Matches any of the values. A string or an array of 1 to
                        10 values.
                      oneOf:
                        - $ref: '#/components/schemas/EarningRuleActivityType'
                        - type: array
                          minItems: 1
                          maxItems: 10
                          items:
                            $ref: '#/components/schemas/EarningRuleActivityType'
                    $not_in:
                      description: >-
                        Excludes any of the values. A string or an array of 1 to
                        10 values.
                      oneOf:
                        - $ref: '#/components/schemas/EarningRuleActivityType'
                        - type: array
                          minItems: 1
                          maxItems: 10
                          items:
                            $ref: '#/components/schemas/EarningRuleActivityType'
            - type: 'null'
        created_at:
          description: Filters by creation date.
          oneOf:
            - $ref: '#/components/schemas/EarningRuleDateFilterConditions'
            - type: 'null'
      additionalProperties: false
      title: Loyalties Earning Rules Activities List Request Query
    V2LoyaltiesEarningRulesActivitiesListResponseBody:
      title: V2 Loyalties Earning Rules Activities List Response Body
      type: object
      description: >-
        Response body schema for **GET**
        `/v2/loyalties/earning-rules/{earningRuleId}/activities`.
      allOf:
        - $ref: '#/components/schemas/EarningRuleActivitiesListResponse'
    ErrorResponse:
      type: object
      description: Standard error response returned by all Loyalty v2 endpoints.
      properties:
        code:
          type: integer
          description: HTTP status code of the error.
        key:
          type: string
          description: Machine-readable error key.
        message:
          type: string
          description: Human-readable error message.
        details:
          type: string
          description: Additional details about the error.
        request_id:
          type: string
          description: Unique identifier of the request that produced the error.
        resource_id:
          type: string
          description: Unique identifier of the resource that produced the error.
        resource_type:
          type: string
          description: Type of the resource that produced the error.
    EarningRuleActivityType:
      type: string
      description: Earning rule activity type.
      enum:
        - vl.earning_rule.created
        - vl.earning_rule.updated
        - vl.earning_rule.deleted
        - vl.earning_rule.activated
        - vl.earning_rule.deactivated
        - vl.earning_rule.drafted
        - vl.earning_rule.assigned
        - vl.earning_rule.unassigned
    EarningRuleDateFilterConditions:
      type: object
      description: >-
        Date field filter conditions. `$before` and `$after` take a date string;
        `$is`, `$more_than` and `$less_than` take a non-negative integer number
        of days (relative comparison); `$has_value` and `$is_unknown` are
        presence checks.
      required:
        - conditions
      additionalProperties: false
      properties:
        conditions:
          type: object
          minProperties: 1
          properties:
            $before:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
              description: >-
                Matches dates before the given value. An ISO 8601 date-time, as
                a string or a one-element array.
            $after:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
              description: >-
                Matches dates after the given value. An ISO 8601 date-time, as a
                string or a one-element array.
            $is:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
              description: >-
                Matches a date exactly the given number of days ago. A
                non-negative integer, as a string or a one-element array.
            $more_than:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
              description: >-
                Matches dates more than the given number of days ago. A
                non-negative integer, as a string or a one-element array.
            $less_than:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
              description: >-
                Matches dates less than the given number of days ago. A
                non-negative integer, as a string or a one-element array.
            $has_value:
              oneOf:
                - type: string
                - type: array
                  maxItems: 1
              description: Matches when the field is set. The condition value is ignored.
            $is_unknown:
              oneOf:
                - type: string
                - type: array
                  maxItems: 1
              description: >-
                Matches when the field is not set. The condition value is
                ignored.
          additionalProperties: false
    EarningRuleActivitiesListResponse:
      type: object
      description: Cursor-paginated list of earning rule activities.
      properties:
        data:
          type: array
          description: Activities on the current page.
          items:
            $ref: '#/components/schemas/EarningRuleActivityResponse'
        cursor:
          type:
            - object
            - 'null'
          description: Pagination cursor. `null` when there are no more results.
          properties:
            next:
              type: string
              description: >-
                Cursor ID to pass as the `cursor` query parameter (matches
                `^lcrsaer_[a-f0-9]+$`).
            expires_at:
              type: string
              format: date-time
              description: Cursor expiration timestamp.
        object:
          type: string
          description: Object type marker. Always `list`.
          const: list
    EarningRuleActivityResponse:
      type: object
      description: A single earning rule activity.
      properties:
        id:
          type: string
          pattern: ^laer_[a-f0-9]+$
          description: Activity ID (`laer_...`).
        earning_rule_id:
          type: string
          pattern: ^lern_[a-f0-9]+$
          description: ID of the earning rule the activity belongs to.
        type:
          $ref: '#/components/schemas/EarningRuleActivityType'
        data:
          type: object
          description: >-
            Activity payload. For
            created/updated/deleted/activated/deactivated/drafted activities it
            contains an `earning_rule` snapshot (the full earning rule object at
            the time of the change).
          additionalProperties: true
        created_at:
          type: string
          format: date-time
          description: Activity timestamp (ISO 8601).
        group_id:
          type: string
          description: Groups related activities recorded together.
        source:
          $ref: '#/components/schemas/EarningRuleActivitySource'
          description: Origin of the activity. Absent when not recorded.
    EarningRuleActivitySource:
      type: object
      description: Origin of the activity.
      properties:
        channel:
          type: string
          enum:
            - USER_PORTAL
            - API
            - CLIENT_API
            - INTERNAL
          description: Channel through which the change was made.
        user:
          type: object
          description: User who made the change (present for USER_PORTAL channel).
          properties:
            id:
              type: string
              description: User ID.
        api_key:
          type: object
          description: >-
            API key used to make the change (present for API/CLIENT_API
            channels).
          properties:
            name:
              type: string
              description: API key name.
            app_id:
              type: string
              description: Application ID of the API key.
            client_app_id:
              type: string
              description: Client application ID (for CLIENT_API keys).
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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