openapi: "3.0.0" info: version: "1.0.0" title: "Access API" servers: - url: https://rest-canary.onflow.org/v1/ description: Flow Canary - url: https://rest-testnet.onflow.org/v1 description: Flow Testnet - url: https://rest-mainnet.onflow.org/v1 description: Flow Mainnet paths: /blocks: get: summary: Gets Blocks by Height description: Get block data by the provided height range or list of heights. tags: - Blocks parameters: - description: A comma-separated list of block heights to get. This parameter is incompatible with `start_height` and `end_height`. name: height in: query schema: type: array items: $ref: '#/components/schemas/BlockHeight' minItems: 1 uniqueItems: true explode: false style: form - name: start_height in: query schema: $ref: '#/components/schemas/BlockHeight' required: false description: The start height of the block range to get. Must be used together with `end_height`. This parameter is incompatible with `height`. - name: end_height in: query schema: $ref: '#/components/schemas/BlockHeight' required: false description: The ending height of the block range to get. Must be used together with `start_height`. This parameter is incompatible with `height`. - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Block' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /blocks/{id}: get: summary: Get Blocks by ID. description: Get a block data or list of blocks by the provided ID or list of IDs. tags: - Blocks parameters: - description: A block ID or comma-separated list of block IDs. name: id in: path schema: type: array items: $ref: '#/components/schemas/Identifier' minItems: 1 maxItems: 50 uniqueItems: true explode: true required: true - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Block' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /blocks/{id}/payload: get: summary: Get Block Payload by Block ID. description: Get a block payload data by the provided block ID. tags: - Blocks parameters: - description: A block ID. name: id in: path schema: $ref: '#/components/schemas/Identifier' explode: true required: true - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/BlockPayload' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /transactions/{id}: get: summary: Get a Transaction by ID. description: Get a transaction data by the provided transaction ID. tags: - Transactions parameters: - description: The ID of the transaction to get. name: id in: path schema: $ref: '#/components/schemas/Identifier' 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/{transaction_id}: get: summary: Get a Transaction Result by ID. description: Get transaction result by the transaction result ID. tags: - Transactions parameters: - description: The transaction ID of the transaction result. name: transaction_id in: path schema: $ref: '#/components/schemas/Identifier' 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/TransactionResult' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /transactions: 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' /collections/{id}: get: summary: Gets a Collection by ID description: Get a collection by provided collection ID. tags: - Collections parameters: - name: id in: path schema: $ref: '#/components/schemas/Identifier' required: true description: The collection ID. - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Collection' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /execution_results: get: summary: Get Execution Results by Block ID description: Get execution result by provided block ID or multiple block IDs provided as comma-seperated list. tags: - Execution Results parameters: - description: Single ID or comma-separated list of block IDs. name: block_id in: query schema: type: array items: $ref: '#/components/schemas/Identifier' minItems: 1 uniqueItems: true explode: false style: form required: true - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/ExecutionResult' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /execution_results/{id}: get: summary: Get Execution Result by ID description: Get execution result by provided execution result ID. tags: - Execution Results parameters: - name: id in: path schema: $ref: '#/components/schemas/Identifier' required: true description: The ID of the execution result. - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ExecutionResult' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /accounts/{address}: get: summary: Get an Account By Address description: Get an account data by provided address in latest "sealed" block or by provided block height. tags: - Accounts parameters: - name: address in: path schema: $ref: '#/components/schemas/Address' required: true description: The address of the account. - name: block_height in: query schema: $ref: '#/components/schemas/BlockHeight' required: false description: The block height to query for the account details at the "sealed" is used by default. - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Account' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /accounts/{address}/keys/{index}: get: summary: Get an individual Account Key By Address and Index description: Get an account data by provided address in latest "sealed" block or by provided block height. tags: - Accounts parameters: - name: address in: path schema: $ref: '#/components/schemas/Address' required: true description: The address of the account. - name: index in: path schema: type: string format: uint64 description: Index of the public key. required: true description: The index of the account key. - name: block_height in: query schema: $ref: '#/components/schemas/BlockHeight' required: false description: The block height to query for the account details at the "sealed" is used by default. - $ref: '#/components/parameters/expandParam' - $ref: '#/components/parameters/selectParam' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AccountPublicKey' '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /scripts: post: summary: Execute a Cadence Script description: Executes a read-only Cadence script against the execution state at the given block height or ID. If block height or ID is not specified, then the script is executed at the latest sealed block height. tags: - Scripts parameters: - description: The ID of the block to execute the script against. For a specific block height, use `block_height` instead. name: block_id in: query schema: $ref: '#/components/schemas/Identifier' required: false - description: The height of the block to execute the script against. This parameter is incompatible with `block_id`. name: block_height in: query schema: $ref: '#/components/schemas/BlockHeight' required: false requestBody: description: The script to execute. required: true content: application/json: schema: type: object properties: script: type: string format: base64 description: Base64 encoded content of the Cadence script. arguments: type: array description: An 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: byte responses: '200': description: OK content: application/json: schema: type: object properties: value: type: string format: byte '400': $ref: '#/components/responses/400BadRequest' '500': $ref: '#/components/responses/500InternalServerError' /events: get: summary: Get Events description: Query on-chain events by their name in the specified blocks heights or block IDs. tags: - Events responses: '200': content: application/json: schema: $ref: '#/components/schemas/BlockEvents' description: OK '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' parameters: - name: type in: query description: The event type is [identifier of the event as defined here](https://docs.onflow.org/core-contracts/flow-token/#events). required: true deprecated: false schema: $ref: '#/components/schemas/EventType' allowEmptyValue: false - name: start_height in: query required: false description: The start height of the block range for events. Must be used together with `end_height`. This parameter is incompatible with `block_ids`. schema: $ref: '#/components/schemas/BlockHeight' allowEmptyValue: false - name: end_height in: query required: false description: The end height of the block range for events. Must be used together with `start_height`. This parameter is incompatible with `block_ids`. schema: $ref: '#/components/schemas/BlockHeight' allowEmptyValue: false - name: block_ids description: List of block IDs. Either provide this parameter or both height parameters. This parameter is incompatible with heights parameters. in: query style: form required: false explode: false allowEmptyValue: false schema: type: array items: $ref: '#/components/schemas/Identifier' minItems: 1 maxItems: 50 uniqueItems: true - $ref: '#/components/parameters/selectParam' /network/parameters: get: summary: Get Network Parameters description: Get network-wide parameters of the blockchain tags: - Network responses: '200': content: application/json: schema: $ref: '#/components/schemas/NetworkParameters' description: OK '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /node_version_info: get: summary: Get Node Version Information description: Get node version information, such as semver, commit, sporkID and protocol version. tags: - NodeVersionInfo responses: '200': content: application/json: schema: $ref: '#/components/schemas/NodeVersionInfo' description: OK '400': $ref: '#/components/responses/400BadRequest' '404': $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500InternalServerError' /subscribe_events: get: summary: Subscribe events description: Streaming on-chain events for all blocks starting at the requested start block, up until the latest available block. Once the latest is reached, the stream will remain open and responses are sent for each new block as it becomes available. tags: - Subscribe events responses: '200': content: application/json: schema: $ref: '#/components/schemas/SubscribeEvents' description: OK '1001': $ref: '#/components/responses/1001CloseGoingAway' '1003': $ref: '#/components/responses/1003CloseUnsupportedData' '1011': $ref: '#/components/responses/1011CloseInternalServerError' '1013': $ref: '#/components/responses/1013CloseTryAgaitLater' parameters: - name: start_height in: query description: The block height of the events being streamed. Either provide this parameter or `start_block_id` parameter. This parameter is incompatible with `start_block_id` parameter. required: false schema: $ref: '#/components/schemas/BlockHeight' allowEmptyValue: false - name: start_block_id description: The block id of the events being streamed. Either provide this parameter or `start_height` parameter. This parameter is incompatible with `start_height` parameter. in: query required: false schema: $ref: '#/components/schemas/Identifier' - name: heartbeat_interval description: Interval in block heights at which the server should return a heartbeat message to the client. in: query required: false allowEmptyValue: false schema: type: string format: uint64 - name: event_types in: query description: A comma-separated list of events type to include. required: false allowEmptyValue: false schema: type: array items: $ref: '#/components/schemas/EventType' minItems: 1 uniqueItems: true - name: addresses in: query description: A comma-separated list of addresses who's events should be included. required: false allowEmptyValue: false schema: type: array items: type: string minItems: 1 uniqueItems: true - name: contracts in: query description: A comma-separated list of contracts who's events should be included. required: false allowEmptyValue: false schema: type: array items: type: string minItems: 1 uniqueItems: true components: parameters: 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 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 blockIdParam: description: A block ID optional parameter name: block_id in: query schema: $ref: '#/components/schemas/Identifier' required: false collectionIdParam: description: A collection ID optional parameter. name: collection_id in: query schema: $ref: '#/components/schemas/Identifier' required: false schemas: Account: type: object required: - address - balance - _expandable properties: address: $ref: '#/components/schemas/Address' balance: type: string format: uint64 description: Flow balance of the account. keys: type: array items: $ref: '#/components/schemas/AccountPublicKey' minItems: 1 uniqueItems: true contracts: type: object additionalProperties: type: string format: byte _expandable: type: object properties: keys: type: string contracts: type: string _links: $ref: '#/components/schemas/Links' AccountPublicKey: type: object required: - index - public_key - signing_algorithm - hashing_algorithm - sequence_number - weight - revoked properties: index: type: string format: uint64 description: Index of the public key. public_key: type: string format: hex description: Hex encoded public key. signing_algorithm: $ref: '#/components/schemas/SigningAlgorithm' hashing_algorithm: $ref: '#/components/schemas/HashingAlgorithm' sequence_number: type: string format: uint64 description: Current account sequence number. weight: type: string format: uint64 description: Weight of the key. revoked: type: boolean description: Flag indicating whether the key is active or not. SigningAlgorithm: type: string enum: - BLSBLS12381 - ECDSAP256 - ECDSASecp256k1 HashingAlgorithm: type: string enum: - SHA2_256 - SHA2_384 - SHA3_256 - SHA3_384 - KMAC128 Collection: type: object required: - id - _expandable properties: id: $ref: '#/components/schemas/Identifier' transactions: type: array items: $ref: '#/components/schemas/Transaction' _expandable: type: object properties: transactions: type: array items: type: string format: uri _links: $ref: '#/components/schemas/Links' 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' 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 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' 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' _links: $ref: '#/components/schemas/Links' 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 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 Block: type: object required: - header - _expandable properties: header: $ref: '#/components/schemas/BlockHeader' payload: $ref: '#/components/schemas/BlockPayload' execution_result: $ref: '#/components/schemas/ExecutionResult' _expandable: type: object properties: payload: type: string execution_result: type: string format: uri _links: $ref: '#/components/schemas/Links' BlockHeader: type: object required: - id - parent_id - height - timestamp - parent_voter_signature properties: id: $ref: '#/components/schemas/Identifier' parent_id: $ref: '#/components/schemas/Identifier' height: type: string format: uint64 timestamp: type: string format: date-time parent_voter_signature: $ref: '#/components/schemas/Signature' BlockPayload: type: object required: - collection_guarantees - block_seals properties: collection_guarantees: type: array items: $ref: '#/components/schemas/CollectionGuarantee' uniqueItems: true block_seals: type: array items: $ref: '#/components/schemas/BlockSeal' uniqueItems: true CollectionGuarantee: type: object required: - collection_id - signer_ids - signature properties: collection_id: $ref: '#/components/schemas/Identifier' signer_ids: type: array items: $ref: '#/components/schemas/Identifier' minItems: 1 uniqueItems: true signature: $ref: '#/components/schemas/Signature' BlockSeal: type: object required: - block_id - result_id - final_state - aggregated_approval_signatures properties: block_id: $ref: '#/components/schemas/Identifier' result_id: $ref: '#/components/schemas/Identifier' final_state: $ref: '#/components/schemas/StateCommitment' aggregated_approval_signatures: type: array items: $ref: '#/components/schemas/AggregatedSignature' minItems: 1 uniqueItems: true StateCommitment: description: The root hash of the state tree. type: string format: hexadecimal pattern: '[a-fA-F0-9]{64}' AggregatedSignature: type: object required: - verifier_signatures - signer_ids properties: verifier_signatures: type: array items: $ref: '#/components/schemas/Signature' minItems: 1 uniqueItems: true signer_ids: type: array items: $ref: '#/components/schemas/Identifier' minItems: 1 uniqueItems: true ExecutionResult: type: object required: - id - block_id - events - previous_result_id properties: id: $ref: '#/components/schemas/Identifier' block_id: $ref: '#/components/schemas/Identifier' events: type: array items: $ref: '#/components/schemas/Event' chunks: type: array items: $ref: '#/components/schemas/Chunk' previous_result_id: $ref: '#/components/schemas/Identifier' _links: $ref: '#/components/schemas/Links' BlockEvents: type: object properties: block_id: $ref: '#/components/schemas/Identifier' block_height: type: string block_timestamp: type: string format: date-time events: type: array items: $ref: '#/components/schemas/Event' _links: $ref: '#/components/schemas/Links' 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 BlockHeight: oneOf: - type: string format: uint64 - type: string enum: - final - sealed EventType: description: The qualified event type. type: string 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}' Signature: description: A variable length signature. type: string format: byte Error: type: object properties: code: type: integer message: type: string Chunk: type: object required: - block_id - collection_index - start_state - end_state - event_collection - index - number_of_transactions - total_computation_used properties: block_id: $ref: '#/components/schemas/Identifier' collection_index: type: string format: uint64 start_state: type: string format: byte end_state: type: string format: byte event_collection: type: string format: byte index: type: string format: uint64 number_of_transactions: type: string format: uint64 total_computation_used: type: string format: uint64 Links: type: object properties: _self: type: string NetworkParameters: type: object required: - chain_id properties: chain_id: type: string NodeVersionInfo: type: object required: - semver - commit - spork_id - protocol_version - spork_root_block_height - node_root_block_height properties: semver: type: string commit: type: string spork_id: $ref: '#/components/schemas/Identifier' protocol_version: type: string format: uint64 spork_root_block_height: type: string format: uint64 node_root_block_height: type: string format: uint64 SubscribeEvents: type: object properties: BlockId: $ref: '#/components/schemas/Identifier' Height: type: string Events: type: array items: $ref: '#/components/schemas/Event' responses: 400BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' 404NotFound: description: Not Found content: application/json: schema: $ref: '#/components/schemas/Error' 500InternalServerError: description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Error' 1001CloseGoingAway: description: Going Away content: application/json: schema: $ref: '#/components/schemas/Error' 1003CloseUnsupportedData: description: Unsupported Data content: application/json: schema: $ref: '#/components/schemas/Error' 1011CloseInternalServerError: description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Error' 1013CloseTryAgaitLater: description: Try Agait Later content: application/json: schema: $ref: '#/components/schemas/Error' externalDocs: description: "Find out more about the Access API" url: "https://docs.onflow.org/access-api/"