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:
Creating a sub-account
Creating an API key for a sub-account
Creating a DID for the sub-account
Inviting sub-account as a participant in an already existing ecosystem
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.
The sub account name
The sub account image
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
Whether to use updated array format for the response
false
How many items to offset by for pagination
0
How many items to return at one time (max 64)
64
GET /subaccounts HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
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
An subaccount ID
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
An ID
The sub account name
The sub account image
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
An ID
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.
An subaccount ID
Timestamp for the start of the range (ISO 8601)
Timestamp for the end of the range (ISO 8601)
How many items to offset by for pagination
0
How many items to return at one time (max 64)
64
Default response
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.
An subaccount ID
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
An ID
How many items to offset by for pagination
0
How many items to return at one time (max 64)
64
Default response
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.
An subaccount ID
An API key ID
DELETE /subaccounts/{id}/keys/{keyId} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
No content
Last updated
Was this helpful?