> ## 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 Validation Rule Assignments

> Retrieve validation rule assignments for a specific validation rule.



## OpenAPI

````yaml /openapi/validation-rules.json get /v1/validation-rules/{validationRuleId}/assignments
openapi: 3.0.1
info:
  title: Voucherify API - Validation Rules
  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:
  /v1/validation-rules/{validationRuleId}/assignments:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterValidationRuleId'
        name: validationRuleId
        in: path
        required: true
        description: Unique validation rule ID.
    get:
      tags:
        - Validation Rules
      summary: List Validation Rule Assignments
      description: Retrieve validation rule assignments for a specific validation rule.
      operationId: list-validation-rule-assignments
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - schema:
            $ref: '#/components/schemas/ParameterOrderListValidationRuleAssignments'
          in: query
          name: order
          description: >-
            This is a property that controls the sorting direction of the
            results. Sort the results using one of the filtering options, where
            the dash `-` preceding a sorting option means sorting in a
            descending order.
      responses:
        '200':
          description: >-
            Returns a dictionary of validation rule assignments.  If the
            validation rule ID provided in the path parameter cannot be found,
            the endpoint will return an empty `data` array and a total of `0`.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ValidationRulesAssignmentsListResponseBody
              examples:
                Example:
                  value:
                    object: list
                    data_ref: data
                    data:
                      - id: asgm_74F7QZoYbUoljwQO
                        rule_id: val_4j7DCRm2IS59
                        related_object_id: v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc
                        related_object_type: voucher
                        created_at: '2022-02-17T09:05:34.642Z'
                        object: validation_rules_assignment
                      - id: asgm_zzLBm8mIzGQStXl9
                        rule_id: val_4j7DCRm2IS59
                        related_object_id: v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
                        related_object_type: voucher
                        created_at: '2022-02-17T08:18:15.085Z'
                        object: validation_rules_assignment
                      - id: asgm_JztMAws0e0Qx2Xy6
                        rule_id: val_4j7DCRm2IS59
                        related_object_id: camp_kjja4moiVB7hQKPGOT61026Z
                        related_object_type: campaign
                        created_at: '2022-02-15T13:26:34.807Z'
                        object: validation_rules_assignment
                    total: 3
                No Assignments:
                  value:
                    object: list
                    data_ref: data
                    data: []
                    total: 0
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - validation-rules
components:
  schemas:
    ParameterValidationRuleId:
      type: string
      example: val_TU4de3EP4dlL
    ParameterOrderListValidationRuleAssignments:
      type: string
      enum:
        - created_at
        - '-created_at'
    ValidationRulesAssignmentsListResponseBody:
      type: object
      title: Validation Rules Assignments List Response Body
      description: >-
        Response body for **GET** `v1/validation-rules-assignments` and **GET**
        `v1/validation-rules/{validationRuleId}/assignments`.
      allOf:
        - $ref: '#/components/schemas/ValidationRuleAssignmentsList'
    ParameterLimit:
      type: integer
      minimum: 1
      maximum: 100
    ParameterPage:
      type: integer
      minimum: 1
      maximum: 100
    ValidationRuleAssignmentsList:
      type: object
      description: Validation Rule Assignments List
      title: Validation Rule Assignments List
      properties:
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about validation rule assignments.
          default: list
        data_ref:
          type: string
          description: >-
            Identifies the name of the JSON property that contains the array of
            validation rule assignments.
          default: data
        data:
          type: array
          description: A dictionary that contains an array of validation rule assignments.
          items:
            $ref: '#/components/schemas/ValidationRuleAssignment'
        total:
          type: integer
          description: Total number of validation rule assignments.
      required:
        - object
        - data_ref
        - data
        - total
    ValidationRuleAssignment:
      title: Validation Rule Assignment
      type: object
      description: This is an object representing a validation rule assignment.
      properties:
        id:
          type: string
          example: asgm_74F7QZoYbUoljwQO
          description: Validation rule assignment ID.
        rule_id:
          type: string
          example: val_4j7DCRm2IS59
          description: Validation rule ID.
        related_object_id:
          type: string
          example: v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
          description: The resource ID to which the validation rule was assigned.
        related_object_type:
          type: string
          description: The type of resource to which the validation rule was assigned.
          enum:
            - voucher
            - campaign
            - earning_rule
            - reward_assignment
            - promotion_tier
            - distribution
        created_at:
          type: string
          example: '2022-02-17T08:18:15.085Z'
          description: >-
            Timestamp representing the date and time when the validation rule
            assignment was created. The value is shown in the ISO 8601 format.
          format: date-time
        object:
          type: string
          default: validation_rules_assignment
          description: The type of the object represented by the ID.
          enum:
            - validation_rules_assignment
      required:
        - id
        - rule_id
        - related_object_id
        - related_object_type
        - created_at
        - object
  parameters:
    limit:
      name: limit
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ParameterLimit'
      description: >-
        Limits the number of objects to be returned. The limit can range between
        1 and 100 items. If no limit is set, it returns 10 items.
    page:
      name: page
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ParameterPage'
      description: Which page of results to return. The lowest value is `1`.
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````