Authentication

June 9, 2026 · View on GitHub

Ledger API v2

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Base URLs:

Authentication

  • oAuth2 authentication.

ScopeScope Description

ledger

Show server information

Code samples

GET http://localhost:8080/_/info HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /_/info

Example responses

200 Response

{
  "server": "string",
  "version": "string",
  "experimentalFeatures": [
    "string"
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2ConfigInfo
defaultDefaultErrorV2ErrorResponse
5XXUnknownErrorV2ErrorResponse

Read in memory metrics

Code samples

GET http://localhost:8080/_/metrics HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /_/metrics

Example responses

200 Response

{
  "property1": null,
  "property2": null
}

Responses

StatusMeaningDescriptionSchema
200OKOKInline
defaultDefaultErrorV2ErrorResponse

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» additionalPropertiesanyfalsenonenone

ledger.v2

List ledgers

Code samples

GET http://localhost:8080/v2 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

GET /v2

Body parameter

{}

Parameters

NameInTypeRequiredDescription
pageSizequeryinteger(int64)falseThe maximum number of results to return per page.
cursorquerystringfalseParameter used in pagination requests. Maximum page size is set to 15.
includeDeletedquerybooleanfalseIf true, include deleted ledgers in the results. By default, deleted ledgers are excluded.
sortquerystringfalseSort results using a field name and order (ascending or descending).
bodybodyobjecttruenone

Detailed descriptions

pageSize: The maximum number of results to return per page.

cursor: Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

includeDeleted: If true, include deleted ledgers in the results. By default, deleted ledgers are excluded.

sort: Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Example responses

200 Response

{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "name": "string",
        "addedAt": "2019-08-24T14:15:22Z",
        "bucket": "string",
        "deletedAt": "2019-08-24T14:15:22Z",
        "metadata": {
          "admin": "true"
        },
        "features": {
          "property1": "string",
          "property2": "string"
        },
        "id": 0
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2LedgerListResponse
defaultDefaultErrorV2ErrorResponse

Get a ledger

Code samples

GET http://localhost:8080/v2/{ledger} HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.

Example responses

200 Response

{
  "data": {
    "name": "string",
    "addedAt": "2019-08-24T14:15:22Z",
    "bucket": "string",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metadata": {
      "admin": "true"
    },
    "features": {
      "property1": "string",
      "property2": "string"
    },
    "id": 0
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2GetLedgerResponse
defaultDefaultErrorV2ErrorResponse

Create a ledger

Code samples

POST http://localhost:8080/v2/{ledger} HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

POST /v2/{ledger}

Body parameter

{
  "bucket": "string",
  "metadata": {
    "admin": "true"
  },
  "features": {
    "property1": "string",
    "property2": "string"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyV2CreateLedgerRequesttruenone
ledgerpathstringtrueName of the ledger.

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentOKNone
defaultDefaultErrorV2ErrorResponse

Insert a schema for a ledger

Code samples

POST http://localhost:8080/v2/{ledger}/schemas/{version} HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string

POST /v2/{ledger}/schemas/{version}

Body parameter

{
  "chart": {
    "users": {
      "$userID": {
        ".pattern": "^[0-9]{16}$"
      }
    }
  },
  "transactions": {
    "property1": {
      "description": "string",
      "script": "string",
      "runtime": "experimental-interpreter"
    },
    "property2": {
      "description": "string",
      "script": "string",
      "runtime": "experimental-interpreter"
    }
  },
  "queries": {
    "property1": {
      "description": "string",
      "resource": "transactions",
      "params": {
        "pageSize": 100,
        "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
        "expand": "string",
        "pit": "2019-08-24T14:15:22Z",
        "sort": "id:desc",
        "resource": "accounts"
      },
      "vars": {
        "property1": {
          "type": "string",
          "default": null
        },
        "property2": {
          "type": "string",
          "default": null
        }
      },
      "body": {}
    },
    "property2": {
      "description": "string",
      "resource": "transactions",
      "params": {
        "pageSize": 100,
        "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
        "expand": "string",
        "pit": "2019-08-24T14:15:22Z",
        "sort": "id:desc",
        "resource": "accounts"
      },
      "vars": {
        "property1": {
          "type": "string",
          "default": null
        },
        "property2": {
          "type": "string",
          "default": null
        }
      },
      "body": {}
    }
  }
}

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringfalseUse an idempotency key
bodybodyV2SchemaDatatruenone
ledgerpathstringtrueName of the ledger.
versionpathstringtrueSchema version.

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentSchema inserted successfullyNone
defaultDefaultErrorV2ErrorResponse

Response Headers

StatusHeaderTypeFormatDescription
204Idempotency-HitstringIndicates that the request was processed using an idempotency key that was already used

Get a schema for a ledger by version

Code samples

GET http://localhost:8080/v2/{ledger}/schemas/{version} HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/schemas/{version}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
versionpathstringtrueSchema version.

Example responses

200 Response

{
  "data": {
    "version": "v1.0.0",
    "createdAt": "2023-01-01T00:00:00Z",
    "chart": {
      "users": {
        "$userID": {
          ".pattern": "^[0-9]{16}$"
        }
      }
    },
    "transactions": {
      "property1": {
        "description": "string",
        "script": "string",
        "runtime": "experimental-interpreter"
      },
      "property2": {
        "description": "string",
        "script": "string",
        "runtime": "experimental-interpreter"
      }
    },
    "queries": {
      "property1": {
        "description": "string",
        "resource": "transactions",
        "params": {
          "pageSize": 100,
          "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
          "expand": "string",
          "pit": "2019-08-24T14:15:22Z",
          "sort": "id:desc",
          "resource": "accounts"
        },
        "vars": {
          "property1": {
            "type": "string",
            "default": null
          },
          "property2": {
            "type": "string",
            "default": null
          }
        },
        "body": {}
      },
      "property2": {
        "description": "string",
        "resource": "transactions",
        "params": {
          "pageSize": 100,
          "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
          "expand": "string",
          "pit": "2019-08-24T14:15:22Z",
          "sort": "id:desc",
          "resource": "accounts"
        },
        "vars": {
          "property1": {
            "type": "string",
            "default": null
          },
          "property2": {
            "type": "string",
            "default": null
          }
        },
        "body": {}
      }
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSchema retrieved successfullyV2SchemaResponse
defaultDefaultErrorV2ErrorResponse

List all schemas for a ledger

Code samples

GET http://localhost:8080/v2/{ledger}/schemas HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/schemas

Parameters

NameInTypeRequiredDescription
cursorquerystringfalseThe pagination cursor value
pageSizequeryintegerfalseThe maximum number of results to return per page
sortquerystringfalseThe field to sort by
orderquerystringfalseThe sort order
ledgerpathstringtrueName of the ledger.

Enumerated Values

ParameterValue
sortcreated_at
orderasc
orderdesc

Example responses

200 Response

{
  "cursor": {
    "data": [
      {
        "version": "v1.0.0",
        "createdAt": "2023-01-01T00:00:00Z",
        "chart": {
          "users": {
            "$userID": {
              ".pattern": "^[0-9]{16}$"
            }
          }
        },
        "transactions": {
          "property1": {
            "description": "string",
            "script": "string",
            "runtime": "experimental-interpreter"
          },
          "property2": {
            "description": "string",
            "script": "string",
            "runtime": "experimental-interpreter"
          }
        },
        "queries": {
          "property1": {
            "description": "string",
            "resource": "transactions",
            "params": {
              "pageSize": 100,
              "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
              "expand": "string",
              "pit": "2019-08-24T14:15:22Z",
              "sort": "id:desc",
              "resource": "accounts"
            },
            "vars": {
              "property1": {
                "type": "string",
                "default": null
              },
              "property2": {
                "type": "string",
                "default": null
              }
            },
            "body": {}
          },
          "property2": {
            "description": "string",
            "resource": "transactions",
            "params": {
              "pageSize": 100,
              "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
              "expand": "string",
              "pit": "2019-08-24T14:15:22Z",
              "sort": "id:desc",
              "resource": "accounts"
            },
            "vars": {
              "property1": {
                "type": "string",
                "default": null
              },
              "property2": {
                "type": "string",
                "default": null
              }
            },
            "body": {}
          }
        }
      }
    ],
    "hasMore": true,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "pageSize": 0
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSchemas retrieved successfullyV2SchemasCursorResponse
defaultDefaultErrorV2ErrorResponse

Update ledger metadata

Code samples

PUT http://localhost:8080/v2/{ledger}/metadata HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

PUT /v2/{ledger}/metadata

Body parameter

{
  "admin": "true"
}

Parameters

NameInTypeRequiredDescription
bodybodyV2Metadatatruenone
ledgerpathstringtrueName of the ledger.

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentOKNone
defaultDefaultErrorV2ErrorResponse
5XXUnknownErrorV2ErrorResponse

Delete ledger metadata by key

Code samples

DELETE http://localhost:8080/v2/{ledger}/metadata/{key} HTTP/1.1
Host: localhost:8080
Accept: application/json

DELETE /v2/{ledger}/metadata/{key}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
keypathstringtrueKey to remove.

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentOKNone
defaultDefaultErrorV2ErrorResponse

Get information about a ledger

Code samples

GET http://localhost:8080/v2/{ledger}/_info HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/_info

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.

Example responses

200 Response

{
  "data": {
    "name": "ledger001",
    "storage": {
      "migrations": [
        {
          "version": 11,
          "name": "migrations:001",
          "date": "2019-08-24T14:15:22Z",
          "state": "TO DO"
        }
      ]
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2LedgerInfoResponse
defaultDefaultErrorV2ErrorResponse

Bulk request

Code samples

POST http://localhost:8080/v2/{ledger}/_bulk HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

POST /v2/{ledger}/_bulk

Body parameter

[
  {
    "action": "string",
    "ik": "string",
    "data": {
      "timestamp": "2019-08-24T14:15:22Z",
      "postings": [
        {
          "amount": 100,
          "asset": "COIN",
          "destination": "users:002",
          "source": "users:001"
        }
      ],
      "script": {
        "template": "CUSTOMER_DEPOSIT",
        "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
        "vars": {
          "user": "users:042"
        }
      },
      "runtime": "experimental-interpreter",
      "reference": "ref:001",
      "metadata": {
        "admin": "true"
      },
      "accountMetadata": {
        "property1": {
          "admin": "true"
        },
        "property2": {
          "admin": "true"
        }
      },
      "force": true
    }
  }
]

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
continueOnFailurequerybooleanfalseContinue on failure
atomicquerybooleanfalseMake bulk atomic
parallelquerybooleanfalseProcess bulk elements in parallel
schemaVersionquerystringfalseDefault schema version to use for validation (can be overridden per element)
bodybodyV2Bulktruenone

Example responses

200 Response

{
  "data": [
    {
      "responseType": "string",
      "logID": 0,
      "data": {
        "insertedAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "timestamp": "2019-08-24T14:15:22Z",
        "postings": [
          {
            "amount": 100,
            "asset": "COIN",
            "destination": "users:002",
            "source": "users:001"
          }
        ],
        "reference": "ref:001",
        "metadata": {
          "admin": "true"
        },
        "id": 0,
        "reverted": true,
        "revertedAt": "2019-08-24T14:15:22Z",
        "preCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "preCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "template": "string"
      }
    }
  ],
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param"
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2BulkResponse
400Bad RequestOKV2BulkResponse
defaultDefaultErrorV2ErrorResponse

Count the accounts from a ledger

Code samples

HEAD http://localhost:8080/v2/{ledger}/accounts HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

HEAD /v2/{ledger}/accounts

Body parameter

{}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pitquerystring(date-time)falsenone
bodybodyobjecttruenone

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentOKNone
defaultDefaultErrorV2ErrorResponse

Response Headers

StatusHeaderTypeFormatDescription
204Countintegerbigintnone

List accounts from a ledger

Code samples

GET http://localhost:8080/v2/{ledger}/accounts HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

GET /v2/{ledger}/accounts

List accounts from a ledger, sorted by address in descending order.

Body parameter

{}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pageSizequeryinteger(int64)falseThe maximum number of results to return per page.
cursorquerystringfalseParameter used in pagination requests. Maximum page size is set to 15.
expandquerystringfalsenone
pitquerystring(date-time)falsenone
sortquerystringfalseSort results using a field name and order (ascending or descending).
bodybodyobjecttruenone

Detailed descriptions

pageSize: The maximum number of results to return per page.

cursor: Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

sort: Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Example responses

200 Response

{
  "resource": "accounts",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "address": "users:001",
        "metadata": {
          "admin": "true"
        },
        "insertionDate": "2023-01-01T00:00:00Z",
        "updatedAt": "2023-01-01T00:00:00Z",
        "firstUsage": "2023-01-01T00:00:00Z",
        "volumes": {
          "USD": {
            "input": 100,
            "output": 10,
            "balance": 90
          },
          "EUR": {
            "input": 100,
            "output": 10,
            "balance": 90
          }
        },
        "effectiveVolumes": {
          "USD": {
            "input": 100,
            "output": 10,
            "balance": 90
          },
          "EUR": {
            "input": 100,
            "output": 10,
            "balance": 90
          }
        }
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2AccountsCursorResponse
defaultDefaultErrorV2ErrorResponse

Get account by its address

Code samples

GET http://localhost:8080/v2/{ledger}/accounts/{address} HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/accounts/{address}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
addresspathstringtrueExact address of the account. It must match the following regular expressions pattern:
expandquerystringfalsenone
pitquerystring(date-time)falsenone

Detailed descriptions

address: Exact address of the account. It must match the following regular expressions pattern:

^\w+(:\w+)*$

Example responses

200 Response

{
  "data": {
    "address": "users:001",
    "metadata": {
      "admin": "true"
    },
    "insertionDate": "2023-01-01T00:00:00Z",
    "updatedAt": "2023-01-01T00:00:00Z",
    "firstUsage": "2023-01-01T00:00:00Z",
    "volumes": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      },
      "EUR": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "effectiveVolumes": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      },
      "EUR": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2AccountResponse
defaultDefaultErrorV2ErrorResponse

Add metadata to an account

Code samples

POST http://localhost:8080/v2/{ledger}/accounts/{address}/metadata HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string

POST /v2/{ledger}/accounts/{address}/metadata

Body parameter

{
  "admin": "true"
}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
addresspathstringtrueExact address of the account. It must match the following regular expressions pattern:
dryRunquerybooleanfalseSet the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.
Idempotency-KeyheaderstringfalseUse an idempotency key
schemaVersionquerystringfalseSchema version to use for validation
bodybodyV2Metadatatruemetadata

Detailed descriptions

address: Exact address of the account. It must match the following regular expressions pattern:

^\w+(:\w+)*$

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentNo ContentNone
defaultDefaultErrorV2ErrorResponse

Response Schema

Response Headers

StatusHeaderTypeFormatDescription
204Idempotency-HitstringIndicates that the request was processed using an idempotency key that was already used

Delete metadata by key

Code samples

DELETE http://localhost:8080/v2/{ledger}/transactions/{id}/metadata/{key} HTTP/1.1
Host: localhost:8080
Accept: application/json
Idempotency-Key: string

DELETE /v2/{ledger}/transactions/{id}/metadata/{key}

Delete metadata by key

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
idpathinteger(bigint)trueTransaction ID.
keypathstringtrueThe key to remove.
Idempotency-KeyheaderstringfalseUse an idempotency key

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentKey deletedNone
defaultDefaultErrorV2ErrorResponse

Response Schema

Response Headers

StatusHeaderTypeFormatDescription
204Idempotency-HitstringIndicates that the request was processed using an idempotency key that was already used

Get statistics from a ledger

Code samples

GET http://localhost:8080/v2/{ledger}/stats HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/stats

Get statistics from a ledger. (aggregate metrics on accounts and transactions)

Parameters

NameInTypeRequiredDescription
ledgerpathstringtruename of the ledger

Example responses

200 Response

{
  "data": {
    "accounts": 0,
    "transactions": 0
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2StatsResponse
defaultDefaultErrorV2ErrorResponse

Count the transactions from a ledger

Code samples

HEAD http://localhost:8080/v2/{ledger}/transactions HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

HEAD /v2/{ledger}/transactions

Body parameter

{}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pitquerystring(date-time)falsenone
bodybodyobjecttruenone

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentOKNone
defaultDefaultErrorV2ErrorResponse

Response Headers

StatusHeaderTypeFormatDescription
204Countintegerint64none

List transactions from a ledger

Code samples

GET http://localhost:8080/v2/{ledger}/transactions HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

GET /v2/{ledger}/transactions

List transactions from a ledger, sorted by id in descending order.

Body parameter

{}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pageSizequeryinteger(int64)falseThe maximum number of results to return per page.
cursorquerystringfalseParameter used in pagination requests. Maximum page size is set to 15.
expandquerystringfalsenone
pitquerystring(date-time)falsenone
orderquerystringfalseDeprecated: Use sort param
reversequerybooleanfalsenone
sortquerystringfalseSort results using a field name and order (ascending or descending).
bodybodyobjecttruenone

Detailed descriptions

pageSize: The maximum number of results to return per page.

cursor: Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

sort: Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Enumerated Values

ParameterValue
ordereffective

Example responses

200 Response

{
  "resource": "transactions",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "insertedAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "timestamp": "2019-08-24T14:15:22Z",
        "postings": [
          {
            "amount": 100,
            "asset": "COIN",
            "destination": "users:002",
            "source": "users:001"
          }
        ],
        "reference": "ref:001",
        "metadata": {
          "admin": "true"
        },
        "id": 0,
        "reverted": true,
        "revertedAt": "2019-08-24T14:15:22Z",
        "preCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "preCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "template": "string"
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2TransactionsCursorResponse
defaultDefaultErrorV2ErrorResponse

Create a new transaction to a ledger

Code samples

POST http://localhost:8080/v2/{ledger}/transactions HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string

POST /v2/{ledger}/transactions

Body parameter

{
  "timestamp": "2019-08-24T14:15:22Z",
  "postings": [
    {
      "amount": 100,
      "asset": "COIN",
      "destination": "users:002",
      "source": "users:001"
    }
  ],
  "script": {
    "template": "CUSTOMER_DEPOSIT",
    "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
    "vars": {
      "user": "users:042"
    }
  },
  "runtime": "experimental-interpreter",
  "reference": "ref:001",
  "metadata": {
    "admin": "true"
  },
  "accountMetadata": {
    "property1": {
      "admin": "true"
    },
    "property2": {
      "admin": "true"
    }
  },
  "force": true
}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
dryRunquerybooleanfalseSet the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker.
Idempotency-KeyheaderstringfalseUse an idempotency key
forcequerybooleanfalseDisable balance checks when passing postings
schemaVersionquerystringfalseSchema version to use for validation
bodybodyV2PostTransactiontrueThe request body must contain at least one of the following objects:

Detailed descriptions

body: The request body must contain at least one of the following objects:

  • postings: suitable for simple transactions
  • script: enabling more complex transactions with Numscript

Example responses

200 Response

{
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2CreateTransactionResponse
defaultDefaultErrorV2ErrorResponse

Response Headers

StatusHeaderTypeFormatDescription
200Idempotency-HitstringIndicates that the request was processed using an idempotency key that was already used

Get transaction from a ledger by its ID

Code samples

GET http://localhost:8080/v2/{ledger}/transactions/{id} HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/transactions/{id}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
idpathinteger(bigint)trueTransaction ID.
expandquerystringfalsenone
pitquerystring(date-time)falsenone

Example responses

200 Response

{
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2GetTransactionResponse
defaultDefaultErrorV2ErrorResponse

Set the metadata of a transaction by its ID

Code samples

POST http://localhost:8080/v2/{ledger}/transactions/{id}/metadata HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string

POST /v2/{ledger}/transactions/{id}/metadata

Body parameter

{
  "admin": "true"
}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
idpathinteger(bigint)trueTransaction ID.
dryRunquerybooleanfalseSet the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.
Idempotency-KeyheaderstringfalseUse an idempotency key
schemaVersionquerystringfalseSchema version to use for validation
bodybodyV2Metadatatruemetadata

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentNo ContentNone
defaultDefaultErrorV2ErrorResponse

Response Schema

Response Headers

StatusHeaderTypeFormatDescription
204Idempotency-HitstringIndicates that the request was processed using an idempotency key that was already used

Revert a ledger transaction by its ID

Code samples

POST http://localhost:8080/v2/{ledger}/transactions/{id}/revert HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string

POST /v2/{ledger}/transactions/{id}/revert

Body parameter

{
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
idpathinteger(bigint)trueTransaction ID.
forcequerybooleanfalseForce revert
atEffectiveDatequerybooleanfalseRevert transaction at effective date of the original tx
dryRunquerybooleanfalseSet the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker.
schemaVersionquerystringfalseSchema version to use for validation
Idempotency-KeyheaderstringfalseUse an idempotency key
bodybodyV2RevertTransactionRequestfalsenone

Example responses

201 Response

{
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedOKV2CreateTransactionResponse
defaultDefaultErrorV2ErrorResponse

Response Headers

StatusHeaderTypeFormatDescription
201Idempotency-HitstringIndicates that the request was processed using an idempotency key that was already used

Get the aggregated balances from selected accounts

Code samples

GET http://localhost:8080/v2/{ledger}/aggregate/balances HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

GET /v2/{ledger}/aggregate/balances

Body parameter

{}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pitquerystring(date-time)falsenone
useInsertionDatequerybooleanfalseUse insertion date instead of effective date
bodybodyobjecttruenone

Example responses

200 Response

{
  "data": {
    "USD": 100,
    "EUR": 12
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2AggregateBalancesResponse
defaultDefaultErrorV2ErrorResponse

Get list of volumes with balances for (account/asset)

Code samples

GET http://localhost:8080/v2/{ledger}/volumes HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

GET /v2/{ledger}/volumes

Body parameter

{}

Parameters

NameInTypeRequiredDescription
pageSizequeryinteger(int64)falseThe maximum number of results to return per page.
cursorquerystringfalseParameter used in pagination requests. Maximum page size is set to 15.
ledgerpathstringtrueName of the ledger.
endTimequerystring(date-time)falsenone
startTimequerystring(date-time)falsenone
insertionDatequerybooleanfalseUse insertion date instead of effective date
groupByqueryinteger(int64)falseGroup volumes and balance by the level of the segment of the address
sortquerystringfalseSort results using a field name and order (ascending or descending).
bodybodyobjecttruenone

Detailed descriptions

pageSize: The maximum number of results to return per page.

cursor: Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

sort: Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Example responses

200 Response

{
  "resource": "volumes",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "account": "string",
        "asset": "string",
        "input": 0,
        "output": 0,
        "balance": 0
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2VolumesWithBalanceCursorResponse
defaultDefaultErrorV2ErrorResponse

List the logs from a ledger

Code samples

GET http://localhost:8080/v2/{ledger}/logs HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

GET /v2/{ledger}/logs

List the logs from a ledger, sorted by ID in descending order.

Body parameter

{}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pageSizequeryinteger(int64)falseThe maximum number of results to return per page.
cursorquerystringfalseParameter used in pagination requests. Maximum page size is set to 15.
pitquerystring(date-time)falsenone
sortquerystringfalseSort results using a field name and order (ascending or descending).
bodybodyobjecttruenone

Detailed descriptions

pageSize: The maximum number of results to return per page.

cursor: Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

sort: Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Example responses

200 Response

{
  "resource": "logs",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "id": 1234,
        "type": "NEW_TRANSACTION",
        "data": {
          "transaction": {
            "id": 1234,
            "postings": [
              {
                "source": "world",
                "destination": "users:001",
                "amount": 100,
                "asset": "USD/2"
              }
            ],
            "metadata": {},
            "timestamp": "2024-01-15T10:30:00Z",
            "insertedAt": "2024-01-15T10:30:00Z",
            "reverted": false
          },
          "accountMetadata": {
            "users:001": {
              "created_by": "system"
            }
          }
        },
        "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
        "date": "2019-08-24T14:15:22Z",
        "schemaVersion": "v1.0.0"
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKV2LogsCursorResponse
defaultDefaultErrorV2ErrorResponse

v2ImportLogs

Code samples

POST http://localhost:8080/v2/{ledger}/logs/import HTTP/1.1
Host: localhost:8080
Content-Type: application/octet-stream
Accept: application/json

POST /v2/{ledger}/logs/import

Body parameter

file: string

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
bodybodyV2ImportLogsRequesttruenone

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentImport OKNone
defaultDefaultErrorV2ErrorResponse

Export logs

Code samples

POST http://localhost:8080/v2/{ledger}/logs/export HTTP/1.1
Host: localhost:8080
Accept: application/octet-stream

POST /v2/{ledger}/logs/export

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.

Example responses

200 Response

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
200OKExport OKstring
defaultDefaultErrorV2ErrorResponse

Run a query template

Code samples

POST http://localhost:8080/v2/{ledger}/queries/{id}/run?schemaVersion=v1.0.0 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

POST /v2/{ledger}/queries/{id}/run

Run a query template on a ledger

Body parameter

{
  "cursor": "string",
  "params": {
    "pageSize": 100,
    "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
    "expand": "string",
    "pit": "2019-08-24T14:15:22Z",
    "sort": "id:desc",
    "resource": "accounts"
  },
  "vars": {
    "property1": "string",
    "property2": "string"
  }
}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
schemaVersionquerystringtrueSchema version to use for validation
idpathstringtrueQuery template ID.
pageSizequeryinteger(int64)falseThe maximum number of results to return per page.
cursorquerystringfalseParameter used in pagination requests. Maximum page size is set to 15.
expandquerystringfalsenone
pitquerystring(date-time)falsenone
orderquerystringfalseDeprecated: Use sort param
reversequerybooleanfalsenone
sortquerystringfalseSort results using a field name and order (ascending or descending).
bodybodyobjecttruenone
» cursorbodystringfalsenone
» paramsbodyV2QueryParamsfalsenone
»» pageSizebodyinteger(int64)falseThe maximum number of results to return per page.
»» cursorbodystringfalseParameter used in pagination requests. Maximum page size is set to 15.
»» expandbodystringfalsenone
»» pitbodystring(date-time)falsenone
»» sortbodystringfalseSort results using a field name and order (ascending or descending).
»» anonymousbodyobjectfalsenone
»»» resourcebodystringtruenone
»» anonymousbodyobjectfalsenone
»»» resourcebodystringtruenone
»» anonymousbodyobjectfalsenone
»»» resourcebodystringtruenone
»» anonymousbodyobjectfalsenone
»»» resourcebodystringtruenone
»»» insertionDatebodybooleanfalsenone
»»» groupBybodyintegerfalsenone
» varsbodyobjectfalsenone
»» additionalPropertiesbodystringfalsenone

Detailed descriptions

pageSize: The maximum number of results to return per page.

cursor: Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

sort: Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

»» cursor: Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

»» sort: Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Enumerated Values

ParameterValue
ordereffective
»»» resourceaccounts
»»» resourcetransactions
»»» resourcelogs
»»» resourcevolumes

Example responses

200 Response

{
  "resource": "transactions",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "insertedAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "timestamp": "2019-08-24T14:15:22Z",
        "postings": [
          {
            "amount": 100,
            "asset": "COIN",
            "destination": "users:002",
            "source": "users:001"
          }
        ],
        "reference": "ref:001",
        "metadata": {
          "admin": "true"
        },
        "id": 0,
        "reverted": true,
        "revertedAt": "2019-08-24T14:15:22Z",
        "preCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "preCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "template": "string"
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKOKInline
defaultDefaultErrorV2ErrorResponse

Response Schema

Enumerated Values

PropertyValue
resourcetransactions
resourceaccounts
resourcelogs
typeNEW_TRANSACTION
typeSET_METADATA
typeREVERTED_TRANSACTION
typeDELETE_METADATA
typeINSERTED_SCHEMA
targetTypeACCOUNT
targetTypeTRANSACTION
targetTypeACCOUNT
targetTypeTRANSACTION
runtimeexperimental-interpreter
runtimemachine
resourcetransactions
resourceaccounts
resourcelogs
resourcevolumes
resourceaccounts
resourcetransactions
resourcelogs
resourcevolumes
resourcevolumes

List exporters

Code samples

GET http://localhost:8080/v2/_/exporters HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/_/exporters

Example responses

200 Response

{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "driver": "string",
        "config": {},
        "id": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKExporters listV2ExportersCursorResponse
defaultDefaultErrorV2ErrorResponse

Create exporter

Code samples

POST http://localhost:8080/v2/_/exporters HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

POST /v2/_/exporters

Body parameter

{
  "driver": "string",
  "config": {}
}

Parameters

NameInTypeRequiredDescription
bodybodyV2ExporterConfigurationtruenone

Example responses

201 Response

{
  "data": {
    "driver": "string",
    "config": {},
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z"
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedCreated exporterInline
defaultDefaultErrorV2ErrorResponse

Response Schema

Status Code 201

NameTypeRequiredRestrictionsDescription
» dataV2Exportertruenonenone

allOf

NameTypeRequiredRestrictionsDescription
»» anonymousV2ExporterConfigurationfalsenonenone
»»» driverstringtruenonenone
»»» configobjecttruenonenone

and

NameTypeRequiredRestrictionsDescription
»» anonymousobjectfalsenonenone
»»» idstringtruenonenone
»»» createdAtstring(date-time)truenonenone

Get exporter state

Code samples

GET http://localhost:8080/v2/_/exporters/{exporterID} HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/_/exporters/{exporterID}

Parameters

NameInTypeRequiredDescription
exporterIDpathstringtrueThe exporter id

Example responses

200 Response

{
  "data": {
    "driver": "string",
    "config": {},
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKExporter informationInline
defaultDefaultErrorV2ErrorResponse

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» dataV2Exportertruenonenone

allOf

NameTypeRequiredRestrictionsDescription
»» anonymousV2ExporterConfigurationfalsenonenone
»»» driverstringtruenonenone
»»» configobjecttruenonenone

and

NameTypeRequiredRestrictionsDescription
»» anonymousobjectfalsenonenone
»»» idstringtruenonenone
»»» createdAtstring(date-time)truenonenone

Update exporter

Code samples

PUT http://localhost:8080/v2/_/exporters/{exporterID} HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

PUT /v2/_/exporters/{exporterID}

Body parameter

{
  "driver": "string",
  "config": {}
}

Parameters

NameInTypeRequiredDescription
bodybodyV2ExporterConfigurationtruenone
exporterIDpathstringtrueThe exporter id

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentExporter updatedNone
defaultDefaultErrorV2ErrorResponse

Delete exporter

Code samples

DELETE http://localhost:8080/v2/_/exporters/{exporterID} HTTP/1.1
Host: localhost:8080
Accept: application/json

DELETE /v2/_/exporters/{exporterID}

Parameters

NameInTypeRequiredDescription
exporterIDpathstringtrueThe exporter id

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentExporter deletedNone
defaultDefaultErrorV2ErrorResponse

Delete bucket

Code samples

DELETE http://localhost:8080/v2/_/buckets/{bucket} HTTP/1.1
Host: localhost:8080
Accept: application/json

DELETE /v2/_/buckets/{bucket}

Delete a bucket by marking all ledgers in the bucket as deleted (soft delete). All ledgers in the bucket will have their deleted_at field set to the current timestamp.

Parameters

NameInTypeRequiredDescription
bucketpathstringtrueThe bucket name

Example responses

404 Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentBucket deletedNone
404Not FoundBucket not foundV2ErrorResponse
defaultDefaultErrorV2ErrorResponse

Restore bucket

Code samples

POST http://localhost:8080/v2/_/buckets/{bucket}/restore HTTP/1.1
Host: localhost:8080
Accept: application/json

POST /v2/_/buckets/{bucket}/restore

Restore a deleted bucket by unmarking all ledgers in the bucket as deleted. All ledgers in the bucket will have their deleted_at field set to NULL.

Parameters

NameInTypeRequiredDescription
bucketpathstringtrueThe bucket name

Example responses

404 Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentBucket restoredNone
404Not FoundBucket not foundV2ErrorResponse
defaultDefaultErrorV2ErrorResponse

List pipelines

Code samples

GET http://localhost:8080/v2/{ledger}/pipelines HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/pipelines

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.

Example responses

200 Response

{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "id": "string",
        "createdAt": "2019-08-24T14:15:22Z",
        "lastLogID": 0,
        "enabled": true
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKPipelines listV2PipelinesCursorResponse
defaultDefaultErrorV2ErrorResponse

Create pipeline

Code samples

POST http://localhost:8080/v2/{ledger}/pipelines HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json

POST /v2/{ledger}/pipelines

Body parameter

{
  "exporterID": "string"
}

Parameters

NameInTypeRequiredDescription
bodybodyV2CreatePipelineRequestfalsenone
ledgerpathstringtrueName of the ledger.

Example responses

201 Response

{
  "data": {
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastLogID": 0,
    "enabled": true
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedCreated ipelineInline
defaultDefaultErrorV2ErrorResponse

Response Schema

Status Code 201

NameTypeRequiredRestrictionsDescription
» dataanytruenonenone

allOf

NameTypeRequiredRestrictionsDescription
»» anonymousobjectfalsenonenone
»»» ledgerstringtruenonenone
»»» exporterIDstringtruenonenone

and

NameTypeRequiredRestrictionsDescription
»» anonymousobjectfalsenonenone
»»» idstringtruenonenone
»»» createdAtstring(date-time)truenonenone
»»» lastLogIDintegerfalsenonenone
»»» enabledbooleanfalsenonenone

Get pipeline state

Code samples

GET http://localhost:8080/v2/{ledger}/pipelines/{pipelineID} HTTP/1.1
Host: localhost:8080
Accept: application/json

GET /v2/{ledger}/pipelines/{pipelineID}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pipelineIDpathstringtrueThe pipeline id

Example responses

200 Response

{
  "data": {
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastLogID": 0,
    "enabled": true
  }
}

Responses

StatusMeaningDescriptionSchema
200OKPipeline informationInline
defaultDefaultErrorV2ErrorResponse

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» dataanytruenonenone

allOf

NameTypeRequiredRestrictionsDescription
»» anonymousobjectfalsenonenone
»»» ledgerstringtruenonenone
»»» exporterIDstringtruenonenone

and

NameTypeRequiredRestrictionsDescription
»» anonymousobjectfalsenonenone
»»» idstringtruenonenone
»»» createdAtstring(date-time)truenonenone
»»» lastLogIDintegerfalsenonenone
»»» enabledbooleanfalsenonenone

Delete pipeline

Code samples

DELETE http://localhost:8080/v2/{ledger}/pipelines/{pipelineID} HTTP/1.1
Host: localhost:8080
Accept: application/json

DELETE /v2/{ledger}/pipelines/{pipelineID}

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pipelineIDpathstringtrueThe pipeline id

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
204No ContentPipeline deletedNone
defaultDefaultErrorV2ErrorResponse

Reset pipeline

Code samples

POST http://localhost:8080/v2/{ledger}/pipelines/{pipelineID}/reset HTTP/1.1
Host: localhost:8080
Accept: application/json

POST /v2/{ledger}/pipelines/{pipelineID}/reset

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pipelineIDpathstringtrueThe pipeline id

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
202AcceptedPipeline resetNone
defaultDefaultErrorV2ErrorResponse

Start pipeline

Code samples

POST http://localhost:8080/v2/{ledger}/pipelines/{pipelineID}/start HTTP/1.1
Host: localhost:8080
Accept: application/json

POST /v2/{ledger}/pipelines/{pipelineID}/start

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pipelineIDpathstringtrueThe pipeline id

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
202AcceptedPipeline startedNone
defaultDefaultErrorV2ErrorResponse

Stop pipeline

Code samples

POST http://localhost:8080/v2/{ledger}/pipelines/{pipelineID}/stop HTTP/1.1
Host: localhost:8080
Accept: application/json

POST /v2/{ledger}/pipelines/{pipelineID}/stop

Parameters

NameInTypeRequiredDescription
ledgerpathstringtrueName of the ledger.
pipelineIDpathstringtrueThe pipeline id

Example responses

default Response

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Responses

StatusMeaningDescriptionSchema
202AcceptedPipeline stoppedNone
defaultDefaultErrorV2ErrorResponse

Schemas

V2ExportersCursorResponse

{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "driver": "string",
        "config": {},
        "id": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
cursorobjecttruenonenone
» pageSizeinteger(int64)truenonenone
» hasMorebooleantruenonenone
» previousstringfalsenonenone
» nextstringfalsenonenone
» data[V2Exporter]truenonenone

V2PipelinesCursorResponse

{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "id": "string",
        "createdAt": "2019-08-24T14:15:22Z",
        "lastLogID": 0,
        "enabled": true
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
cursorobjecttruenonenone
» pageSizeinteger(int64)truenonenone
» hasMorebooleantruenonenone
» previousstringfalsenonenone
» nextstringfalsenonenone
» data[V2Pipeline]truenonenone

V2AccountsCursorResponse

{
  "resource": "accounts",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "address": "users:001",
        "metadata": {
          "admin": "true"
        },
        "insertionDate": "2023-01-01T00:00:00Z",
        "updatedAt": "2023-01-01T00:00:00Z",
        "firstUsage": "2023-01-01T00:00:00Z",
        "volumes": {
          "USD": {
            "input": 100,
            "output": 10,
            "balance": 90
          },
          "EUR": {
            "input": 100,
            "output": 10,
            "balance": 90
          }
        },
        "effectiveVolumes": {
          "USD": {
            "input": 100,
            "output": 10,
            "balance": 90
          },
          "EUR": {
            "input": 100,
            "output": 10,
            "balance": 90
          }
        }
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
resourcestringfalsenonenone
cursorobjecttruenonenone
» pageSizeinteger(int64)truenonenone
» hasMorebooleantruenonenone
» previousstringfalsenonenone
» nextstringfalsenonenone
» data[V2Account]truenonenone

Enumerated Values

PropertyValue
resourceaccounts

V2TransactionsCursorResponse

{
  "resource": "transactions",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "insertedAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "timestamp": "2019-08-24T14:15:22Z",
        "postings": [
          {
            "amount": 100,
            "asset": "COIN",
            "destination": "users:002",
            "source": "users:001"
          }
        ],
        "reference": "ref:001",
        "metadata": {
          "admin": "true"
        },
        "id": 0,
        "reverted": true,
        "revertedAt": "2019-08-24T14:15:22Z",
        "preCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "preCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "template": "string"
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
resourcestringfalsenonenone
cursorobjecttruenonenone
» pageSizeinteger(int64)truenonenone
» hasMorebooleantruenonenone
» previousstringfalsenonenone
» nextstringfalsenonenone
» data[V2Transaction]truenonenone

Enumerated Values

PropertyValue
resourcetransactions

V2LogsCursorResponse

{
  "resource": "logs",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "id": 1234,
        "type": "NEW_TRANSACTION",
        "data": {
          "transaction": {
            "id": 1234,
            "postings": [
              {
                "source": "world",
                "destination": "users:001",
                "amount": 100,
                "asset": "USD/2"
              }
            ],
            "metadata": {},
            "timestamp": "2024-01-15T10:30:00Z",
            "insertedAt": "2024-01-15T10:30:00Z",
            "reverted": false
          },
          "accountMetadata": {
            "users:001": {
              "created_by": "system"
            }
          }
        },
        "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
        "date": "2019-08-24T14:15:22Z",
        "schemaVersion": "v1.0.0"
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
resourcestringfalsenonenone
cursorobjecttruenonenone
» pageSizeinteger(int64)truenonenone
» hasMorebooleantruenonenone
» previousstringfalsenonenone
» nextstringfalsenonenone
» data[V2Log]truenone[Represents an immutable log entry in the ledger. Each log captures an atomic operation
with its full payload, enabling audit trails and event sourcing patterns.
The data field structure depends on the log type.
]

Enumerated Values

PropertyValue
resourcelogs

V2AccountResponse

{
  "data": {
    "address": "users:001",
    "metadata": {
      "admin": "true"
    },
    "insertionDate": "2023-01-01T00:00:00Z",
    "updatedAt": "2023-01-01T00:00:00Z",
    "firstUsage": "2023-01-01T00:00:00Z",
    "volumes": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      },
      "EUR": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "effectiveVolumes": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      },
      "EUR": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2Accounttruenonenone

V2AggregateBalancesResponse

{
  "data": {
    "USD": 100,
    "EUR": 12
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2AssetsBalancestruenonenone

V2VolumesWithBalanceCursorResponse

{
  "resource": "volumes",
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "account": "string",
        "asset": "string",
        "input": 0,
        "output": 0,
        "balance": 0
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
resourcestringfalsenonenone
cursorobjecttruenonenone
» pageSizeinteger(int64)truenonenone
» hasMorebooleantruenonenone
» previousstringfalsenonenone
» nextstringfalsenonenone
» data[V2VolumesWithBalance]truenonenone

Enumerated Values

PropertyValue
resourcevolumes

V2VolumesWithBalance

{
  "account": "string",
  "asset": "string",
  "input": 0,
  "output": 0,
  "balance": 0
}

Properties

NameTypeRequiredRestrictionsDescription
accountstringtruenonenone
assetstringtruenonenone
inputinteger(bigint)truenonenone
outputinteger(bigint)truenonenone
balanceinteger(bigint)truenonenone

V2Metadata

{
  "admin": "true"
}

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesstringfalsenonenone

V2ConfigInfo

{
  "server": "string",
  "version": "string",
  "experimentalFeatures": [
    "string"
  ]
}

Properties

NameTypeRequiredRestrictionsDescription
serverstringtruenonenone
versionstringtruenonenone
experimentalFeatures[string]falsenonenone

V2Account

{
  "address": "users:001",
  "metadata": {
    "admin": "true"
  },
  "insertionDate": "2023-01-01T00:00:00Z",
  "updatedAt": "2023-01-01T00:00:00Z",
  "firstUsage": "2023-01-01T00:00:00Z",
  "volumes": {
    "USD": {
      "input": 100,
      "output": 10,
      "balance": 90
    },
    "EUR": {
      "input": 100,
      "output": 10,
      "balance": 90
    }
  },
  "effectiveVolumes": {
    "USD": {
      "input": 100,
      "output": 10,
      "balance": 90
    },
    "EUR": {
      "input": 100,
      "output": 10,
      "balance": 90
    }
  }
}

Properties

NameTypeRequiredRestrictionsDescription
addressstringtruenonenone
metadataobjecttruenonenone
» additionalPropertiesstringfalsenonenone
insertionDatestring(date-time)falsenonenone
updatedAtstring(date-time)falsenonenone
firstUsagestring(date-time)falsenonenone
volumesV2Volumesfalsenonenone
effectiveVolumesV2Volumesfalsenonenone

V2AssetsBalances

{
  "USD": 100,
  "EUR": 12
}

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesinteger(bigint)falsenonenone

V2Posting

{
  "amount": 100,
  "asset": "COIN",
  "destination": "users:002",
  "source": "users:001"
}

Properties

NameTypeRequiredRestrictionsDescription
amountinteger(bigint)truenonenone
assetstringtruenonenone
destinationstringtruenonenone
sourcestringtruenonenone

V2Transaction

{
  "insertedAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "timestamp": "2019-08-24T14:15:22Z",
  "postings": [
    {
      "amount": 100,
      "asset": "COIN",
      "destination": "users:002",
      "source": "users:001"
    }
  ],
  "reference": "ref:001",
  "metadata": {
    "admin": "true"
  },
  "id": 0,
  "reverted": true,
  "revertedAt": "2019-08-24T14:15:22Z",
  "preCommitVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  },
  "postCommitVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  },
  "preCommitEffectiveVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  },
  "postCommitEffectiveVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  },
  "template": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
insertedAtstring(date-time)falsenonenone
updatedAtstring(date-time)falsenonenone
timestampstring(date-time)truenonenone
postings[V2Posting]truenonenone
referencestringfalsenonenone
metadataV2Metadatatruenonenone
idinteger(bigint)truenonenone
revertedbooleantruenonenone
revertedAtstring(date-time)falsenonenone
preCommitVolumesV2AggregatedVolumesfalsenonenone
postCommitVolumesV2AggregatedVolumesfalsenonenone
preCommitEffectiveVolumesV2AggregatedVolumesfalsenonenone
postCommitEffectiveVolumesV2AggregatedVolumesfalsenonenone
templatestringfalsenonenone

V2PostTransaction

{
  "timestamp": "2019-08-24T14:15:22Z",
  "postings": [
    {
      "amount": 100,
      "asset": "COIN",
      "destination": "users:002",
      "source": "users:001"
    }
  ],
  "script": {
    "template": "CUSTOMER_DEPOSIT",
    "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
    "vars": {
      "user": "users:042"
    }
  },
  "runtime": "experimental-interpreter",
  "reference": "ref:001",
  "metadata": {
    "admin": "true"
  },
  "accountMetadata": {
    "property1": {
      "admin": "true"
    },
    "property2": {
      "admin": "true"
    }
  },
  "force": true
}

Properties

NameTypeRequiredRestrictionsDescription
timestampstring(date-time)falsenonenone
postings[V2Posting]falsenonenone
scriptobjectfalsenonenone
» templatestringfalsenonenone
» plainstringfalsenonenone
» varsobjectfalsenonenone
»» additionalPropertiesstringfalsenonenone
runtimeRuntimefalsenoneThe numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed.
referencestringfalsenonenone
metadataV2Metadatatruenonenone
accountMetadataobjectfalsenonenone
» additionalPropertiesV2Metadatafalsenonenone
forcebooleanfalsenonenone

V2Stats

{
  "accounts": 0,
  "transactions": 0
}

Properties

NameTypeRequiredRestrictionsDescription
accountsinteger(int64)truenonenone
transactionsinteger(bigint)truenonenone

V2Log

{
  "id": 1234,
  "type": "NEW_TRANSACTION",
  "data": {
    "transaction": {
      "id": 1234,
      "postings": [
        {
          "source": "world",
          "destination": "users:001",
          "amount": 100,
          "asset": "USD/2"
        }
      ],
      "metadata": {},
      "timestamp": "2024-01-15T10:30:00Z",
      "insertedAt": "2024-01-15T10:30:00Z",
      "reverted": false
    },
    "accountMetadata": {
      "users:001": {
        "created_by": "system"
      }
    }
  },
  "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
  "date": "2019-08-24T14:15:22Z",
  "schemaVersion": "v1.0.0"
}

Represents an immutable log entry in the ledger. Each log captures an atomic operation with its full payload, enabling audit trails and event sourcing patterns. The data field structure depends on the log type.

Properties

NameTypeRequiredRestrictionsDescription
idinteger(bigint)truenoneUnique sequential identifier for this log entry within the ledger
typestringtruenoneThe type of operation this log represents
dataanytruenoneThe payload of the log entry. Structure depends on the log type:
- NEW_TRANSACTION: V2LogDataNewTransaction
- SET_METADATA: V2LogDataSetMetadata
- REVERTED_TRANSACTION: V2LogDataRevertedTransaction
- DELETE_METADATA: V2LogDataDeleteMetadata
- INSERTED_SCHEMA: V2LogDataInsertedSchema

oneOf

NameTypeRequiredRestrictionsDescription
» anonymousV2LogDataNewTransactionfalsenonePayload for NEW_TRANSACTION log entries. Contains the created transaction and any account metadata set during creation.

xor

NameTypeRequiredRestrictionsDescription
» anonymousV2LogDataSetMetadatafalsenonePayload for SET_METADATA log entries. Contains the target entity and the metadata that was set.

xor

NameTypeRequiredRestrictionsDescription
» anonymousV2LogDataRevertedTransactionfalsenonePayload for REVERTED_TRANSACTION log entries. Contains both the original reverted transaction and the new reverting transaction.

xor

NameTypeRequiredRestrictionsDescription
» anonymousV2LogDataDeleteMetadatafalsenonePayload for DELETE_METADATA log entries. Contains the target entity and the metadata key that was deleted.

xor

NameTypeRequiredRestrictionsDescription
» anonymousV2LogDataInsertedSchemafalsenonePayload for INSERTED_SCHEMA log entries. Contains the schema that was inserted into the ledger.

continued

NameTypeRequiredRestrictionsDescription
hashstringtruenoneSHA256 hash of the log entry, chained from the previous log for integrity verification
datestring(date-time)truenoneTimestamp when the operation was recorded
schemaVersionstringfalsenoneSchema version used for validation when the log was created

Enumerated Values

PropertyValue
typeNEW_TRANSACTION
typeSET_METADATA
typeREVERTED_TRANSACTION
typeDELETE_METADATA
typeINSERTED_SCHEMA

V2LogTransaction

{
  "id": 0,
  "postings": [
    {
      "amount": 100,
      "asset": "COIN",
      "destination": "users:002",
      "source": "users:001"
    }
  ],
  "metadata": {
    "admin": "true"
  },
  "timestamp": "2019-08-24T14:15:22Z",
  "reference": "string",
  "insertedAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "revertedAt": "2019-08-24T14:15:22Z",
  "reverted": true,
  "template": "string",
  "postCommitVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  },
  "postCommitEffectiveVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  },
  "preCommitVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  },
  "preCommitEffectiveVolumes": {
    "orders:1": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    },
    "orders:2": {
      "USD": {
        "input": 100,
        "output": 10,
        "balance": 90
      }
    }
  }
}

Transaction structure as it appears in log payloads

Properties

NameTypeRequiredRestrictionsDescription
idinteger(bigint)truenonenone
postings[V2Posting]truenonenone
metadataV2Metadatatruenonenone
timestampstring(date-time)truenonenone
referencestringfalsenonenone
insertedAtstring(date-time)falsenonenone
updatedAtstring(date-time)falsenonenone
revertedAtstring(date-time)falsenonenone
revertedbooleantruenoneIndicates if the transaction has been reverted
templatestringfalsenoneTransaction template used
postCommitVolumesV2AggregatedVolumesfalsenonenone
postCommitEffectiveVolumesV2AggregatedVolumesfalsenonenone
preCommitVolumesV2AggregatedVolumesfalsenonenone
preCommitEffectiveVolumesV2AggregatedVolumesfalsenonenone

V2LogDataNewTransaction

{
  "transaction": {
    "id": 1234,
    "postings": [
      {
        "source": "world",
        "destination": "users:001",
        "amount": 100,
        "asset": "USD/2"
      }
    ],
    "metadata": {},
    "timestamp": "2024-01-15T10:30:00Z",
    "insertedAt": "2024-01-15T10:30:00Z",
    "reverted": false
  },
  "accountMetadata": {
    "users:001": {
      "created_by": "system"
    }
  }
}

Payload for NEW_TRANSACTION log entries. Contains the created transaction and any account metadata set during creation.

Properties

NameTypeRequiredRestrictionsDescription
transactionV2LogTransactiontruenoneTransaction structure as it appears in log payloads
accountMetadataobjecttruenoneMetadata applied to accounts involved in the transaction
» additionalPropertiesV2Metadatafalsenonenone

V2LogDataSetMetadata

{
  "targetType": "ACCOUNT",
  "targetId": "users:001",
  "metadata": {
    "status": "active",
    "tier": "premium"
  }
}

Payload for SET_METADATA log entries. Contains the target entity and the metadata that was set.

Properties

NameTypeRequiredRestrictionsDescription
targetTypestringtruenoneType of the target entity
targetIdanytruenonenone

oneOf

NameTypeRequiredRestrictionsDescription
» anonymousstringfalsenoneAccount address (when targetType is ACCOUNT)

xor

NameTypeRequiredRestrictionsDescription
» anonymousinteger(bigint)falsenoneTransaction ID (when targetType is TRANSACTION)

continued

NameTypeRequiredRestrictionsDescription
metadataV2Metadatatruenonenone

Enumerated Values

PropertyValue
targetTypeACCOUNT
targetTypeTRANSACTION

V2LogDataRevertedTransaction

{
  "revertedTransaction": {
    "id": 1234,
    "postings": [
      {
        "source": "world",
        "destination": "users:001",
        "amount": 100,
        "asset": "USD/2"
      }
    ],
    "metadata": {},
    "timestamp": "2024-01-15T10:30:00Z",
    "reverted": true
  },
  "transaction": {
    "id": 1235,
    "postings": [
      {
        "source": "users:001",
        "destination": "world",
        "amount": 100,
        "asset": "USD/2"
      }
    ],
    "metadata": {
      "revert": "1234"
    },
    "timestamp": "2024-01-15T11:00:00Z",
    "reverted": false
  }
}

Payload for REVERTED_TRANSACTION log entries. Contains both the original reverted transaction and the new reverting transaction.

Properties

NameTypeRequiredRestrictionsDescription
revertedTransactionV2LogTransactiontruenoneThe original transaction that was reverted
transactionV2LogTransactiontruenoneThe new reverting transaction created to cancel the original

V2LogDataDeleteMetadata

{
  "targetType": "ACCOUNT",
  "targetId": "users:001",
  "key": "temporary_flag"
}

Payload for DELETE_METADATA log entries. Contains the target entity and the metadata key that was deleted.

Properties

NameTypeRequiredRestrictionsDescription
targetTypestringtruenoneType of the target entity
targetIdanytruenonenone

oneOf

NameTypeRequiredRestrictionsDescription
» anonymousstringfalsenoneAccount address (when targetType is ACCOUNT)

xor

NameTypeRequiredRestrictionsDescription
» anonymousinteger(bigint)falsenoneTransaction ID (when targetType is TRANSACTION)

continued

NameTypeRequiredRestrictionsDescription
keystringtruenoneThe metadata key that was deleted

Enumerated Values

PropertyValue
targetTypeACCOUNT
targetTypeTRANSACTION

V2LogDataInsertedSchema

{
  "schema": {
    "version": "v1.0.0",
    "createdAt": "2023-01-01T00:00:00Z",
    "chart": {
      "users": {
        "$userID": {
          ".pattern": "^[0-9]{16}$"
        }
      }
    },
    "transactions": {
      "property1": {
        "description": "string",
        "script": "string",
        "runtime": "experimental-interpreter"
      },
      "property2": {
        "description": "string",
        "script": "string",
        "runtime": "experimental-interpreter"
      }
    },
    "queries": {
      "property1": {
        "description": "string",
        "resource": "transactions",
        "params": {
          "pageSize": 100,
          "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
          "expand": "string",
          "pit": "2019-08-24T14:15:22Z",
          "sort": "id:desc",
          "resource": "accounts"
        },
        "vars": {
          "property1": {
            "type": "string",
            "default": null
          },
          "property2": {
            "type": "string",
            "default": null
          }
        },
        "body": {}
      },
      "property2": {
        "description": "string",
        "resource": "transactions",
        "params": {
          "pageSize": 100,
          "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
          "expand": "string",
          "pit": "2019-08-24T14:15:22Z",
          "sort": "id:desc",
          "resource": "accounts"
        },
        "vars": {
          "property1": {
            "type": "string",
            "default": null
          },
          "property2": {
            "type": "string",
            "default": null
          }
        },
        "body": {}
      }
    }
  }
}

Payload for INSERTED_SCHEMA log entries. Contains the schema that was inserted into the ledger.

Properties

NameTypeRequiredRestrictionsDescription
schemaV2SchematruenoneComplete schema structure with metadata

V2CreateTransactionResponse

{
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2Transactiontruenonenone

V2RevertTransactionResponse

{
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Properties

None

V2GetTransactionResponse

{
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2Transactiontruenonenone

V2StatsResponse

{
  "data": {
    "accounts": 0,
    "transactions": 0
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2Statstruenonenone

V2ConfigInfoResponse

{
  "server": "string",
  "version": "string",
  "experimentalFeatures": [
    "string"
  ]
}

Properties

None

V2Volume

{
  "input": 100,
  "output": 20,
  "balance": 80
}

Properties

NameTypeRequiredRestrictionsDescription
inputinteger(bigint)truenonenone
outputinteger(bigint)truenonenone
balanceinteger(bigint)falsenonenone

V2Volumes

{
  "USD": {
    "input": 100,
    "output": 10,
    "balance": 90
  },
  "EUR": {
    "input": 100,
    "output": 10,
    "balance": 90
  }
}

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesV2Volumefalsenonenone

V2AggregatedVolumes

{
  "orders:1": {
    "USD": {
      "input": 100,
      "output": 10,
      "balance": 90
    }
  },
  "orders:2": {
    "USD": {
      "input": 100,
      "output": 10,
      "balance": 90
    }
  }
}

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesV2Volumesfalsenonenone

V2ErrorResponse

{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Properties

NameTypeRequiredRestrictionsDescription
errorCodeV2ErrorsEnumtruenonenone
errorMessagestringtruenonenone
detailsstringfalsenonenone

V2ErrorsEnum

"VALIDATION"

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousINTERNAL
anonymousINSUFFICIENT_FUND
anonymousVALIDATION
anonymousCONFLICT
anonymousCOMPILATION_FAILED
anonymousMETADATA_OVERRIDE
anonymousNOT_FOUND
anonymousREVERT_OCCURRING
anonymousALREADY_REVERT
anonymousNO_POSTINGS
anonymousLEDGER_NOT_FOUND
anonymousIMPORT
anonymousTIMEOUT
anonymousBULK_SIZE_EXCEEDED
anonymousINTERPRETER_PARSE
anonymousINTERPRETER_RUNTIME
anonymousLEDGER_ALREADY_EXISTS
anonymousSCHEMA_ALREADY_EXISTS
anonymousSCHEMA_NOT_SPECIFIED
anonymousOUTDATED_SCHEMA

V2LedgerInfoResponse

{
  "data": {
    "name": "ledger001",
    "storage": {
      "migrations": [
        {
          "version": 11,
          "name": "migrations:001",
          "date": "2019-08-24T14:15:22Z",
          "state": "TO DO"
        }
      ]
    }
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2LedgerInfofalsenonenone

V2LedgerInfo

{
  "name": "ledger001",
  "storage": {
    "migrations": [
      {
        "version": 11,
        "name": "migrations:001",
        "date": "2019-08-24T14:15:22Z",
        "state": "TO DO"
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
namestringfalsenonenone
storageobjectfalsenonenone
» migrations[V2MigrationInfo]falsenonenone

V2MigrationInfo

{
  "version": 11,
  "name": "migrations:001",
  "date": "2019-08-24T14:15:22Z",
  "state": "TO DO"
}

Properties

NameTypeRequiredRestrictionsDescription
versionstringfalsenonenone
namestringfalsenonenone
datestring(date-time)falsenonenone
statestringfalsenonenone

Enumerated Values

PropertyValue
stateTO DO
stateDONE
statePROGRESS

V2Bulk

[
  {
    "action": "string",
    "ik": "string",
    "data": {
      "timestamp": "2019-08-24T14:15:22Z",
      "postings": [
        {
          "amount": 100,
          "asset": "COIN",
          "destination": "users:002",
          "source": "users:001"
        }
      ],
      "script": {
        "template": "CUSTOMER_DEPOSIT",
        "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
        "vars": {
          "user": "users:042"
        }
      },
      "runtime": "experimental-interpreter",
      "reference": "ref:001",
      "metadata": {
        "admin": "true"
      },
      "accountMetadata": {
        "property1": {
          "admin": "true"
        },
        "property2": {
          "admin": "true"
        }
      },
      "force": true
    }
  }
]

Properties

NameTypeRequiredRestrictionsDescription
anonymous[V2BulkElement]falsenonenone

V2BaseBulkElement

{
  "action": "string",
  "ik": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
actionstringtruenonenone
ikstringfalsenonenone

V2BulkElement

{
  "action": "string",
  "ik": "string",
  "data": {
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "script": {
      "template": "CUSTOMER_DEPOSIT",
      "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
      "vars": {
        "user": "users:042"
      }
    },
    "runtime": "experimental-interpreter",
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "accountMetadata": {
      "property1": {
        "admin": "true"
      },
      "property2": {
        "admin": "true"
      }
    },
    "force": true
  }
}

Properties

oneOf

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementCreateTransactionfalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementAddMetadatafalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementRevertTransactionfalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementDeleteMetadatafalsenonenone

V2BulkElementCreateTransaction

{
  "action": "string",
  "ik": "string",
  "data": {
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "script": {
      "template": "CUSTOMER_DEPOSIT",
      "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
      "vars": {
        "user": "users:042"
      }
    },
    "runtime": "experimental-interpreter",
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "accountMetadata": {
      "property1": {
        "admin": "true"
      },
      "property2": {
        "admin": "true"
      }
    },
    "force": true
  }
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2BaseBulkElementfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» dataV2PostTransactionfalsenonenone

V2TargetId

"string"

Properties

oneOf

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousinteger(bigint)falsenonenone

V2TargetType

"TRANSACTION"

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousTRANSACTION
anonymousACCOUNT

V2BulkElementAddMetadata

{
  "action": "string",
  "ik": "string",
  "data": {
    "targetId": "string",
    "targetType": "TRANSACTION",
    "metadata": {
      "property1": "string",
      "property2": "string"
    }
  }
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2BaseBulkElementfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» dataobjectfalsenonenone
»» targetIdV2TargetIdtruenonenone
»» targetTypeV2TargetTypetruenonenone
»» metadataobjecttruenonenone
»»» additionalPropertiesstringfalsenonenone

V2BulkElementRevertTransaction

{
  "action": "string",
  "ik": "string",
  "data": {
    "id": 0,
    "force": true,
    "atEffectiveDate": true,
    "metadata": {
      "admin": "true"
    }
  }
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2BaseBulkElementfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» dataobjectfalsenonenone
»» idinteger(bigint)truenonenone
»» forcebooleanfalsenonenone
»» atEffectiveDatebooleanfalsenonenone
»» metadataV2Metadatafalsenonenone

V2BulkElementDeleteMetadata

{
  "action": "string",
  "ik": "string",
  "data": {
    "targetId": "string",
    "targetType": "TRANSACTION",
    "key": "string"
  }
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2BaseBulkElementfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» dataobjectfalsenonenone
»» targetIdV2TargetIdtruenonenone
»» targetTypeV2TargetTypetruenonenone
»» keystringtruenonenone

V2BulkResponse

{
  "data": [
    {
      "responseType": "string",
      "logID": 0,
      "data": {
        "insertedAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "timestamp": "2019-08-24T14:15:22Z",
        "postings": [
          {
            "amount": 100,
            "asset": "COIN",
            "destination": "users:002",
            "source": "users:001"
          }
        ],
        "reference": "ref:001",
        "metadata": {
          "admin": "true"
        },
        "id": 0,
        "reverted": true,
        "revertedAt": "2019-08-24T14:15:22Z",
        "preCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "preCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "template": "string"
      }
    }
  ],
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param"
}

Properties

NameTypeRequiredRestrictionsDescription
data[V2BulkElementResult]falsenonenone
errorCodeV2ErrorsEnumfalsenonenone
errorMessagestringfalsenonenone

V2BulkElementResult

{
  "responseType": "string",
  "logID": 0,
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Properties

oneOf

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementResultCreateTransactionfalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementResultAddMetadatafalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementResultRevertTransactionfalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementResultDeleteMetadatafalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousV2BulkElementResultErrorfalsenonenone

V2BaseBulkElementResult

{
  "responseType": "string",
  "logID": 0
}

Properties

NameTypeRequiredRestrictionsDescription
responseTypestringtruenonenone
logIDintegertruenonenone

V2BulkElementResultCreateTransaction

{
  "responseType": "string",
  "logID": 0,
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2BaseBulkElementResultfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» dataV2Transactiontruenonenone

V2BulkElementResultAddMetadata

{
  "responseType": "string",
  "logID": 0
}

Properties

None

V2BulkElementResultRevertTransaction

{
  "responseType": "string",
  "logID": 0,
  "data": {
    "insertedAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "timestamp": "2019-08-24T14:15:22Z",
    "postings": [
      {
        "amount": 100,
        "asset": "COIN",
        "destination": "users:002",
        "source": "users:001"
      }
    ],
    "reference": "ref:001",
    "metadata": {
      "admin": "true"
    },
    "id": 0,
    "reverted": true,
    "revertedAt": "2019-08-24T14:15:22Z",
    "preCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "preCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "postCommitEffectiveVolumes": {
      "orders:1": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      },
      "orders:2": {
        "USD": {
          "input": 100,
          "output": 10,
          "balance": 90
        }
      }
    },
    "template": "string"
  }
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2BaseBulkElementResultfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» dataV2Transactiontruenonenone

V2BulkElementResultDeleteMetadata

{
  "responseType": "string",
  "logID": 0
}

Properties

None

V2BulkElementResultError

{
  "responseType": "string",
  "logID": 0,
  "errorCode": "string",
  "errorDescription": "string",
  "errorDetails": "string"
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2BaseBulkElementResultfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» errorCodestringtruenonenone
» errorDescriptionstringtruenonenone
» errorDetailsstringfalsenonenone

V2ChartAccountRules

{}

Properties

None

V2ChartAccountMetadata

{
  "default": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
defaultstringfalsenonenone

V2ChartSegment

{
  "users": {
    "$userID": {
      ".pattern": "^[0-9]{16}$"
    }
  }
}

Segment within a chart of accounts

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesV2ChartSegmentfalsenoneSegment within a chart of accounts
.selfobjectfalsenonenone
.patternstringfalsenonenone
.rulesV2ChartAccountRulesfalsenonenone
.metadataobjectfalsenonenone
» additionalPropertiesV2ChartAccountMetadatafalsenonenone

V2ChartOfAccounts

{
  "users": {
    "$userID": {
      ".pattern": "^[0-9]{16}$"
    }
  }
}

Chart of account

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesV2ChartSegmentfalsenoneSegment within a chart of accounts

Runtime

"experimental-interpreter"

The numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed.

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenoneThe numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed.

Enumerated Values

PropertyValue
anonymousexperimental-interpreter
anonymousmachine

V2TransactionTemplate

{
  "description": "string",
  "script": "string",
  "runtime": "experimental-interpreter"
}

Properties

NameTypeRequiredRestrictionsDescription
descriptionstringfalsenonenone
scriptstringtruenonenone
runtimeRuntimefalsenoneThe numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed.

V2TransactionTemplates

{
  "property1": {
    "description": "string",
    "script": "string",
    "runtime": "experimental-interpreter"
  },
  "property2": {
    "description": "string",
    "script": "string",
    "runtime": "experimental-interpreter"
  }
}

Transaction templates

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesV2TransactionTemplatefalsenonenone

V2QueryTemplateVar

{
  "type": "string",
  "default": null
}

Properties

NameTypeRequiredRestrictionsDescription
typestringtruenonenone
defaultanyfalsenonenone

V2QueryResource

"transactions"

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymoustransactions
anonymousaccounts
anonymouslogs
anonymousvolumes

V2QueryParams

{
  "pageSize": 100,
  "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
  "expand": "string",
  "pit": "2019-08-24T14:15:22Z",
  "sort": "id:desc",
  "resource": "accounts"
}

Properties

NameTypeRequiredRestrictionsDescription
pageSizeinteger(int64)falsenoneThe maximum number of results to return per page.
cursorstringfalsenoneParameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
expandstringfalsenonenone
pitstring(date-time)falsenonenone
sortstringfalsenoneSort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

oneOf

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» resourcestringtruenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» resourcestringtruenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» resourcestringtruenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» resourcestringtruenonenone
» insertionDatebooleanfalsenonenone
» groupByintegerfalsenonenone

Enumerated Values

PropertyValue
resourceaccounts
resourcetransactions
resourcelogs
resourcevolumes

V2QueryTemplate

{
  "description": "string",
  "resource": "transactions",
  "params": {
    "pageSize": 100,
    "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
    "expand": "string",
    "pit": "2019-08-24T14:15:22Z",
    "sort": "id:desc",
    "resource": "accounts"
  },
  "vars": {
    "property1": {
      "type": "string",
      "default": null
    },
    "property2": {
      "type": "string",
      "default": null
    }
  },
  "body": {}
}

Properties

NameTypeRequiredRestrictionsDescription
descriptionstringfalsenonenone
resourceV2QueryResourcefalsenonenone
paramsV2QueryParamsfalsenonenone
varsobjectfalsenonenone
» additionalPropertiesV2QueryTemplateVarfalsenonenone
bodyobjectfalsenonenone

V2QueryTemplates

{
  "property1": {
    "description": "string",
    "resource": "transactions",
    "params": {
      "pageSize": 100,
      "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
      "expand": "string",
      "pit": "2019-08-24T14:15:22Z",
      "sort": "id:desc",
      "resource": "accounts"
    },
    "vars": {
      "property1": {
        "type": "string",
        "default": null
      },
      "property2": {
        "type": "string",
        "default": null
      }
    },
    "body": {}
  },
  "property2": {
    "description": "string",
    "resource": "transactions",
    "params": {
      "pageSize": 100,
      "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
      "expand": "string",
      "pit": "2019-08-24T14:15:22Z",
      "sort": "id:desc",
      "resource": "accounts"
    },
    "vars": {
      "property1": {
        "type": "string",
        "default": null
      },
      "property2": {
        "type": "string",
        "default": null
      }
    },
    "body": {}
  }
}

Query templates

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesV2QueryTemplatefalsenonenone

V2SchemaData

{
  "chart": {
    "users": {
      "$userID": {
        ".pattern": "^[0-9]{16}$"
      }
    }
  },
  "transactions": {
    "property1": {
      "description": "string",
      "script": "string",
      "runtime": "experimental-interpreter"
    },
    "property2": {
      "description": "string",
      "script": "string",
      "runtime": "experimental-interpreter"
    }
  },
  "queries": {
    "property1": {
      "description": "string",
      "resource": "transactions",
      "params": {
        "pageSize": 100,
        "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
        "expand": "string",
        "pit": "2019-08-24T14:15:22Z",
        "sort": "id:desc",
        "resource": "accounts"
      },
      "vars": {
        "property1": {
          "type": "string",
          "default": null
        },
        "property2": {
          "type": "string",
          "default": null
        }
      },
      "body": {}
    },
    "property2": {
      "description": "string",
      "resource": "transactions",
      "params": {
        "pageSize": 100,
        "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
        "expand": "string",
        "pit": "2019-08-24T14:15:22Z",
        "sort": "id:desc",
        "resource": "accounts"
      },
      "vars": {
        "property1": {
          "type": "string",
          "default": null
        },
        "property2": {
          "type": "string",
          "default": null
        }
      },
      "body": {}
    }
  }
}

Schema data structure for ledger schemas

Properties

NameTypeRequiredRestrictionsDescription
chartV2ChartOfAccountstruenoneChart of account
transactionsV2TransactionTemplatesfalsenoneTransaction templates
queriesV2QueryTemplatesfalsenoneQuery templates

V2Schema

{
  "version": "v1.0.0",
  "createdAt": "2023-01-01T00:00:00Z",
  "chart": {
    "users": {
      "$userID": {
        ".pattern": "^[0-9]{16}$"
      }
    }
  },
  "transactions": {
    "property1": {
      "description": "string",
      "script": "string",
      "runtime": "experimental-interpreter"
    },
    "property2": {
      "description": "string",
      "script": "string",
      "runtime": "experimental-interpreter"
    }
  },
  "queries": {
    "property1": {
      "description": "string",
      "resource": "transactions",
      "params": {
        "pageSize": 100,
        "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
        "expand": "string",
        "pit": "2019-08-24T14:15:22Z",
        "sort": "id:desc",
        "resource": "accounts"
      },
      "vars": {
        "property1": {
          "type": "string",
          "default": null
        },
        "property2": {
          "type": "string",
          "default": null
        }
      },
      "body": {}
    },
    "property2": {
      "description": "string",
      "resource": "transactions",
      "params": {
        "pageSize": 100,
        "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
        "expand": "string",
        "pit": "2019-08-24T14:15:22Z",
        "sort": "id:desc",
        "resource": "accounts"
      },
      "vars": {
        "property1": {
          "type": "string",
          "default": null
        },
        "property2": {
          "type": "string",
          "default": null
        }
      },
      "body": {}
    }
  }
}

Complete schema structure with metadata

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» versionstringtruenoneSchema version
» createdAtstring(date-time)truenoneSchema creation timestamp

and

NameTypeRequiredRestrictionsDescription
anonymousV2SchemaDatafalsenoneSchema data structure for ledger schemas

V2SchemaResponse

{
  "data": {
    "version": "v1.0.0",
    "createdAt": "2023-01-01T00:00:00Z",
    "chart": {
      "users": {
        "$userID": {
          ".pattern": "^[0-9]{16}$"
        }
      }
    },
    "transactions": {
      "property1": {
        "description": "string",
        "script": "string",
        "runtime": "experimental-interpreter"
      },
      "property2": {
        "description": "string",
        "script": "string",
        "runtime": "experimental-interpreter"
      }
    },
    "queries": {
      "property1": {
        "description": "string",
        "resource": "transactions",
        "params": {
          "pageSize": 100,
          "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
          "expand": "string",
          "pit": "2019-08-24T14:15:22Z",
          "sort": "id:desc",
          "resource": "accounts"
        },
        "vars": {
          "property1": {
            "type": "string",
            "default": null
          },
          "property2": {
            "type": "string",
            "default": null
          }
        },
        "body": {}
      },
      "property2": {
        "description": "string",
        "resource": "transactions",
        "params": {
          "pageSize": 100,
          "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
          "expand": "string",
          "pit": "2019-08-24T14:15:22Z",
          "sort": "id:desc",
          "resource": "accounts"
        },
        "vars": {
          "property1": {
            "type": "string",
            "default": null
          },
          "property2": {
            "type": "string",
            "default": null
          }
        },
        "body": {}
      }
    }
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2SchematruenoneComplete schema structure with metadata

V2SchemasCursorResponse

{
  "cursor": {
    "data": [
      {
        "version": "v1.0.0",
        "createdAt": "2023-01-01T00:00:00Z",
        "chart": {
          "users": {
            "$userID": {
              ".pattern": "^[0-9]{16}$"
            }
          }
        },
        "transactions": {
          "property1": {
            "description": "string",
            "script": "string",
            "runtime": "experimental-interpreter"
          },
          "property2": {
            "description": "string",
            "script": "string",
            "runtime": "experimental-interpreter"
          }
        },
        "queries": {
          "property1": {
            "description": "string",
            "resource": "transactions",
            "params": {
              "pageSize": 100,
              "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
              "expand": "string",
              "pit": "2019-08-24T14:15:22Z",
              "sort": "id:desc",
              "resource": "accounts"
            },
            "vars": {
              "property1": {
                "type": "string",
                "default": null
              },
              "property2": {
                "type": "string",
                "default": null
              }
            },
            "body": {}
          },
          "property2": {
            "description": "string",
            "resource": "transactions",
            "params": {
              "pageSize": 100,
              "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
              "expand": "string",
              "pit": "2019-08-24T14:15:22Z",
              "sort": "id:desc",
              "resource": "accounts"
            },
            "vars": {
              "property1": {
                "type": "string",
                "default": null
              },
              "property2": {
                "type": "string",
                "default": null
              }
            },
            "body": {}
          }
        }
      }
    ],
    "hasMore": true,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "pageSize": 0
  }
}

Properties

NameTypeRequiredRestrictionsDescription
cursorV2SchemasCursortruenonenone

V2SchemasCursor

{
  "data": [
    {
      "version": "v1.0.0",
      "createdAt": "2023-01-01T00:00:00Z",
      "chart": {
        "users": {
          "$userID": {
            ".pattern": "^[0-9]{16}$"
          }
        }
      },
      "transactions": {
        "property1": {
          "description": "string",
          "script": "string",
          "runtime": "experimental-interpreter"
        },
        "property2": {
          "description": "string",
          "script": "string",
          "runtime": "experimental-interpreter"
        }
      },
      "queries": {
        "property1": {
          "description": "string",
          "resource": "transactions",
          "params": {
            "pageSize": 100,
            "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
            "expand": "string",
            "pit": "2019-08-24T14:15:22Z",
            "sort": "id:desc",
            "resource": "accounts"
          },
          "vars": {
            "property1": {
              "type": "string",
              "default": null
            },
            "property2": {
              "type": "string",
              "default": null
            }
          },
          "body": {}
        },
        "property2": {
          "description": "string",
          "resource": "transactions",
          "params": {
            "pageSize": 100,
            "cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
            "expand": "string",
            "pit": "2019-08-24T14:15:22Z",
            "sort": "id:desc",
            "resource": "accounts"
          },
          "vars": {
            "property1": {
              "type": "string",
              "default": null
            },
            "property2": {
              "type": "string",
              "default": null
            }
          },
          "body": {}
        }
      }
    }
  ],
  "hasMore": true,
  "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
  "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
  "pageSize": 0
}

Properties

NameTypeRequiredRestrictionsDescription
data[V2Schema]truenone[Complete schema structure with metadata]
hasMorebooleantruenonenone
previousstringfalsenonenone
nextstringfalsenonenone
pageSizeintegertruenonenone

V2CreateLedgerRequest

{
  "bucket": "string",
  "metadata": {
    "admin": "true"
  },
  "features": {
    "property1": "string",
    "property2": "string"
  }
}

Properties

NameTypeRequiredRestrictionsDescription
bucketstringfalsenonenone
metadataV2Metadatafalsenonenone
featuresobjectfalsenonenone
» additionalPropertiesstringfalsenonenone

V2Ledger

{
  "name": "string",
  "addedAt": "2019-08-24T14:15:22Z",
  "bucket": "string",
  "deletedAt": "2019-08-24T14:15:22Z",
  "metadata": {
    "admin": "true"
  },
  "features": {
    "property1": "string",
    "property2": "string"
  },
  "id": 0
}

Properties

NameTypeRequiredRestrictionsDescription
namestringtruenonenone
addedAtstring(date-time)truenonenone
bucketstringtruenonenone
deletedAtstring(date-time)¦nullfalsenonenone
metadataV2Metadatafalsenonenone
featuresobjectfalsenonenone
» additionalPropertiesstringfalsenonenone
idintegerfalsenonenone

V2LedgerListResponse

{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
    "data": [
      {
        "name": "string",
        "addedAt": "2019-08-24T14:15:22Z",
        "bucket": "string",
        "deletedAt": "2019-08-24T14:15:22Z",
        "metadata": {
          "admin": "true"
        },
        "features": {
          "property1": "string",
          "property2": "string"
        },
        "id": 0
      }
    ]
  }
}

Properties

NameTypeRequiredRestrictionsDescription
cursorobjecttruenonenone
» pageSizeinteger(int64)truenonenone
» hasMorebooleantruenonenone
» previousstringfalsenonenone
» nextstringfalsenonenone
» data[V2Ledger]truenonenone

V2UpdateLedgerMetadataRequest

{
  "admin": "true"
}

Properties

None

V2GetLedgerResponse

{
  "data": {
    "name": "string",
    "addedAt": "2019-08-24T14:15:22Z",
    "bucket": "string",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metadata": {
      "admin": "true"
    },
    "features": {
      "property1": "string",
      "property2": "string"
    },
    "id": 0
  }
}

Properties

NameTypeRequiredRestrictionsDescription
dataV2Ledgertruenonenone

V2ImportLogsRequest

{
  "file": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
filestring(binary)truenonenone

V2RevertTransactionRequest

{
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}

Properties

NameTypeRequiredRestrictionsDescription
metadataobjectfalsenonenone
» additionalPropertiesstringfalsenonenone

V2CreatePipelineRequest

{
  "exporterID": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
exporterIDstringtruenonenone

V2CreateExporterRequest

{
  "driver": "string",
  "config": {}
}

Properties

None

V2UpdateExporterRequest

{
  "driver": "string",
  "config": {}
}

Properties

None

V2PipelineConfiguration

{
  "ledger": "string",
  "exporterID": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
ledgerstringtruenonenone
exporterIDstringtruenonenone

V2ExporterConfiguration

{
  "driver": "string",
  "config": {}
}

Properties

NameTypeRequiredRestrictionsDescription
driverstringtruenonenone
configobjecttruenonenone

V2Exporter

{
  "driver": "string",
  "config": {},
  "id": "string",
  "createdAt": "2019-08-24T14:15:22Z"
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2ExporterConfigurationfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» idstringtruenonenone
» createdAtstring(date-time)truenonenone

V2Pipeline

{
  "id": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "lastLogID": 0,
  "enabled": true
}

Properties

allOf

NameTypeRequiredRestrictionsDescription
anonymousV2PipelineConfigurationfalsenonenone

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
» idstringtruenonenone
» createdAtstring(date-time)truenonenone
» lastLogIDintegerfalsenonenone
» enabledbooleanfalsenonenone