> ## 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.

# Delete badge (by id)

> This endpoint allows you to delete a badge.



## OpenAPI

````yaml /api-reference/openapi.documented.json delete /api/loyalty/badges/{id}
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/badges/{id}:
    delete:
      tags:
        - Badge
      summary: Delete badge (by id)
      description: This endpoint allows you to delete a badge.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Badge ID
            example: 123e4567-e89b-12d3-a456-426614174333
          description: UUID of the badge to delete (converted to lowercase)
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    title: Badge ID
                    description: UUID of the badge (converted to lowercase)
                    example: 123e4567-e89b-12d3-a456-426614174333
                  name:
                    type: string
                    title: Badge Name
                    description: The name of the badge
                    example: Example Badge
                  description:
                    type: string
                    nullable: true
                    title: Badge Description
                    description: The description of the badge
                    example: Example description
                  imageUrl:
                    type: string
                    format: uri
                    nullable: true
                    title: Image URL
                    description: The URL of the badge image
                    example: https://example.com/image.png
                  hideInUi:
                    default: false
                    type: boolean
                    title: Hide in UI
                    description: Whether to hide this badge in the user interface
                    example: false
                  loyaltyConditions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          title: Condition ID
                          description: UUID of the condition (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174333
                        type:
                          type: string
                          enum:
                            - rule
                            - rules
                            - points
                            - section
                            - level
                            - api
                            - badge
                            - badges
                            - csv
                          title: Condition Type
                          description: The type of the condition
                          example: rule
                        description:
                          type: string
                          nullable: true
                          title: Condition description
                          description: The description of the condition
                          example: Example description
                        amount:
                          type: number
                          nullable: true
                          title: Amount
                          description: The amount of the condition
                          example: 10
                        repeatCount:
                          type: number
                          nullable: true
                          title: Repeat Count
                          description: The repeat count of the condition
                          example: 5
                        requiredCount:
                          type: number
                          nullable: true
                          title: Required Count
                          description: The required count of the condition
                          example: 5
                        loyaltyRuleGroupId:
                          type: string
                          format: uuid
                          nullable: true
                          title: Rule Group ID
                          description: UUID of the rule group (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174333
                        association:
                          type: array
                          items:
                            type: object
                            properties:
                              loyaltyRule:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    title: Association ID
                                    description: >-
                                      UUID of the association (converted to
                                      lowercase)
                                  name:
                                    type: string
                                    title: Association Name
                                    description: The name of the association
                                required:
                                  - id
                                  - name
                                nullable: true
                              loyaltyBadge:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    title: Association ID
                                    description: >-
                                      UUID of the association (converted to
                                      lowercase)
                                  name:
                                    type: string
                                    title: Association Name
                                    description: The name of the association
                                required:
                                  - id
                                  - name
                                nullable: true
                              loyaltyRuleGroup:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    title: Association ID
                                    description: >-
                                      UUID of the association (converted to
                                      lowercase)
                                  name:
                                    type: string
                                    title: Association Name
                                    description: The name of the association
                                required:
                                  - id
                                  - name
                                nullable: true
                              loyaltyCurrency:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    title: Association ID
                                    description: >-
                                      UUID of the association (converted to
                                      lowercase)
                                  name:
                                    type: string
                                    title: Association Name
                                    description: The name of the association
                                required:
                                  - id
                                  - name
                                nullable: true
                              loyaltyLeaderboardView:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    title: Association ID
                                    description: >-
                                      UUID of the association (converted to
                                      lowercase)
                                  name:
                                    type: string
                                    title: Association Name
                                    description: The name of the association
                                required:
                                  - id
                                  - name
                                nullable: true
                            required:
                              - loyaltyRule
                              - loyaltyBadge
                              - loyaltyRuleGroup
                              - loyaltyCurrency
                              - loyaltyLeaderboardView
                        loyaltyCurrencyId:
                          type: string
                          format: uuid
                          nullable: true
                          title: Currency ID
                          description: UUID of the currency (converted to lowercase)
                        csvUrl:
                          type: string
                          format: uri
                          nullable: true
                          title: CSV URL
                          description: URL of the CSV file
                          example: https://example.com/csv
                        csvFiles:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                title: CSV File ID
                                description: UUID of the CSV file (converted to lowercase)
                                example: 123e4567-e89b-12d3-a456-426614174333
                              url:
                                type: string
                                format: uri
                                nullable: true
                                title: CSV File URL
                                description: The URL of the CSV file
                                example: https://example.com/file.csv
                              name:
                                type: string
                                nullable: true
                                title: CSV File Name
                                description: The name of the CSV file
                                example: file.csv
                              description:
                                type: string
                                nullable: true
                                title: CSV File Description
                                description: The description of the CSV file
                                example: Example description
                            required:
                              - id
                              - url
                              - name
                              - description
                          title: CSV Files
                          description: Array of CSV files associated with the condition
                      required:
                        - id
                        - type
                        - description
                        - amount
                        - repeatCount
                        - requiredCount
                        - loyaltyRuleGroupId
                        - association
                        - loyaltyCurrencyId
                        - csvUrl
                      title: Loyalty Condition Schema
                      description: Schema for a loyalty condition rule.
                    title: Conditions
                    description: Array of conditions of the badge
                  rewards:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          title: Reward ID
                          description: UUID of the badge reward
                          example: 123e4567-e89b-12d3-a456-426614174333
                        rewardType:
                          type: string
                          enum:
                            - points
                            - multiplier
                            - badge
                            - token
                          title: Reward Type
                          description: Type of reward (points or multiplier)
                          example: points
                        loyaltyCurrencyId:
                          type: string
                          format: uuid
                          nullable: true
                          title: Loyalty Currency ID
                          description: UUID of the loyalty currency for this reward
                          example: 123e4567-e89b-12d3-a456-426614174333
                        loyaltyCurrencyIds:
                          type: array
                          items:
                            type: string
                            format: uuid
                          title: Loyalty Currency IDs
                          description: >-
                            Array of loyalty currency IDs for multiplier rewards
                            (empty means all currencies)
                          example:
                            - 123e4567-e89b-12d3-a456-426614174333
                        amount:
                          type: number
                          nullable: true
                          title: Reward Amount
                          description: Points amount to reward (for points reward type)
                          example: 100
                        multiplier:
                          type: number
                          nullable: true
                          title: Reward Multiplier
                          description: Multiplier to reward (for multiplier reward type)
                          example: 2.5
                        isRetroactive:
                          type: boolean
                          title: Is Retroactive
                          description: >-
                            Whether the multiplier should be applied to the
                            user's existing balance
                          example: false
                      required:
                        - id
                        - rewardType
                        - loyaltyCurrencyId
                        - amount
                        - multiplier
                        - isRetroactive
                    title: Rewards
                    description: Array of rewards granted when the badge is achieved
                  loyaltyBadgeUsers:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          title: User Badge ID
                          description: UUID of the user badge (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174333
                        userId:
                          type: string
                          format: uuid
                          title: User ID
                          description: UUID of the user (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174222
                        websiteId:
                          type: string
                          format: uuid
                          title: Website ID
                          description: UUID of the website (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174111
                        organizationId:
                          type: string
                          format: uuid
                          title: Organization ID
                          description: UUID of the organization (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174222
                        hideInUi:
                          default: false
                          type: boolean
                          title: Hide in UI
                          description: Whether to hide this badge in the user interface
                          example: false
                        status:
                          type: string
                          enum:
                            - active
                            - inactive
                            - revoked
                          title: Status
                          description: The status of the badge
                          example: active
                        loyaltyBadgeId:
                          type: string
                          format: uuid
                          title: Badge ID
                          description: UUID of the badge (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174333
                        progress:
                          nullable: true
                          title: Progress
                          description: Array of progress for the badge
                        dismissedInUi:
                          type: boolean
                          title: Dismissed In UI
                          description: Whether the user has dismissed the badge in the UI
                          example: false
                        user:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              title: User ID
                              description: UUID of the user (converted to lowercase)
                              example: 123e4567-e89b-12d3-a456-426614174222
                            walletAddress:
                              type: string
                              title: Wallet Address
                              description: Wallet address of the user
                              example: '0x1234567890abcdef1234567890abcdef12345678'
                          required:
                            - id
                            - walletAddress
                          title: User
                          description: User associated with the user badge
                        createdAt:
                          type: string
                          format: date-time
                          title: Created At
                          description: The date and time the user badge was created
                          example: '2021-01-01T00:00:00.000Z'
                        completedAt:
                          type: string
                          format: date-time
                          nullable: true
                          title: Completed At
                          description: The date and time the user badge was granted
                          example: '2021-01-01T00:00:00.000Z'
                        updatedAt:
                          type: string
                          format: date-time
                          title: Updated At
                          description: The date and time the user badge was updated
                          example: '2021-01-01T00:00:00.000Z'
                      required:
                        - id
                        - userId
                        - websiteId
                        - organizationId
                        - status
                        - loyaltyBadgeId
                        - createdAt
                        - updatedAt
                    title: User Badges
                    description: Array of user badges
                  loyaltyRules:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          title: Loyalty Rule ID
                          description: UUID of the loyalty rule (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174333
                        name:
                          type: string
                          title: Loyalty Rule Name
                          description: The name of the loyalty rule
                          example: Example Rule
                      required:
                        - id
                        - name
                    title: Loyalty Rules
                    description: Array of loyalty rules associated with the badge
                  dataJobs:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          title: Data Job ID
                          description: UUID of the data job (converted to lowercase)
                          example: 123e4567-e89b-12d3-a456-426614174333
                        status:
                          type: string
                          enum:
                            - pending
                            - processing
                            - complete
                            - failed
                            - cancelled
                          title: Data Job Status
                          description: The status of the data job
                          example: pending
                        message:
                          type: string
                          nullable: true
                          title: Data Job Message
                          description: The message associated with the data job
                          example: Data job is pending
                        createdAt:
                          type: string
                          format: date-time
                          title: Data Job Created At
                          description: The date and time the data job was created
                          example: '2021-01-01T00:00:00.000Z'
                        updatedAt:
                          type: string
                          format: date-time
                          title: Data Job Updated At
                          description: The date and time the data job was updated
                          example: '2021-01-01T00:00:00.000Z'
                      required:
                        - id
                        - status
                        - createdAt
                        - updatedAt
                    title: Data Jobs
                    description: Array of data jobs associated with the badge
                  createdAt:
                    type: string
                    format: date-time
                    title: Badge Created At
                    description: The date and time the badge was created
                    example: '2021-01-01T00:00:00.000Z'
                  updatedAt:
                    type: string
                    format: date-time
                    title: Badge Updated At
                    description: The date and time the badge was updated
                    example: '2021-01-01T00:00:00.000Z'
                required:
                  - id
                  - name
                  - description
                  - imageUrl
                  - loyaltyConditions
                  - createdAt
                  - updatedAt
                title: Delete Badge Success Response
                description: Response returned upon successful deletion of the badge.
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Forbidden, Could not validate api key
                required:
                  - message
                title: Forbidden Response
                description: Schema for forbidden response
                example: Forbidden, Could not validate api key
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Not found
                required:
                  - message
                title: Not Found Response
                description: Schema for not found response
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    title: Success
                    description: Indicates operation success
                    example: false
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Internal server error
                  debugInfo:
                    type: string
                    title: Debug Info
                    description: Optional debug information
                    example: Stack trace or additional error details
                required:
                  - success
                  - message
                title: Internal Server Error Response
                description: Schema for internal server error response
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````