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

> ⚠️ **DEPRECATED**: This endpoint has been deprecated and replaced by the [Reward Point](/api-reference/endpoint/triggers/post-rewardpoint) endpoint. Please use the Reward Point endpoint for all new implementations.

Award XP (Experience Points) to users for completing specific actions in your application. This endpoint is designed to gamify user engagement by rewarding XP for various activities such as:

- User registration
- Task completion
- Video watching
- Comment posting
- Other custom actions

The endpoint returns an [unsigned transaction](/api-reference/architecture/transaction-lifecycle) that needs to be signed using your application's private key (stored securely in server environment variables). After signing, you can broadcast the transaction using either:

- [Execute Transaction](/api-reference/endpoint/transactions/post-transactionsexecute) endpoint for immediate submission
- [Execute Transaction and Wait](/api-reference/endpoint/transactions/post-transactionsexecuteandwait) endpoint if you need to wait for transaction confirmation

This XP system helps create an engaging progression system while maintaining transparency through blockchain-based XP distribution.


<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}
  {
    "success": false,
    "error": {
      "issues": [
        {
          "code": "invalid_type",
          "expected": "string",
          "received": "undefined",
          "path": ["action_id"],
          "message": "Required"
        },
        {
          "code": "invalid_type",
          "expected": "string",
          "received": "undefined",
          "path": ["receiver"],
          "message": "Required"
        }
      ],
      "name": "ZodError"
    }
  }
  ```

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


## OpenAPI

````yaml post /reward/XP
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/XP:
    post:
      tags:
        - Triggers
        - XP
      description: Trigger XP
      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: number
                  minimum: 0
                  exclusiveMinimum: true
                  description: Amount of tokens to reward
                  example: 123
              required:
                - chain
                - action_id
                - receiver
                - app_id
                - amount
      responses:
        '200':
          description: Rewards XP
          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
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      issues:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                              description: Error code for the field
                              example: invalid_type
                            path:
                              type: array
                              items:
                                type: string
                              description: Field with error
                              example:
                                - some_field
                            message:
                              type: string
                              description: Error message
                              example: Required
                          required:
                            - code
                            - path
                            - message
                        description: Error object with all validation issues
                    required:
                      - issues
                required:
                  - error
        '404':
          description: XP token not 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 Token found
                required:
                  - status
                  - error
      deprecated: true
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````