Polkadot pallets API

Runtime pallet metadata, storage, constants, events, errors

OpenAPI Specification

polkadot-pallets-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Polkadot REST Account pallets API
  description: High-performance Rust REST API for Substrate/Polkadot blockchain data. Drop-in replacement for substrate-api-sidecar.
  contact:
    url: https://github.com/paritytech/polkadot-rest-api
  license:
    name: GPL-3.0-or-later
  version: 0.1.3
servers:
- url: http://localhost:8080/v1
  description: Localhost
tags:
- name: pallets
  description: Runtime pallet metadata, storage, constants, events, errors
paths:
  /v1/pallets/asset-conversion/liquidity-pools:
    get:
      tags:
      - pallets
      summary: Liquidity pools
      description: Returns all liquidity pools from the AssetConversion pallet.
      operationId: get_liquidity_pools
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Liquidity pools
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/asset-conversion/next-available-id:
    get:
      tags:
      - pallets
      summary: Next available pool ID
      description: Returns the next available pool asset ID from the AssetConversion pallet.
      operationId: get_next_available_id
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Next available ID
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/assets/{assetId}/asset-info:
    get:
      tags:
      - pallets
      summary: Asset info
      description: Returns details for a specific asset including supply, admin, and metadata.
      operationId: pallets_assets_asset_info
      parameters:
      - name: assetId
        in: path
        description: Asset ID
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Asset information
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Asset not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/foreign-assets:
    get:
      tags:
      - pallets
      summary: Foreign assets
      description: Returns all foreign assets with their details and metadata. Foreign assets use XCM MultiLocation as their identifier.
      operationId: pallets_foreign_assets
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Foreign assets list
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Not supported on this chain
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/nomination-pools/info:
    get:
      tags:
      - pallets
      summary: Nomination pools info
      description: Returns global nomination pools statistics and configuration.
      operationId: pallets_nomination_pools_info
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Nomination pools information
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Not supported on this chain
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/nomination-pools/{poolId}:
    get:
      tags:
      - pallets
      summary: Nomination pool details
      description: Returns details for a specific nomination pool.
      operationId: pallets_nomination_pools_pool
      parameters:
      - name: poolId
        in: path
        description: Pool ID
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Pool details
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Pool not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/on-going-referenda:
    get:
      tags:
      - pallets
      summary: On-going referenda
      description: Returns all currently active referenda from the Referenda pallet.
      operationId: pallets_on_going_referenda
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Active referenda
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/pool-assets/{assetId}/asset-info:
    get:
      tags:
      - pallets
      summary: Pool asset info
      description: Returns details for a specific pool asset including supply, admin, and metadata.
      operationId: pallets_pool_assets_asset_info
      parameters:
      - name: assetId
        in: path
        description: Pool asset ID
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Pool asset information
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Pool asset not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/staking/progress:
    get:
      tags:
      - pallets
      summary: Staking progress
      description: Returns staking progress including era, session info, and validator counts.
      operationId: pallets_staking_progress
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Staking progress information
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/staking/validators:
    get:
      tags:
      - pallets
      summary: Staking validators
      description: Returns the list of active validators and their info.
      operationId: pallets_staking_validators
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Validator information
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/consts:
    get:
      tags:
      - pallets
      summary: Pallet constants
      description: Returns all constants defined in a pallet.
      operationId: pallets_constants
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return constant names
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Pallet constants
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/consts/{constantItemId}:
    get:
      tags:
      - pallets
      summary: Pallet constant value
      description: Returns the value and metadata of a specific constant in a pallet.
      operationId: pallets_constant_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: constantItemId
        in: path
        description: Name of the constant
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include metadata
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Constant value
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid parameters
        '404':
          description: Constant not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/dispatchables:
    get:
      tags:
      - pallets
      summary: Pallet dispatchables
      description: Returns the dispatchable calls defined in a pallet.
      operationId: get_pallets_dispatchables
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return dispatchable names
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Pallet dispatchables
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/dispatchables/{dispatchableId}:
    get:
      tags:
      - pallets
      summary: Pallet dispatchable details
      description: Returns a single dispatchable call defined in a pallet.
      operationId: get_pallet_dispatchable_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: dispatchableId
        in: path
        description: Name of the dispatchable
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include metadata
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Dispatchable details
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Dispatchable not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/errors:
    get:
      tags:
      - pallets
      summary: Pallet errors
      description: Returns all errors defined in a pallet.
      operationId: get_pallet_errors
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return error names
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Pallet errors
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/errors/{errorItemId}:
    get:
      tags:
      - pallets
      summary: Pallet error details
      description: Returns metadata for a specific error in a pallet.
      operationId: get_pallet_error_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: errorItemId
        in: path
        description: Name of the error
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include metadata
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Error details
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Error not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/events:
    get:
      tags:
      - pallets
      summary: Get pallet events
      description: Returns all events defined in a pallet.
      operationId: get_pallet_events
      parameters:
      - name: palletId
        in: path
        description: Pallet name or index
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return event names
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Pallet events
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
        '404':
          description: Pallet not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/events/{eventItemId}:
    get:
      tags:
      - pallets
      summary: Get pallet event item
      description: Returns metadata for a specific event in a pallet.
      operationId: get_pallet_event_item
      parameters:
      - name: palletId
        in: path
        description: Pallet name or index
        required: true
        schema:
          type: string
      - name: eventItemId
        in: path
        description: Event name
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include full event metadata
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Event item details
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
        '404':
          description: Pallet or event not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/storage:
    get:
      tags:
      - pallets
      summary: Pallet storage items
      description: Returns the list of storage items for a given pallet.
      operationId: get_pallets_storage
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return storage item names
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Pallet storage items
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet or parameters
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/pallets/{palletId}/storage/{storageItemId}:
    get:
      tags:
      - pallets
      summary: Pallet storage item value
      description: Returns the value of a specific storage item in a pallet.
      operationId: get_pallets_storage_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: storageItemId
        in: path
        description: Name of the storage item
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: keys[]
        in: query
        description: Storage key arguments
        required: false
        schema:
          type: array
          items:
            type: string
      - name: metadata
        in: query
        description: Include metadata for the storage item
        required: false
        schema:
          type: boolean
      - name: useRcBlock
        in: query
        description: Treat 'at' as relay chain block identifier
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Storage item value
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid parameters
        '404':
          description: Storage item not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /pallets/assets/{assetId}/asset-info:
    get:
      tags:
      - pallets
      summary: Get information and metadata associated with an asset.
      description: Returns information associated with an asset which includes the assets `AssetDetails` and `AssetMetadata`.
      operationId: getAssetById
      parameters:
      - name: assetId
        in: path
        description: The unsignedInteger Id of an asset.
        required: true
        schema:
          type: string
          format: unsignedInteger
      - name: at
        in: query
        description: Block at which to retrieve the assetInfo.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: useRcBlock
        in: query
        description: When set to 'true', uses the relay chain block specified in the 'at' parameter to determine corresponding Asset Hub block(s) for retrieving asset info. Only supported for Asset Hub endpoints. Requires 'at' parameter to specify the relay chain block. When used, returns an array of response objects (one for each Asset Hub block found) or empty array if none found.
        required: false
        schema:
          type: boolean
          description: When set to 'true', uses relay chain block mode with the 'at' parameter.
      - name: useRcBlockFormat
        in: query
        description: Controls the response format when using 'useRcBlock=true'. When set to 'object', wraps the response in an object containing relay chain block info ('rcBlock') and the parachain data array ('parachainDataPerBlock'). When set to 'array' or omitted, returns the standard array format. Only valid when 'useRcBlock=true' is specified.
        required: false
        schema:
          type: string
          enum:
          - array
          - object
          description: Response format - 'array' (default) returns standard array, 'object' wraps response with rcBlock info.
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/PalletsAssetsInfo'
                - type: array
                  items:
                    $ref: '#/components/schemas/PalletsAssetsInfo'
                description: Returns a single object when using standard parameters. Returns an array when using 'useRcBlock' parameter (array contains one object per Asset Hub block found, or empty array if none found).
  /pallets/asset-conversion/liquidity-pools:
    get:
      tags:
      - pallets
      summary: Get information related to existing liquidity pools.
      description: Returns a list of the existing liquidity pools and its corresponding tokens at a given block height. If no block is specified, it returns the latest list available.
      parameters:
      - name: at
        in: query
        description: Block at which to retrieve the liquidity pools information.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: useRcBlock
        in: query
        description: When set to 'true', uses the relay chain block specified in the 'at' parameter to determine corresponding Asset Hub block(s) for retrieving liquidity pools info. Only supported for Asset Hub endpoints. Requires 'at' parameter to specify the relay chain block. When used, returns an array of response objects (one for each Asset Hub block found) or empty array if none found.
        required: false
        schema:
          type: boolean
          description: When set to 'true', uses relay chain block mode with the 'at' parameter.
      - name: useRcBlockFormat
        in: query
        description: Controls the response format when using 'useRcBlock=true'. When set to 'object', wraps the response in an object containing relay chain block info ('rcBlock') and the parachain data array ('parachainDataPerBlock'). When set to 'array' or omitted, returns the standard array format. Only valid when 'useRcBlock=true' is specified.
        required: false
        schema:
          type: string
          enum:
          - array
          - object
          description: Response format - 'array' (default) returns standard array, 'object' wraps response with rcBlock info.
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/LiquidityPools'
                - type: array
                  items:
                    $ref: '#/components/schemas/LiquidityPools'
                description: Returns a single object when using standard parameters. Returns an array when using 'useRcBlock' parameter (array contains one object per Asset Hub block found, or empty array if none found).
        '400':
          description: invalid blockId supplied for at query param
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /pallets/asset-conversion/next-available-id:
    get:
      tags:
      - pallets
      summary: Get the next available liquidity pool id.
      description: Returns the next available liquidity pool's id at a given block height. If no block is specified, it returns the latest list available.
      parameters:
      - name: at
        in: query
        description: Block at which to retrieve the next liquidity pool's id.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: useRcBlock
        in: query
        description: When set to 'true', uses the relay chain block specified in the 'at' parameter to determine corresponding Asset Hub block(s) for retrieving next available id. Only supported for Asset Hub endpoints. Requires 'at' parameter to specify the relay chain block. When used, returns an array of response objects (one for each Asset Hub block found) or empty array if none found.
        required: false
        schema:
          type: boolean
          description: When set to 'true', uses relay chain block mode with the 'at' parameter.
      - name: useRcBlockFormat
        in: query
        description: Controls the response format when using 'useRcBlock=true'. When set to 'object', wraps the response in an object containing relay chain block info ('rcBlock') and the parachain data array ('parachainDataPerBlock'). When set to 'array' or omitted, returns the standard array format. Only valid when 'useRcBlock=true' is specified.
        required: false
        schema:
          type: string
          enum:
          - array
          - object
          description: Response format - 'array' (default) returns standard array, 'object' wraps response with rcBlock info.
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/NextAvailableId'
                - type: array
                  items:
                    $ref: '#/components/schemas/NextAvailableId'
                description: Returns a single object when using standard parameters. Returns an array when using 'useRcBlock' parameter (array contains one object per Asset Hub block found, or empty array if none found).
        '400':
          description: invalid blockId supplied for at query param
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /pallets/foreign-assets:
    get:
      tags:
      - pallets
      summary: Get information and metadata associated with foreign assets.
      description: Returns information associated with every foreign asset which includes the assets `AssetDetails` and `AssetMetadata`.
      operationId: getForeignAssets
      parameters:
      - name: at
        in: query
        description: Block at which to retrieve the foreign assets.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: useRcBlock
        in: query
        description: When set to 'true', uses the relay chain block specified in the 'at' parameter to determine corresponding Asset Hub block(s) for retrieving foreign assets info. Only supported for Asset Hub endpoints. Requires 'at' parameter to specify the relay chain block. When used, returns an array of response objects (one for each Asset Hub block found) or empty array if none found.
        required: false
        schema:
          type: boolean
          description: When set to 'true', uses relay chain block mode with the 'at' parameter.
      - name: useRcBlockFormat
        in: query
        description: Controls the response format when using 'useRcBlock=true'. When set to 'object', wraps the response in an object containing relay chain block info ('rcBlock') and the parachain data array ('parachainDataPerBlock'). When set to 'array' or omitted, returns the standard array format. Only valid wh

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