Cookbook Community Meetup - 12pm ET / 5pm GMT every week on Wednesdays



Contributors: Weronika K
Last Updated:

Posting Transactions using Akord

Posting transactions to Arweave can be done directly via Akord API, no new dependencies in your code, just a simple HTTP.

Getting Started

You just need two things to get started:


import fs from "fs";

const data = fs.readFileSync('PATH_TO_YOUR_FILE_HERE');

// add some custom tags to the transaction
const tags = [
        name: "Title",
        value: "My first Arweave file"
        name: "Type",
        value: "image"

// encode tags to base64
const jsonTags = JSON.stringify(tags);
const encodedTags = Buffer.from(jsonTags).toString('base64');

const response = await fetch('', {
    method: 'POST',
    headers: {
        'Accept': 'application/json',
        'Api-Key': 'YOUR_API_KEY_HERE',
        'Content-Type': 'YOUR_FILE_MIME_TYPE_HERE', // see:
        'Tags': encodedTags
    body: data
const body = await response.json();

That's it! You just uploaded the file to Arweave. Here is the example response body:

    "id": "a6f1fbfc-403d-4607-b648-4b949fdd50bd", 
    // technical id of upload. can be used to get metadata of the upload or file binary from Akord cache
    "mimeType": "image/jpeg", // depends on content-type of upload, goes as a tag
    "sizeInBytes": 437432,
    "cloud": {
        "uri": "a6f1fbfc-403d-4607-b648-4b949fdd50bd", // same as ID
        "url": "", // url to binary served from Akord cache
    "tx": {
        "id": "LAWVdsBRTkUF8ptiEwiU6n4Q-_5ukBJIFmeAllX7Q0E", // fixed ID of Arweave transaction (ANS-104 data item ID)
        "status": "scheduled", // indicates where is your file in Arweave bundling context:
        // scheduled - file is in Akord cache and is scheduled for ANS-104 bundling
        // verification - file is being verified for malicious content
        // blocked - file is recognized as malicious, won't go to Arweave
        // bundled - file is bundled and is scheduled for posting
        // pending - file was posted to Arweave
        // committed - file is confirmed on Arweave
        // rejected - this indicates a technical problem with our bundling service
        "tags": [
            "name": "Title",
            "value": "My first Arweave file"
            "name": "Type",
            "value": "image"
            "name": "Content-Type",
            "value": "image/jpeg"
        ], // your Arweave tags appended to transaction
        "statusUrl": "",
        // check file status endpoint, returns similar JSON schema
        "gatewayUrls": [
            // this url will only work when file is in 'committed' status
            // Akord instance of Arweave gateway - this url will work always, even right after upload since it falls back to Akord cache when file is not yet on Arweave
        "viewblockUrl": "", // see your file on ViewBlock - this url will only work when file is in 'committed' status & indexed by ViewBlock
        "info": "Transaction is visible on the blockchain indexers when in the \"committed\" status.",