OpenZeppelin Relayers API

Relayers are the core components of the OpenZeppelin Relayer API. They are responsible for executing transactions on behalf of users and providing a secure and reliable way to interact with the blockchain.

OpenAPI Specification

openzeppelin-relayers-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpenZeppelin Relayer Health Relayers API
  description: OpenZeppelin Relayer API
  termsOfService: https://www.openzeppelin.com/tos
  contact:
    name: OpenZeppelin
    url: https://www.openzeppelin.com
  license:
    name: AGPL-3.0 license
    url: https://github.com/OpenZeppelin/openzeppelin-relayer/blob/main/LICENSE
  version: 1.5.0
tags:
- name: Relayers
  description: Relayers are the core components of the OpenZeppelin Relayer API. They are responsible for executing transactions on behalf of users and providing a secure and reliable way to interact with the blockchain.
paths:
  /api/v1/relayers:
    get:
      tags:
      - Relayers
      summary: Relayer routes implementation
      description: 'Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file


        Lists all relayers with pagination support.'
      operationId: listRelayers
      parameters:
      - name: page
        in: query
        description: Page number for pagination (starts at 1)
        required: false
        schema:
          type: integer
          minimum: 0
      - name: per_page
        in: query
        description: 'Number of items per page (default: 10)'
        required: false
        schema:
          type: integer
          minimum: 0
      responses:
        '200':
          description: Relayer list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_Vec_RelayerResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
    post:
      tags:
      - Relayers
      summary: Creates a new relayer.
      operationId: createRelayer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRelayerRequest'
        required: true
      responses:
        '201':
          description: Relayer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_RelayerResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '409':
          description: Relayer with this ID already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with this ID already exists
                success: false
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}:
    get:
      tags:
      - Relayers
      summary: Retrieves details of a specific relayer by ID.
      operationId: getRelayer
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Relayer details retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_RelayerResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
    delete:
      tags:
      - Relayers
      summary: Deletes a relayer by ID.
      operationId: deleteRelayer
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Relayer deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
        '400':
          description: Bad Request - Cannot delete relayer with active transactions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Cannot delete relayer 'relayer_id' because it has N transaction(s). Please wait for all transactions to complete or cancel them before deleting the relayer.
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
    patch:
      tags:
      - Relayers
      summary: Updates a relayer's information based on the provided update request.
      operationId: updateRelayer
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRelayerRequest'
        required: true
      responses:
        '200':
          description: Relayer updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_RelayerResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/balance:
    get:
      tags:
      - Relayers
      summary: Retrieves the balance of a specific relayer.
      operationId: getRelayerBalance
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Relayer balance retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_BalanceResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/rpc:
    post:
      tags:
      - Relayers
      summary: Performs a JSON-RPC call using the specified relayer.
      operationId: rpc
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      requestBody:
        description: JSON-RPC request with method and parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest_NetworkRpcRequest'
            example:
              id: 1
              jsonrpc: '2.0'
              method: feeEstimate
              params:
                fee_token: SOL
                network: solana
                transaction: base64_encoded_transaction
        required: true
      responses:
        '200':
          description: RPC method executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponse_NetworkRpcResult'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/sign:
    post:
      tags:
      - Relayers
      summary: Signs data using the specified relayer.
      operationId: sign
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignDataRequest'
        required: true
      responses:
        '200':
          description: Relayer signed data successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_SignDataResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/sign-transaction:
    post:
      tags:
      - Relayers
      summary: Signs a transaction using the specified relayer (Stellar only).
      operationId: signTransaction
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignTransactionRequest'
        required: true
      responses:
        '200':
          description: Transaction signed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_SignTransactionResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/sign-typed-data:
    post:
      tags:
      - Relayers
      summary: Signs typed data using the specified relayer.
      operationId: signTypedData
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignTypedDataRequest'
        required: true
      responses:
        '200':
          description: Relayer signed typed data successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_SignDataResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/status:
    get:
      tags:
      - Relayers
      summary: Fetches the current status of a specific relayer.
      operationId: getRelayerStatus
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Relayer status retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_RelayerStatus'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/transactions:
    post:
      tags:
      - Relayers
      summary: Sends a transaction through the specified relayer.
      operationId: sendTransaction
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NetworkTransactionRequest'
        required: true
      responses:
        '200':
          description: Relayer transactions sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_TransactionResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/transactions/:
    get:
      tags:
      - Relayers
      summary: Lists all transactions for a specific relayer with pagination.
      operationId: listTransactions
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      - name: page
        in: query
        description: Page number for pagination (starts at 1)
        required: false
        schema:
          type: integer
          minimum: 0
      - name: per_page
        in: query
        description: 'Number of items per page (default: 10)'
        required: false
        schema:
          type: integer
          minimum: 0
      responses:
        '200':
          description: Relayer transactions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_Vec_TransactionResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Relayer with ID relayer_id not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      security:
      - bearer_auth: []
  /api/v1/relayers/{relayer_id}/transactions/by-nonce/{nonce}:
    get:
      tags:
      - Relayers
      summary: Retrieves a transaction by its nonce value.
      operationId: getTransactionByNonce
      parameters:
      - name: relayer_id
        in: path
        description: The unique identifier of the relayer
        required: true
        schema:
          type: string
      - name: nonce
        in: path
        description: The nonce of the transaction
        required: true
        schema:
          type: integer
          minimum: 0
      responses:
        '200':
          description: Relayer transaction retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_TransactionResponse'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Bad Request
                success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Unauthorized
                success: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Not found
                success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Too Many Requests
                success: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
              example:
                data: null
                message: Internal Server Error
                success: false
      

# --- truncated at 32 KB (114 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/openzeppelin/refs/heads/main/openapi/openzeppelin-relayers-api-openapi.yml