Ledger Enterprise
API Documentation V2
API Documentation V2
  • Introduction
    • Getting Started
    • Overview
  • Guides
    • Authentication
    • Balance Reporting Bot
      • 1. Project setup
      • 2. Connect to revault-api
      • 3. Fetch accounts balances
      • 4. Conclusion
  • reference
    • API reference
      • Users
      • Accounts
        • Transactions
      • Groups
      • Whitelists
      • Policies
      • Entities
      • Requests
        • Generate registration challenge
        • Confirm registration challenge
        • Challenge
        • Approve
        • Reject
      • Auth
        • Token
          • Refresh
      • Permissions
        • Allowed actions
        • Resources
      • Assets
        • Currencies
        • Tokens
      • Tradelink
        • Network
          • Blueprint
    • Specification
Powered by GitBook
On this page
  • Endpoints structure ​
  • Data validation ​
  • Pagination and filtering ​
  1. Introduction

Overview

PreviousGetting StartedNextAuthentication

Authentication ​

Authentication is done using standard. Once token is obtained, it must be attached to requests headers:

text

Authorization: Bearer <token>

For a detailed walkthrough on how to authenticate, see dedicated page Authentication.

Authorization ​

Access rights & permissions for the current user are retrieved from the Vault orchestration layer. Check on Vault Help Center.

Endpoints structure ​

Base URL ​

Here is the base URL that will be used as $BASE_URL in all the documentation pages:

https://re.vault.ledger.com/v1/rest

Requests headers ​

All the requests are expecting JSON response, and should have this header:

Content-Type: application/json

Data validation ​

All the query params (for GET requests) and request payloads (for POST, PUT requests) are strictly validated against the expected schema (see API reference).

If the match isn't successful, API will answer with HTTP 400 status, with an error detailing what is wrong.

Pagination and filtering ​

Page-based pagination ​

For most of the endpoints that returns multiple items of the same type, data will be paginated following this structure:

ts

type Paginated<T> = {
  // the current page
  page: number;
  // the next page (or null if there is none)
  next: number | null;
  // the previous page (or null if there is none)
  prev: number | null;
  // the max count of items per page
  pageSize: number;
  // the total count of items
  total: number;
  // the page data
  results: T[];
};

Other pages can be fetched on the same endpoint with ?page=<number>.

Cursor-based pagination ​

For some endpoints where the data is fetched from external sources (e.g: list of transactions), a cursor-based pagination is used, allowing you to discover the data page-by-page.

ts

type CursorPaginated<T> = {
  // cursor for next page (or null if there is none)
  next: string | null;
  // the page data
  results: T[];
};

Next page can be fetched on the same endpoint with ?cursor=<string>.

Filtering ​

The search filters (and sort parameters) are retrieved from query params. You'll find the supported parameters on the dedicated endpoint reference pages (see Reference).

JSON Web Token ↗
User roles and permissions ↗