openapi: 3.0.0 info: version: 1.0.0 title: Access Accounts Transactions API servers: - url: https://rest-testnet.onflow.org/v1 description: Flow Testnet - url: https://rest-mainnet.onflow.org/v1 description: Flow Mainnet tags: - name: Transactions paths: /transactions/{id}: get: summary: Get a Transaction by ID. description: Get a transaction data by the provided transaction ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract. tags: - Transactions parameters: - description: A transaction identifier. This may be a 64-character hex-encoded transaction ID (e.g. `a1b2c3...`) or a uint64 scheduled transaction ID returned by the system contract. name: id in: path schema: type: string required: true - $ref: '#/components/parameters/blockIdParam' - $ref: '#/components/parameters/collectionIdParam' - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /transaction_results: get: summary: Get Transaction Results by block description: Retrieve a list of transaction results for a specific block. This includes results for submitted, system, and scheduled transactions. tags: - Transactions parameters: - name: block_id in: query required: false description: The ID of the block containing the transactions. The request may include either `block_id` or `block_height`, but not both. schema: $ref: '#/components/schemas/Identifier' - name: block_height in: query required: false description: The height of the block containing the transactions. The request may include either `block_id` or `block_height`, but not both. schema: $ref: '#/components/schemas/BlockHeight' - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' - $ref: '#/components/parameters/agreeingExecutorsCount' - $ref: '#/components/parameters/requiredExecutorIds' - $ref: '#/components/parameters/includeExecutorMetadata' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/TransactionResult' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /transaction_results/{transaction_id}: get: summary: Get a Transaction Result by transaction ID or scheduled transaction ID. description: Get transaction result by the transaction's ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract. tags: - Transactions parameters: - description: A transaction identifier. This may be a 64-character hex-encoded transaction ID (e.g. `a1b2c3...`) or a uint64 scheduled transaction ID returned by the system contract. name: transaction_id in: path schema: type: string required: true - $ref: '#/components/parameters/blockIdParam' - $ref: '#/components/parameters/collectionIdParam' - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' - $ref: '#/components/parameters/agreeingExecutorsCount' - $ref: '#/components/parameters/requiredExecutorIds' - $ref: '#/components/parameters/includeExecutorMetadata' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/TransactionResult' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /transactions: get: summary: Get Transactions by block description: Retrieve a list of transactions for a specific block. This includes submitted, system, and scheduled transactions. tags: - Transactions parameters: - name: block_id in: query required: false description: The ID of the block containing the transactions. The request may include either `block_id` or `block_height`, but not both. schema: $ref: '#/components/schemas/Identifier' - name: block_height in: query required: false description: The height of the block containing the transactions. The request may include either `block_id` or `block_height`, but not both. schema: $ref: '#/components/schemas/BlockHeight' - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' post: summary: Submit a Transaction description: Send a new signed transaction payload to the network with [required transaction fields](https://docs.onflow.org/flow-go-sdk/#transactions). tags: - Transactions requestBody: description: The transaction to submit. required: true content: application/json: schema: type: object required: - script - arguments - reference_block_id - gas_limit - payer - proposal_key - authorizers - payload_signatures - envelope_signatures properties: script: type: string format: base64 description: Base64 encoded content of the Cadence script. arguments: type: array description: A list of arguments each encoded as Base64 passed in the [JSON-Cadence interchange format](https://docs.onflow.org/cadence/json-cadence-spec/). items: type: string format: base64 reference_block_id: $ref: '#/components/schemas/Identifier' gas_limit: type: string format: uint64 description: The limit on the amount of computation a transaction is allowed to preform. payer: $ref: '#/components/schemas/Address' proposal_key: $ref: '#/components/schemas/ProposalKey' authorizers: type: array items: $ref: '#/components/schemas/Address' payload_signatures: type: array description: A list of Base64 encoded signatures. items: $ref: '#/components/schemas/TransactionSignature' envelope_signatures: type: array description: A list of Base64 encoded signatures. items: $ref: '#/components/schemas/TransactionSignature' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/Transaction' headers: Location: schema: type: string format: uri description: The URI to the newly submitted transaction. '400': $ref: '#/components/responses/400BadRequest' '500': $ref: '#/components/responses/500InternalServerError' components: schemas: BlockHeight: oneOf: - type: string format: uint64 - type: string enum: - final - sealed TransactionStatus: type: string description: This value indicates the state of the transaction execution. Only sealed and expired are final and immutable states. enum: - Pending - Finalized - Executed - Sealed - Expired Links: type: object properties: _self: type: string EventType: description: The qualified event type. type: string ProposalKey: type: object required: - address - key_index - sequence_number properties: address: $ref: '#/components/schemas/Address' key_index: type: string format: uint64 sequence_number: type: string format: uint64 TransactionResult: type: object required: - block_id - collection_id - status - status_code - error_message - computation_used - events properties: block_id: $ref: '#/components/schemas/Identifier' collection_id: $ref: '#/components/schemas/Identifier' execution: $ref: '#/components/schemas/TransactionExecution' status: $ref: '#/components/schemas/TransactionStatus' status_code: type: integer error_message: type: string description: Provided transaction error in case the transaction wasn't successful. computation_used: type: string format: uint64 events: type: array items: $ref: '#/components/schemas/Event' metadata: $ref: '#/components/schemas/Metadata' _links: $ref: '#/components/schemas/Links' Metadata: description: Contains data about the node's state at the time of the request. type: object properties: executor_metadata: $ref: '#/components/schemas/ExecutorMetadata' Transaction: type: object required: - id - script - arguments - reference_block_id - gas_limit - payer - proposal_key - authorizers - payload_signatures - envelope_signatures - _expandable properties: id: $ref: '#/components/schemas/Identifier' script: type: string format: base64 description: Base64 encoded Cadence script. arguments: type: array description: Array of Base64 encoded arguments with in [JSON-Cadence interchange format](https://docs.onflow.org/cadence/json-cadence-spec/). items: type: string format: byte reference_block_id: $ref: '#/components/schemas/Identifier' gas_limit: type: string format: uint64 description: The limit on the amount of computation a transaction is allowed to preform. payer: $ref: '#/components/schemas/Address' proposal_key: $ref: '#/components/schemas/ProposalKey' authorizers: type: array items: $ref: '#/components/schemas/Address' payload_signatures: type: array items: $ref: '#/components/schemas/TransactionSignature' envelope_signatures: type: array items: $ref: '#/components/schemas/TransactionSignature' result: $ref: '#/components/schemas/TransactionResult' _expandable: type: object properties: result: type: string format: uri _links: $ref: '#/components/schemas/Links' Signature: description: A variable length signature. type: string format: byte ExecutorMetadata: type: object description: Contains data about the execution result used to serve the request. properties: execution_result_id: $ref: '#/components/schemas/Identifier' executor_ids: type: array items: $ref: '#/components/schemas/Identifier' Event: type: object required: - type - transaction_id - transaction_index - event_index - payload properties: type: $ref: '#/components/schemas/EventType' transaction_id: $ref: '#/components/schemas/Identifier' transaction_index: type: string format: uint64 event_index: type: string format: uint64 payload: type: string format: byte TransactionSignature: description: Base64 encoded signature. type: object required: - address - key_index - signature properties: address: $ref: '#/components/schemas/Address' key_index: type: string format: uint64 signature: $ref: '#/components/schemas/Signature' TransactionExecution: type: string description: This value indicates whether the transaction execution succeded or not, this value should be checked when determining transaction success. enum: - Pending - Success - Failure Address: description: The 8-byte address of an account. type: string format: hexadecimal pattern: '[a-fA-F0-9]{16}' Identifier: description: A 32-byte unique identifier for an entity. type: string format: hexadecimal pattern: '[a-fA-F0-9]{64}' Error: type: object properties: code: type: integer message: type: string parameters: collectionIdParam: description: A collection ID optional parameter. name: collection_id in: query schema: $ref: '#/components/schemas/Identifier' required: false blockIdParam: description: A block ID optional parameter name: block_id in: query schema: $ref: '#/components/schemas/Identifier' required: false selectParam: description: A comma-separated list indicating which properties of the content to return. name: select in: query schema: type: array items: type: string minItems: 1 uniqueItems: true explode: false style: form required: false requiredExecutorIds: description: A set of execution node IDs, one of which must have produced the execution result. name: required_executor_ids in: query schema: type: array items: $ref: '#/components/schemas/Identifier' minItems: 1 uniqueItems: true explode: false style: form required: false includeExecutorMetadata: description: Specifies whether or not to include the executor metadata in the response. name: include_executor_metadata in: query allowEmptyValue: false schema: type: boolean required: false agreeingExecutorsCount: description: A minimum number of execution receipts for the execution result. name: agreeing_executors_count in: query allowEmptyValue: false schema: type: string format: uint64 required: false expandParam: description: A comma-separated list indicating which properties of the content to expand. name: expand in: query schema: type: array items: type: string minItems: 1 uniqueItems: true explode: false style: form required: false responses: 500InternalServerError: description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Error' 400BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' 404NotFound: description: Not Found content: application/json: schema: $ref: '#/components/schemas/Error' externalDocs: description: Find out more about the Access API url: https://docs.onflow.org/access-api/