Sub-accounts

Sub-accounts are a feature of the Truvera API that allows Truvera's enterprise customers to segregate their data within the Truvera platform based on their own customers. Each sub-account can have its own keys, organization profiles, credential designs and verification templates conveniently organized to help with tracking and auditing of the activity performed by each.

When using a sub-account the parent account will set up separate API keys for each sub-account and then use the sub-account specific API key for the transactions associated with that sub-account.

In order to easier manage sub-account assets Ecosystem Tools can be used.

Sample sub-account Postman collection

Download the collection here.

This Postman collection shows a simple example of sub-account set up in 5 steps:

  1. Creating a sub-account

  2. Creating an API key for a sub-account

  3. Creating a DID for the sub-account

  4. Inviting sub-account as a participant in an already existing ecosystem

  5. Accepting the invite

Create sub-account

Sub-accounts are limited to 5 for trial users. The amount of sub-accounts for customers with subscription varies depending on the subscription plan.

Create a Sub-account

post
Authorizations
Body
namestringRequired

The sub account name

imagestringOptional

The sub account image

Responses
200
Subaccount has been created
application/json
post
POST /subaccounts HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 30

{
  "name": "text",
  "image": "text"
}
{
  "id": 1,
  "name": "text",
  "email": "text",
  "image": "text",
  "createdAt": "2024-09-20T11:13:03.445Z"
}

List sub-accounts

List all Subaccounts

get
Authorizations
Query parameters
newFormatbooleanOptional

Whether to use updated array format for the response

Default: false
offsetinteger · int32Optional

How many items to offset by for pagination

Default: 0
limitinteger · int32 · min: 1 · max: 64Optional

How many items to return at one time (max 64)

Default: 64
Responses
200
A paged array of subaccounts
application/json
Responseone of
or
get
GET /subaccounts HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
200

A paged array of subaccounts

[
  {
    "id": 1,
    "name": "text",
    "email": "text",
    "image": "text",
    "createdAt": "2024-09-20T11:13:03.445Z"
  }
]

Get sub-account by ID

Info for a specific sub-account by ID

get
Authorizations
Path parameters
idintegerRequired

An subaccount ID

Responses
200
Expected response to a valid request
application/json
get
GET /subaccounts/{id} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
{
  "id": 1,
  "name": "text",
  "email": "text",
  "image": "text",
  "createdAt": "2024-09-20T11:13:03.445Z"
}

Update the specified sub-account

Update a sub-account

patch
Authorizations
Path parameters
idstringRequired

An ID

Body
namestringRequired

The sub account name

imagestringOptional

The sub account image

Responses
200
Subaccount has been updated
application/json
patch
PATCH /subaccounts/{id} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 30

{
  "name": "text",
  "image": "text"
}
{
  "id": 1,
  "name": "text",
  "email": "text",
  "image": "text",
  "createdAt": "2024-09-20T11:13:03.445Z"
}

Deletes the specified sub-account

Deletes a single sub-account

delete
Authorizations
Path parameters
idstringRequired

An ID

Responses
200
Subaccount deleted
delete
DELETE /subaccounts/{id} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*

No content

Get sub-account usage

Get details about the activity that this sub-account has performed in the system.

Lists transaction usage for this sub account

get
Authorizations
Path parameters
idintegerRequired

An subaccount ID

Query parameters
startTimestring · date-timeOptional

Timestamp for the start of the range (ISO 8601)

endTimestring · date-timeOptional

Timestamp for the end of the range (ISO 8601)

offsetinteger · int32Optional

How many items to offset by for pagination

Default: 0
limitinteger · int32 · min: 1 · max: 64Optional

How many items to return at one time (max 64)

Default: 64
Responses
200
A paged array of subaccount transaction usage metadata
application/json
Responseobject[]

Default response

get
GET /subaccounts/{id}/usage HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
[
  {}
]

Create sub-account API key

Creates an API key for a sub-account. In order for activity to be associated with the given sub-account an API key needs to be created for that sub-account and then that key must be used for all transactions related to that sub-account.

Creates an API key for a subaccount

post
Authorizations
Path parameters
idinteger · int32Required

An subaccount ID

Body
objectOptional
Responses
200
Subaccoun API key created
application/json
post
POST /subaccounts/{id}/keys HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
{
  "code": 1
}

List sub-account API keys

List all subaccount keys

get
Authorizations
Path parameters
idstringRequired

An ID

Query parameters
offsetinteger · int32Optional

How many items to offset by for pagination

Default: 0
limitinteger · int32 · min: 1 · max: 64Optional

How many items to return at one time (max 64)

Default: 64
Responses
200
A paged array of subaccount key metadata
application/json
Responseobject[]

Default response

get
GET /subaccounts/{id}/keys HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
[
  {}
]

Delete a sub-account API key

Delete the specified API key for the given sub-account.

Deletes a sub-account API key

delete
Authorizations
Path parameters
idinteger · int32Required

An subaccount ID

keyIdstringRequired

An API key ID

Responses
200
Subaccount API key deleted
delete
DELETE /subaccounts/{id}/keys/{keyId} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*

No content

Last updated

Was this helpful?