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

# Complete Loyalty Rule

> Verify a loyalty rule based on user action and reward them if applicable. This endpoint currently only supports following rule types: code_entry, text_input, link_click, external_rule, connect_wallet, check_in, connected_twitter, drip_x_follow, drip_x_new_tweet, drip_x_text_in_bio, drip_x_text_in_name, drip_x_text_in_comment, drip_x_tweet, connected_phone, instagram_post, instagram_follow, connected_steam, steam_wishlist, connected_epic, connected_email, profile_completed, connected_telegram, telegram_messages, telegram_join, connected_discord, discord_member, DiscordMessages, discord_join, discord_role_grant, quiz, poll, TokenHold, token_hold_erc20, connected_github, github_repo_star, github_repo_fork, github_repo_collaborator, connected_youtube, youtube_subscribers, youtube_comment, connected_reddit, reddit_comment, connected_instagram, points_airdrop, shopify_spend, swap, connected_tiktok, tiktok_post, tiktok_follow, post_impressions, stratus_function, dapps_by_gas_spent, dapps_by_active_users, dapps_by_new_users



## OpenAPI

````yaml /api-reference/openapi.documented.json post /api/loyalty/rules/{id}/complete
openapi: 3.0.2
info:
  title: Snag Solutions - API Docs
  description: >-
    Documentation for Loyalty & Socials APIs. Some endpoints require an API key
    to authenticate. To obtain a key, reach out to the Snag Solutions team at
    support@snagsolutions.io.
  version: '0.1'
servers:
  - url: https://admin.snagsolutions.io/
    description: Production
security: []
paths:
  /api/loyalty/rules/{id}/complete:
    post:
      tags:
        - Loyalty
      summary: Complete Loyalty Rule
      description: >-
        Verify a loyalty rule based on user action and reward them if
        applicable. This endpoint currently only supports following rule types:
        code_entry, text_input, link_click, external_rule, connect_wallet,
        check_in, connected_twitter, drip_x_follow, drip_x_new_tweet,
        drip_x_text_in_bio, drip_x_text_in_name, drip_x_text_in_comment,
        drip_x_tweet, connected_phone, instagram_post, instagram_follow,
        connected_steam, steam_wishlist, connected_epic, connected_email,
        profile_completed, connected_telegram, telegram_messages, telegram_join,
        connected_discord, discord_member, DiscordMessages, discord_join,
        discord_role_grant, quiz, poll, TokenHold, token_hold_erc20,
        connected_github, github_repo_star, github_repo_fork,
        github_repo_collaborator, connected_youtube, youtube_subscribers,
        youtube_comment, connected_reddit, reddit_comment, connected_instagram,
        points_airdrop, shopify_spend, swap, connected_tiktok, tiktok_post,
        tiktok_follow, post_impressions, stratus_function, dapps_by_gas_spent,
        dapps_by_active_users, dapps_by_new_users
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                verificationCode:
                  type: string
                  title: Verification Code
                  description: Optional verification code for completing the loyalty rule
                  example: VERIF123
                userId:
                  type: string
                  format: uuid
                  title: User ID
                  description: Unique identifier for the user
                  example: 123e4567-e89b-12d3-a456-426614174000
                walletAddress:
                  type: string
                  title: Wallet Address
                  description: >-
                    Wallet address of the user can only be used if userId is not
                    provided
                  example: '0x1234567890abcdef1234567890abcdef12345678'
                contentUrl:
                  type: string
                  title: Content URL (Post/Comment Link)
                  description: Link to the post/comment made by user
                  example: https://x.com/Snag_Solutions/status/1735407428093522314
                loyaltyQuestionChoiceId:
                  type: string
                  title: Selected Choice ID
                  description: ID of the choice selected by the user
                  example: 123e4567-e89b-12d3-a456-426614174000
                verifyOnly:
                  default: 'false'
                  type: string
                  title: Verify Only
                  description: >-
                    Flag indicating if only verification is required, this will
                    not create a transaction and reward the user.
                  example: false
                rangeValue:
                  type: number
                  nullable: true
                  title: Range Value
                  description: Value to compare with the range
                  example: 10
                amount:
                  type: number
                  nullable: true
                  title: Override Amount
                  description: >-
                    Override amount for the reward (rounded to nearest whole
                    number). This will override the rule amount and reward the
                    integer passed.
                  example: 10
                idempotencyKey:
                  type: string
                  maxLength: 70
                  title: Idempotency Key
                  description: Unique key to ensure idempotent requests.
                  example: IDEMPOTENCY123
                skipChainOrRequiredCheck:
                  type: boolean
                  title: Skip Chain or Required Check
                  description: >-
                    Flag indicating if the chain or required check should be
                    skipped.
                  example: false
              title: Loyalty Rule Completion
              description: Schema for completing a loyalty rule
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Completion request added to queue
                      - >-
                        Link click being verified, come back later to check the
                        status
                required:
                  - message
        '304':
          description: '304'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Completion request already in queue
                required:
                  - message
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - loyaltyRuleId must be a uuid
                      - Loyalty rule {NAME} has expired
                      - Loyalty rule {NAME} has not started yet
                      - Only external rules can have amount override
                      - Only external rules can have idempotency key override
                      - Loyalty currency not found
                      - Api key is required to skip chain or required check
                      - Access restricted. Your account is blocked.
                      - >-
                        Please complete other required rules to unlock this
                        quest.
                      - >-
                        Unfortunately, this quest is only available for new
                        users
                      - >-
                        Unfortunately, we couldn't verify the code you entered.
                        Please ensure it's correct and try again
                      - Invalid Verification, try again
                      - Quest not completed
                      - >-
                        You have already clicked the link, please wait for the
                        reward to be processed
                      - >-
                        Check-in amount rule cannot be completed when amount is
                        0
                      - Twitter not connected
                      - Phone not connected or not verified
                      - Instagram not connected
                      - Telegram not connected
                      - Discord not connected
                      - Epic not connected
                      - Email not verified
                      - GitHub not connected
                      - Youtube not connected
                      - Reddit not connected
                      - Comment link is required
                      - TikTok not connected
                      - Twitter not connected or content url is required
                      - Steam not connected
                      - Email not connected or not verified
                      - No choice selected
                      - Question not found
                      - Invalid choice selected
                      - Claim on token hold is not supported for Sui
                      - >-
                        Claim on token hold is not supported for paid full
                        royalty or native purchases
                      - Claim on token hold is only supported for multipliers
                      - Rule is not setup
                      - Quest not achieved, please try again.
                      - Invalid request
                    title: Human-readable status message
                    description: >-
                      Categorized examples of messages that may be returned for
                      a loyalty rule's processing result.

                                possible messages:
                                'loyaltyRuleId must be a uuid',
                                'Loyalty rule {NAME} has expired',
                                'Loyalty rule {NAME} has not started yet',
                                'Only external rules can have amount override',
                                'Only external rules can have idempotency key override',
                                'Loyalty currency not found',
                                'Api key is required to skip chain or required check',
                                'Access restricted. Your account is blocked.',
                                'Please complete other required rules to unlock this quest.',
                                'Unfortunately, this quest is only available for new users',
                                "Unfortunately, we couldn't verify the code you entered. Please ensure it's correct and try again",
                                'Invalid Verification, try again',
                                'Quest not completed',
                                'You have already clicked the link, please wait for the reward to be processed',
                                'Check-in amount rule cannot be completed when amount is 0',
                                'Twitter not connected',
                                'Phone not connected or not verified',
                                'Instagram not connected',
                                'Telegram not connected',
                                'Discord not connected',
                                'Epic not connected',
                                'Email not verified',
                                'GitHub not connected',
                                'Youtube not connected',
                                'Reddit not connected',
                                'Comment link is required',
                                'TikTok not connected',
                                'Twitter not connected or content url is required',
                                'Steam not connected',
                                'Email not connected or not verified',
                                'No choice selected',
                                'Question not found',
                                'Invalid choice selected',
                                'Claim on token hold is not supported for Sui',
                                'Claim on token hold is not supported for paid full royalty or native purchases',
                                'Claim on token hold is only supported for multipliers',
                                'Rule is not setup',
                                'Quest not achieved, please try again.',
                                'Invalid request'
                                
                required:
                  - message
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Unauthorized
                      - Invalid token
                required:
                  - message
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Failed to claim, limit reached for the website
                      - >-
                        The rewards program is temporarily paused, so claiming
                        is currently unavailable. Please try again later.
                required:
                  - message
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Loyalty rule not found
                      - Loyalty currency not found
                      - User not found
                required:
                  - message
        '429':
          description: '429'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Too many requests
                required:
                  - message
                title: Too Many Request Response
                description: Schema for too many request response
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - An error occurred while verifying the link click
                      - Internal server error
                required:
                  - message
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````