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

# Reward Badge

> Trigger Reward Badge

<ResponseExample>
  ```json 200 theme={null}
  {
      "status": "success",
      "unsignedTransaction": {
          "to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
          "data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
          "maxPriorityFeePerGas": "30000000000",
          "maxFeePerGas": "30000000015",
          "gasLimit": "95935",
          "nonce": 2484,
          "chainId": 80001,
          "type": 2
      }
  }
  ```

  ```json 400 theme={null}
  {
    "status": "failed",
    "error": "Too many badges for that name",
    "badges": [
      {
        "id": "0xda4074b4b844e035a59a881db4a9f43cf66c88be",
        "name": "Level 3"
      },
      {
        "id": "0xa414cf3e0faa0c0a828cadc3f70ca847ecdac088",
        "name": "Level 2"
      },
      {
        "id": "0x5b45310aec022a8b83c2b302a59369d8626ef5ec",
        "name": "Level 1"
      }
    ]
  }

  ```

  ```JSON 404 theme={null}
  {
    "status": "failed",
    "error": "No badge found"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml post /reward/badge
openapi: 3.0.0
info:
  version: 0.1.0
  title: Openformat API
servers:
  - url: https://api.openformat.tech/v1
    description: Live server
security:
  - ApiKeyAuth: []
paths:
  /reward/badge:
    post:
      tags:
        - Triggers
        - Reward Badge
      description: Trigger Reward Badge
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                chain:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Blockchain network to use
                  example: arbitrum-sepolia
                action_id:
                  type: string
                  minLength: 1
                  maxLength: 32
                  description: Action Id
                  example: dragon_slayed
                receiver:
                  type: string
                  pattern: ^(0x)?[0-9a-fA-F]{40}$
                  description: Ethereum addres of the receiver
                  example: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
                app_id:
                  type: string
                  pattern: ^(0x)?[0-9a-fA-F]{40}$
                  description: Ethereum address of the application
                  example: '0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a'
                amount:
                  type: integer
                  minimum: 1
                  description: Amount of badges to reward
                  example: 123
                badge_name:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: Name of badge to reward, specify this or the badge_id
                  example: Valiant warrior
                base_uri:
                  type: string
                  maxLength: 512
                  description: URI of badge to reward
                  example: ipfs://abc...
                badge_id:
                  type: string
                  pattern: ^(0x)?[0-9a-fA-F]{40}$
                  description: >-
                    Ethereum address of badge to reward, specify this or badge
                    name
                  example: '0xd1f09c70f6f2838a3ab6209c1465af68594667ec'
              required:
                - chain
                - action_id
                - receiver
                - app_id
                - amount
      responses:
        '200':
          description: Rewards Badge
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                    description: Success response status
                    example: success
                  unsignedTransaction:
                    nullable: true
                    description: Unsigned transaction object for the user to sign
                required:
                  - status
        '400':
          description: Bad request or search returned multiple badges
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - failed
                    description: Failed reponse status
                    example: failed
                  error:
                    type: string
                    description: Error message
                    example: Too many badges for that name
                  badges:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Badge 's Ethereum address
                          example: '0xd1f09c70f6f2838a3ab6209c1465af68594667ec'
                        name:
                          type: string
                          description: Badge name
                          example: Valian warrior
                      required:
                        - id
                        - name
                      description: Badge candidate
                    description: >-
                      If badge search returns many badges, this is the list of
                      badge candidates
                required:
                  - status
                  - error
        '404':
          description: No badge found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - failed
                    description: Failed reponse status
                    example: failed
                  error:
                    type: string
                    description: Error message
                    example: No badge found
                required:
                  - status
                  - error
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````