Aptos Transactions API

Access to transactions

OpenAPI Specification

aptos-transactions-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Aptos Node Accounts Transactions API
  description: The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
  version: 1.2.0
  contact:
    name: Aptos Labs
    url: https://github.com/aptos-labs/aptos-core
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: /v1
tags:
- name: Transactions
  description: Access to transactions
paths:
  /transactions:
    get:
      tags:
      - Transactions
      summary: Get transactions
      description: 'Retrieve on-chain committed transactions. The page size and start ledger version

        can be provided to get a specific sequence of transactions.


        If the version has been pruned, then a 410 will be returned.


        To retrieve a pending transaction, use /transactions/by_hash.'
      parameters:
      - name: start
        schema:
          $ref: '#/components/schemas/U64'
        in: query
        description: 'Ledger version to start list of transactions


          If not provided, defaults to showing the latest transactions'
        required: false
        deprecated: false
        explode: true
      - name: limit
        schema:
          type: integer
          format: uint16
        in: query
        description: 'Max number of transactions to retrieve.


          If not provided, defaults to default page size'
        required: false
        deprecated: false
        explode: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Transaction'
            application/x-bcs:
              schema:
                type: array
                items:
                  type: integer
                  format: uint8
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-CURSOR:
              description: 'Cursor to be used for endpoints that support cursor-based

                pagination. Pass this to the `start` field of the endpoint

                on the next call to get the next page of results.'
              deprecated: false
              schema:
                type: string
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '410':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '503':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
      operationId: get_transactions
    post:
      tags:
      - Transactions
      summary: Submit transaction
      description: 'This endpoint accepts transaction submissions in two formats.


        To submit a transaction as JSON, you must submit a SubmitTransactionRequest.

        To build this request, do the following:


        1. Encode the transaction as BCS. If you are using a language that has

        native BCS support, make sure of that library. If not, you may take

        advantage of /transactions/encode_submission. When using this

        endpoint, make sure you trust the node you''re talking to, as it is

        possible they could manipulate your request.

        2. Sign the encoded transaction and use it to create a TransactionSignature.

        3. Submit the request. Make sure to use the "application/json" Content-Type.


        To submit a transaction as BCS, you must submit a SignedTransaction

        encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.

        Make sure to use the `application/x.aptos.signed_transaction+bcs` Content-Type.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitTransactionRequest'
          application/x.aptos.signed_transaction+bcs:
            schema:
              type: array
              items:
                type: integer
                format: uint8
        required: true
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendingTransaction'
            application/x-bcs:
              schema:
                type: array
                items:
                  type: integer
                  format: uint8
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              required: true
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-CURSOR:
              description: 'Cursor to be used for endpoints that support cursor-based

                pagination. Pass this to the `start` field of the endpoint

                on the next call to get the next page of results.'
              deprecated: false
              schema:
                type: string
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '413':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Current epoch of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-BLOCK-HEIGHT:
              description: Current block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-OLDEST-BLOCK-HEIGHT:
              description: Oldest non-pruned block height of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-GAS-USED:
              description: The cost of the call in terms of gas
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-TXN-ENCRYPTION-KEY:
              description: Per-epoch transaction encryption key (hex-encoded)
              deprecated: false
              schema:
                type: string
        '503':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AptosError'
          headers:
            X-APTOS-CHAIN-ID:
              description: Chain ID of the current chain
              deprecated: false
              schema:
                type: integer
                format: uint8
            X-APTOS-LEDGER-VERSION:
              description: Current ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-OLDEST-VERSION:
              description: Oldest non-pruned ledger version of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-LEDGER-TIMESTAMPUSEC:
              description: Current timestamp of the chain
              deprecated: false
              schema:
                type: integer
                format: uint64
            X-APTOS-EPOCH:
              description: Cur

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