NAV Navigation
JavaScript Shell

Unbound CASP Management API v1.0.1811

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

Unbound’s Crypto Asset Security Platform ("CASP") provides the advanced technology and the architecture to secure crypto asset transactions. The crypto asset solution contains the CASP service and different end points (humans or BOTs).

CASP provides the framework to create Accounts, which hold multiple Vaults where secrets are stored. Access control is managed by the Quorum Policy for all of the Participants.

The CASP system manages the following entities:

CASP is a collaboration service, where different participants collaborate to perform crypto asset transactions. As such, it has inherent support for asynchronous operation. When an operation is triggered, it is located in a queue and completed when the relevant set of participants complete their part. CASP supports triggering asynchronous operations, notifying the relevant participants on required actions, and checking the status of operations.

For more information about the CASP SDK, see:

Email: Unbound Tech Support Web: Unbound Tech Support

Getting Started

Integrating CASP services within your server application, such as an exchange, a custodian service, or any other application managing crypto assets, is accomplished with the CASP REST API.

This reference includes and operations for completing the full CASP life cycle, including:

  1. Creating accounts
  2. Adding participants to an account
  3. Creating vaults
  4. Depositing money into vaults
  5. Withdrawing money from vaults
  6. Managing keychains

See the Unbound CASP User Guide for details about installing CASP.

REST API Requests

The API prefix for all CASP REST endpoints is:

https://<casp-server>/<comp>/api/v1.0/

The value for <comp> is casp for CASP requests, or the name of the coin type, such as btc.

Supported Coins

CASP provides built-in support for different coin types. A coin is a specific crypto currency that has its own associated ledger where transactions are recorded. CASP supports the following coin types:

New coin types are continually being added. If you need to support a different coin type, see the following section on BYOW.

Bring Your Own Wallet (BYOW)

CASP supports two types of implementations for handling different types of coins. CASP provides built-in support for some types of ledgers, as described in the previous section.

CASP also provides the necessary APIs so that you can bring your own wallet (BYOW), meaning that you can use whatever ledger you have, and control the vault and key operations with CASP. Using BYOW, you can create an implementation that can handle any coin type, as well as any special operations that you use to communicate with your ledger and for ledger processing.

You may want to use BYOW when using one of the built-in coin types, but need other features, such as using your own nodes and address caching. You may already have management in your application for one of the built-in coin types and want to use CASP for key management and protection. BYOW provides the flexibility to be used with any blockchain application.

In these scenarios CASP handles key management, protection and signing operations based on the quorum specification. It is your responsibility to manage:

  1. Blockchain communication
  2. Building transactions
  3. Balance management and retrieval

Setup the basic system components, accounts and participants, using the CASP APIs. Once the relevant participants exists, you can start creating your own vaults.

Participant Flows

Participants can be added to vaults, deactivated, and reactivated. The associated flow for each of these actions is shown in the following figures.

Vault Creation

Vault Creation

Add/Replace a Participant

Vault Creation

Note: You cannot deactivate a participant if it violates the quorum policy. For example, if the quorum requires 2 participants for approval, and there are only 2 participants, you cannot remove either one. First, add a new participant (for a total of 3) and then one can be removed.

Note: Participants can be deactivated either from a specific vault or globally from all vaults.

Deactivate/Reactivate a Participant

Vault Creation

A vault member can be deactivated as long as there are enough remaining participants for the quorum.

You may need to reactivate a participant in this case:

Error Handling

Responses are formatted in the standard REST format, with a status field showing an error code and an error field with a text description of the error. The possible error codes are described with each API.

For example, here is an apikey request:

https://<casp-server>/casp/api/v1.0/mng/auth/apikey

The error that is received is shown on the right.

Date: Mon, 05 Nov 2018 07:49:10 GMT
Content-Type: application/problem+json
Content-Length: 121
{
"type":"/mng/errors/operation-failed",
"title":"Authentication failed",
"details":"Password must be changed",
"status":400
}

Get CASP service status

Code samples

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/status',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/status \
  -H 'Accept: application/json'

GET /casp/api/v1.0/mng/status

Return the CASP service status

Verifies that the service is healthy and operational

Parameters

Parameter In Type Required Description
withDetails query boolean false Include system details

Example responses

200 Response

{
  "version": "string",
  "ukc": {
    "healthy": true,
    "errorMessage": "string"
  },
  "db": {
    "healthy": true,
    "errorMessage": "string"
  },
  "nativeCrypto": {
    "healthy": true,
    "errorMessage": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline
500 Internal Server Error Get status failed, the service is not operational Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» version string true none none
» ukc object true none none
»» healthy boolean true none Is entity healthy
»» errorMessage string false none Error message in case entity is not healthy
» db object true none none
»» healthy boolean true none Is entity healthy
»» errorMessage string false none Error message in case entity is not healthy
» nativeCrypto object true none none
»» healthy boolean true none Is entity healthy
»» errorMessage string false none Error message in case entity is not healthy

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get coin type service status

Code samples

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: '/{coinType}/api/v1.0/status',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /{coinType}/api/v1.0/status \
  -H 'Accept: application/json'

GET /{coinType}/api/v1.0/status

Return the service status for a specific coin type

Verifies that the service is healthy and operational

Parameters

Parameter In Type Required Description
coinType path string true Coin type
withDetails query boolean false Include system details

Example responses

200 Response

{
  "version": "string",
  "ledger": {
    "healthy": true,
    "errorMessage": "string"
  },
  "casp": {
    "healthy": true,
    "errorMessage": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK Inline
500 Internal Server Error Get status failed, the service is not operational Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» version string false none none
» ledger object false none none
»» healthy boolean false none none
»» errorMessage string false none none
» casp object false none none
»» healthy boolean false none none
»» errorMessage string false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Authentication

CASP uses access tokens and API keys to add a layer of security to the API requests.

Create a new user

Code samples

var headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'*/*'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/users',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/auth/users \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: */*'

POST /casp/api/v1.0/mng/auth/users

Create a new user

Create a new user

Body parameter

name: string
role: ADMIN
password: string

Parameters

Parameter In Type Required Description
body body object false none
» name body string true user's name
» role body string true user's role
» password body string true user's password

Enumerated Values

Parameter Value
» role ADMIN
» role USER

Example responses

401 Response

Responses

Status Meaning Description Schema
201 Created New user created successfully None
401 Unauthorized Unauthorized: Invalid user name or password Inline
409 Conflict User already exists Inline
500 Internal Server Error Create new user failed Inline

Response Schema

Status Code 401

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List users

Code samples

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/users',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/auth/users \
  -H 'Accept: application/json'

GET /casp/api/v1.0/mng/auth/users

List users

List users

Example responses

200 Response

[
  {
    "name": "string",
    "role": "ADMIN",
    "enabled": true
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Unauthorized: Invalid request Inline
500 Internal Server Error Internal error Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» name string true none User name
» role string false none Users roles
» enabled boolean true none User enabled state

Enumerated Values

Property Value
role ADMIN
role USER

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Change user password

Code samples

var headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/users/password',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X PUT /casp/api/v1.0/mng/auth/users/password \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'

PUT /casp/api/v1.0/mng/auth/users/password

Change user password

Change user's password to the CASP service

Body parameter

value: string

Parameters

Parameter In Type Required Description
body body object false none
» value body string true User's password

Example responses

401 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Unauthorized: Invalid user name or password Inline
500 Internal Server Error Change password failed Inline

Response Schema

Status Code 401

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Update user

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/users/{user_name}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X PUT /casp/api/v1.0/mng/auth/users/{user_name} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PUT /casp/api/v1.0/mng/auth/users/{user_name}

Update user

Update user

Body parameter

{
  "enabled": true
}

Parameters

Parameter In Type Required Description
user_name path string true User Name
body body object true Update user's state
» enabled body boolean false Is user enabled

Example responses

400 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK A user was successfully updated None
400 Bad Request Unauthorized: Invalid request Inline
500 Internal Server Error A user removal failed Inline

Response Schema

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Remove a user

Code samples

var headers = {
  'Accept':'*/*'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/users/{user_name}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X DELETE /casp/api/v1.0/mng/auth/users/{user_name} \
  -H 'Accept: */*'

DELETE /casp/api/v1.0/mng/auth/users/{user_name}

Remove a user

Remove a user

Parameters

Parameter In Type Required Description
user_name path string true User Name

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK A user was successfully removed None
400 Bad Request Unauthorized: Invalid request Inline
500 Internal Server Error A user removal failed Inline

Response Schema

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List API Keys

Code samples

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/apikeys',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/auth/apikeys \
  -H 'Accept: application/json'

GET /casp/api/v1.0/mng/auth/apikeys

List API Keys

List API Keys for CASP service

Example responses

200 Response

[
  {
    "clientId": "string",
    "tokenType": "BEARER",
    "expiry_in": 0,
    "scope": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Unauthorized: Invalid request Inline
500 Internal Server Error Internal error Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» clientId string true none Api key client_id
» tokenType string true none Api key token type
» expiry_in integer(int64) true none Api key expiry in
» scope string true none Api key scope

Enumerated Values

Property Value
tokenType BEARER

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get API Key

Code samples

var headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/apikeys',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/auth/apikeys \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'

POST /casp/api/v1.0/mng/auth/apikeys

Get API Key

Get API Key for CASP service. See https://tools.ietf.org/html/rfc6749#section-4.4

Body parameter

client_id: string
scope: string
grant_type: string

Parameters

Parameter In Type Required Description
body body object false none
» client_id body string true Owner client ID auth token will be issued for
» scope body string true Auth token scope. Value MUST be set to "/mng"
» grant_type body string true Request's grant type. Value MUST be set to "client_credentials"

Example responses

201 Response

{
  "access_token": "string",
  "token_type": "string",
  "expires_in": 0,
  "scope": "string"
}

Responses

Status Meaning Description Schema
201 Created API key created Inline
401 Unauthorized Unauthorized: Authentication data is invalid Inline
409 Conflict API key cannot be generated Inline
500 Internal Server Error Get API key failed Inline

Response Schema

Status Code 201

Name Type Required Restrictions Description
» access_token string true none Oauth Token for CASP service
» token_type string false none Oauth Token type
» expires_in integer(int64) false none Expiration in seconds
» scope string false none Oauth token scope

Status Code 401

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Revoke an Api key

Code samples

var headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/apikeys',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X DELETE /casp/api/v1.0/mng/auth/apikeys \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'

DELETE /casp/api/v1.0/mng/auth/apikeys

Revoke an Api key

Revoke an Api key

Body parameter

client_id: string

Parameters

Parameter In Type Required Description
body body Revoke_an_Api_key false none
» client_id body string true client_id

Example responses

400 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK An api key was successfully removed None
400 Bad Request Unauthorized: Invalid request Inline
500 Internal Server Error An api key removal failed Inline

Response Schema

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get access token

Code samples

var headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/tokens',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/auth/tokens \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'

POST /casp/api/v1.0/mng/auth/tokens

Get access token

Get access token for CASP service. See https://tools.ietf.org/html/rfc6749#section-4.3

Body parameter

username: string
password: string
grant_type: string

Parameters

Parameter In Type Required Description
body body object false none
» username body string true Admin username
» password body string true Admin password
» grant_type body string true Request's grant type. Value MUST be set to "password"

Example responses

201 Response

{
  "access_token": "string",
  "token_type": "string",
  "expires_in": 0,
  "scope": "string"
}

Responses

Status Meaning Description Schema
201 Created Access token created Inline
401 Unauthorized Unauthorized: Authentication data is invalid Inline
409 Conflict Auth token cannot be generated Inline
500 Internal Server Error Get auth token failed Inline

Response Schema

Status Code 201

Name Type Required Restrictions Description
» access_token string true none Oauth Token for CASP service
» token_type string false none Oauth Token type
» expires_in integer(int64) false none Expiration in seconds
» scope string false none Oauth token scope

Status Code 401

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Revoke an access token

Code samples

var headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'

};

$.ajax({
  url: '/casp/api/v1.0/mng/auth/tokens',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X DELETE /casp/api/v1.0/mng/auth/tokens \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'

DELETE /casp/api/v1.0/mng/auth/tokens

Revoke an access token

Revoke an access token

Body parameter

client_id: string

Parameters

Parameter In Type Required Description
body body Revoke_an_Api_key false none
» client_id body string true client_id

Example responses

400 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK An access token was successfully removed None
400 Bad Request Unauthorized: Invalid request Inline
500 Internal Server Error An access token removal failed Inline

Response Schema

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Accounts

An account is a container for a set of vaults and participants that manage these vaults. An account may represent a client of the system, a trader, an organization, etc. The CASP service supports creating different accounts, managing account participants (human users or machine BOT's), creating secure vaults for the account, and executing different crypto asset transactions within the account.

The CASP service supports the notion of global accounts, which can manage vaults across other accounts. This notion can support the use case of the CASP service providers managing vaults on behalf of the CASP clients.

Create a new account

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/accounts \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/accounts

Create a new account

Create a new account managed by the CASP service

Body parameter

{
  "name": "string",
  "isGlobal": true
}

Parameters

Parameter In Type Required Description
body body object true Create accounts request
» name body string true Account name
» isGlobal body boolean false Is account global

Example responses

201 Response

{
  "id": "string",
  "name": "string",
  "isGlobal": true
}

Responses

Status Meaning Description Schema
201 Created OK Inline
409 Conflict Account already exists Inline
500 Internal Server Error Create account failed Inline

Response Schema

Status Code 201

Name Type Required Restrictions Description
» id string true none Account ID
» name string true none Account name
» isGlobal boolean true none Is global account

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List accounts

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/accounts \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/accounts

List accounts

List all accounts managed by the CASP service

Parameters

Parameter In Type Required Description
withStats query boolean false Include additional info per account

Example responses

200 Response

[
  {
    "id": "string",
    "name": "string",
    "isGlobal": true,
    "stats": {
      "participants": {
        "total": 0,
        "inactive": 0
      },
      "statsOperation": {
        "total": 0,
        "pending": 0
      },
      "statsVaults": {
        "total": 0,
        "inactive": 0
      }
    }
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Not found Inline
500 Internal Server Error List accounts failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Account ID
» name string true none Account name
» isGlobal boolean true none Is global account
» stats object true none none
»» participants object true none none
»»» total integer(int32) true none Total number of participants in the account
»»» inactive integer(int32) true none Total number of inactive participants in the account
»» statsOperation object true none none
»»» total integer(int32) true none The number of operations from the account
»»» pending integer(int32) true none The number of operations that are still pending
»» statsVaults object true none none
»»» total integer(int32) true none The number of vaults that belong to this account
»»» inactive integer(int32) true none The number of inactive vaults that belong to this account

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get account details

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/accounts/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/accounts/{id}

Get account details

Get account information about a specific account

Parameters

Parameter In Type Required Description
id path string true Account ID
withStats query boolean false Return detailed information about the account

Example responses

200 Response

[
  {
    "id": "string",
    "name": "string",
    "isGlobal": true,
    "stats": {
      "participants": {
        "total": 0,
        "inactive": 0
      },
      "statsOperation": {
        "total": 0,
        "pending": 0
      },
      "statsVaults": {
        "total": 0,
        "inactive": 0
      }
    }
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Not found Inline
500 Internal Server Error Get account details failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Account ID
» name string true none Account name
» isGlobal boolean true none Is global account
» stats object true none none
»» participants object true none none
»»» total integer(int32) true none Total number of participants in the account
»»» inactive integer(int32) true none Total number of inactive participants in the account
»» statsOperation object true none none
»»» total integer(int32) true none The number of operations from the account
»»» pending integer(int32) true none The number of operations that are still pending
»» statsVaults object true none none
»»» total integer(int32) true none The number of vaults that belong to this account
»»» inactive integer(int32) true none The number of inactive vaults that belong to this account

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Update an existing account

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X PUT /casp/api/v1.0/mng/accounts/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

PUT /casp/api/v1.0/mng/accounts/{id}

Update an existing account

Update the parameters for a specific account

Body parameter

{
  "name": "string",
  "isGlobal": true
}

Parameters

Parameter In Type Required Description
id path string true Account ID
body body object true Update account request
» name body string true Account name
» isGlobal body boolean false Is account global

Example responses

404 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
404 Not Found Account not found Inline
409 Conflict Account name already exists Inline
500 Internal Server Error Update account failed Inline

Response Schema

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Delete an account

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X DELETE /casp/api/v1.0/mng/accounts/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

DELETE /casp/api/v1.0/mng/accounts/{id}

Delete an account

Delete an existing account. Only accounts with no vaults or participants may be deleted.

Parameters

Parameter In Type Required Description
id path string true Account ID

Example responses

403 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
403 Forbidden Forbidden Inline
404 Not Found Account not found Inline
500 Internal Server Error Delete account failed Inline

Response Schema

Status Code 403

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Participants

A participant can be a human within the account or a BOT taking part in crypto asset transactions. Each participant owns a share of the cryptographic material that is part of the different transactions. CASP supports participants using any relevant platform, including mobile devices, laptops, and different server platforms for BOT's.

Create a new participant

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}/participants',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/accounts/{id}/participants \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/accounts/{id}/participants

Create a new participant

Create a new participant in the specified account

Body parameter

{
  "name": "string",
  "email": "string",
  "role": "string"
}

Parameters

Parameter In Type Required Description
id path string true Account ID
body body object true Create participant request
» name body string true Participant name
» email body string true Participant email
» role body string true Participant role

Example responses

201 Response

{
  "id": "string",
  "activationCode": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
201 Created New participant created successfully Inline
404 Not Found Account not found Inline
406 Not Acceptable Email is not valid Inline
409 Conflict Participant already exists Inline
500 Internal Server Error Create new participant failed Inline

Response Schema

Status Code 201

Name Type Required Restrictions Description
» id string true none Participant ID
» activationCode string true none Activation code for the specified participant
» name string true none Participant name

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List participants per account

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}/participants',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/accounts/{id}/participants \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/accounts/{id}/participants

List participants per account

List all participants in the account, which can be both humans and BOT's. An option is provided to include the deactivated participants.

Parameters

Parameter In Type Required Description
id path string true Account ID
withGlobal query boolean false Include participants which take part in this account vaults and belong to a different global account
withDeactivated query boolean false Include deactivated participants

Example responses

200 Response

[
  {
    "id": "string",
    "accountID": "string",
    "name": "string",
    "email": "string",
    "status": "NOT_ACTIVATED",
    "isActive": true,
    "accountName": "string",
    "role": "string",
    "vaults": [
      {
        "id": "string",
        "publicKey": "string"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Account not found Inline
500 Internal Server Error List participant per account failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Participant ID
» accountID string true none Participant account ID
» name string true none Participant name
» email string true none Participant email
» status string true none Participant status
» isActive boolean true none Participant activation state
» accountName string true none Participant account name
» role string true none Participant role
» vaults [object] false none none
»» id string true none Vault ID
»» publicKey string true none Vault public key

Enumerated Values

Property Value
status NOT_ACTIVATED
status ACTIVATED
status DEACTIVATED

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get participant information

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/participants/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/participants/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/participants/{id}

Get participant information

Get details of a participant

Parameters

Parameter In Type Required Description
id path string true Participant ID
withVaults query boolean false Get information on vaults for this participant

Example responses

200 Response

{
  "id": "string",
  "accountID": "string",
  "name": "string",
  "email": "string",
  "status": "NOT_ACTIVATED",
  "isActive": true,
  "accountName": "string",
  "role": "string",
  "vaults": [
    {
      "id": "string",
      "publicKey": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Participant not found Inline
500 Internal Server Error Get participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Participant ID
» accountID string true none Participant account ID
» name string true none Participant name
» email string true none Participant email
» status string true none Participant status
» isActive boolean true none Participant activation state
» accountName string true none Participant account name
» role string true none Participant role
» vaults [object] false none none
»» id string true none Vault ID
»» publicKey string true none Vault public key

Enumerated Values

Property Value
status NOT_ACTIVATED
status ACTIVATED
status DEACTIVATED

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Update an existing participant

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/participants/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X PUT /casp/api/v1.0/mng/participants/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

PUT /casp/api/v1.0/mng/participants/{id}

Update an existing participant

Update participant details. Participant name and other attributes can be changed. This service is also used to deactivate a participant by setting

Body parameter

{
  "name": "string",
  "email": "string",
  "role": "string",
  "status": "ACTIVATED"
}

Parameters

Parameter In Type Required Description
id path string true Participant ID
body body object true Update participant request
» name body string false Participant name
» email body string false Participant email
» role body string false Participant role
» status body string false Participant status

Enumerated Values

Parameter Value
» status ACTIVATED
» status DEACTIVATED

Example responses

404 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
404 Not Found Participant not found Inline
409 Conflict Cannot deactivate participant Inline
500 Internal Server Error Update participant failed Inline

Response Schema

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Delete a participant

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/participants/{id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X DELETE /casp/api/v1.0/mng/participants/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

DELETE /casp/api/v1.0/mng/participants/{id}

Delete a participant

Deletes a participant. A participant can be deleted only if it has no related vaults.

Parameters

Parameter In Type Required Description
id path string true Participant ID

Example responses

403 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
403 Forbidden Forbidden Inline
404 Not Found Participant not found Inline
500 Internal Server Error Delete participant failed Inline

Response Schema

Status Code 403

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Regenerate activation code

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/participants/{id}/reactivate',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/participants/{id}/reactivate \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/participants/{id}/reactivate

Regenerate activation code for an existing participant

Regenerate activation code for an existing participant. Used when the activation code was lost or the participant need to be reactivated.

Parameters

Parameter In Type Required Description
id path string true Participant ID

Example responses

200 Response

{
  "id": "string",
  "activationCode": "string",
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Participant not found Inline
500 Internal Server Error Regenerate activation code failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Participant ID
» activationCode string true none Activation code for the specified participant
» name string true none Participant name

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Vault Operations

A vault is a secure container for the cryptographic material used to protect a crypto asset, such as the seed or private key. CASP uses Multiparty Computation (MPC) to split the crypto material between the different participants in the vault, which ensures that the material never exists in a single place. In addition, only the approved set of participants can complete a transaction based on the vault definition.

A Quorum vault shares the responsibility of executing a transaction between many different participants in a structure defined by the vault policy. The vault policy contains a quorum-based structure where there are any number of groups, any threshold value per group, any tree structure between different groups, etc. The MPC protocols used by CASP ensure that if and only if the quorum definition is satisfied, a transaction can take place, which is enforced on the cryptographic level.

Use the relevant endpoint based on the currency you want to work with. The list of supported currencies and the matching short names can be found in Supported Coins. In this document, Bitcoin is used as an example.

The main endpoints for vault management are:

/btctest/api/v1.0/accounts/{accountId}/vaults

and

/btctest/api/v1.0/vaults/{vaultId}

Create a new vault

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/accounts/{id}/vaults',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /{coinType}/api/v1.0/accounts/{id}/vaults \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /{coinType}/api/v1.0/accounts/{id}/vaults

Create a new vault

This request starts the process of creating a new quorum vault. The vault is created only after the participants approve the vault creation according to the vault policy.

Body parameter

{
  "name": "string",
  "description": "string",
  "hierarchy": true,
  "firstAccountName": "string",
  "groups": [
    {
      "name": "string",
      "requiredApprovals": 0,
      "members": [
        {
          "id": "string"
        }
      ]
    }
  ],
  "additionalData": "string"
}

Parameters

Parameter In Type Required Description
coinType path string true Coin type
id path string true Account ID
body body object true Create Vault Request
» name body string true Vault name
» description body string true Vault description
» hierarchy body boolean false True to create a BIP44 hierarchy, false to create a deterministic vault
» firstAccountName body string false The name of the first account
» groups body [object] true Vault approval groups
»» name body string true Vault group name
»» requiredApprovals body integer(int32) true Vault group required approvals
»» members body [object] true Vault group members
»»» id body string true Participant ID
»» additionalData body string false Some additional data about the vault, in string form, that the specific coin type can store in the CASP

Example responses

201 Response

{
  "id": "string",
  "name": "string",
  "description": "string",
  "accountID": "string"
}

Responses

Status Meaning Description Schema
201 Created New vault created successfully, waiting for participant approval Inline
404 Not Found Missing data Inline
409 Conflict Vault already exists Inline
500 Internal Server Error Create vault failed Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 201

Name Type Required Restrictions Description
» id string false none Vault ID
» name string true none Vault name
» description string true none Vault description
» accountID string true none Vault account ID

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 409

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

List vaults

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/accounts/{id}/vaults',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /{coinType}/api/v1.0/accounts/{id}/vaults \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /{coinType}/api/v1.0/accounts/{id}/vaults

Get list of vaults that works with current coin type per account

List all vaults for specified kind in the account. By default only active vaults are listed.

Parameters

Parameter In Type Required Description
coinType path string true Coin type
id path string true Account ID
withDeactivated query boolean false Include deactivated vaults

Example responses

200 Response

[
  {
    "id": "string",
    "description": "string",
    "name": "string",
    "accountID": "string",
    "status": "NOT_INITIALIZED",
    "statusText": "string",
    "hierarchy": true,
    "additionalData": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Account not found Inline
500 Internal Server Error List vaults per account failed Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Vault ID
» description string true none Vault description
» name string true none Vault name
» accountID string true none Vault account
» status string true none Vault status
» statusText string true none Vault status text
» hierarchy boolean true none Vault hierarchy
» additionalData string false none additional data

Enumerated Values

Property Value
status NOT_INITIALIZED
status INITIALIZED
status DEACTIVATED

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Get vault info

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/vaults/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /{coinType}/api/v1.0/vaults/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /{coinType}/api/v1.0/vaults/{id}

Get vault info

Get details of a vault

Parameters

Parameter In Type Required Description
coinType path string true Coin type
id path string true Vault ID
bip44account query integer(int32) false The account index
contractAddress query string false Contract Address (For use ETH-ERC20 coins only)

Example responses

200 Response

{
  "id": "string",
  "description": "string",
  "name": "string",
  "accountID": "string",
  "status": "NOT_INITIALIZED",
  "statusText": "string",
  "hierarchy": true,
  "additionalData": "string",
  "addresses": [
    "string"
  ],
  "balance": 0,
  "feeBalance": 0
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
500 Internal Server Error Get vault details failed Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Vault ID
» description string true none Vault description
» name string true none Vault name
» accountID string true none Vault account
» status string true none Vault status
» statusText string true none Vault status text
» hierarchy boolean true none Vault hierarchy
» additionalData string false none additional data
» addresses [string] true none Vault addresses
» balance number(double) true none Vault balance
» feeBalance number(double) false none The amount available to pay transaction fee

Enumerated Values

Property Value
status NOT_INITIALIZED
status INITIALIZED
status DEACTIVATED

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Update an existing vault

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'*/*',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X PUT /casp/api/v1.0/mng/vaults/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Authorization: API_KEY'

PUT /casp/api/v1.0/mng/vaults/{id}

Update an existing vault

Updates an existing vault. The vault name and description can be updated.

Body parameter

{
  "name": "string",
  "description": "string"
}

Parameters

Parameter In Type Required Description
id path string true Vault ID
body body object true Update vault Request
» name body string true Vault name
» description body string true Vault description

Example responses

404 Response

Responses

Status Meaning Description Schema
200 OK OK None
404 Not Found Vault not found Inline
500 Internal Server Error Update vault failed Inline

Response Schema

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Delete an existing vault

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X DELETE /casp/api/v1.0/mng/vaults/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

DELETE /casp/api/v1.0/mng/vaults/{id}

Delete an existing vault

Deletes an existing vault. Only vaults which are not activated yet can be deleted.

Parameters

Parameter In Type Required Description
id path string true Vault ID

Example responses

403 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
403 Forbidden Vault deletion is not allowed Inline
404 Not Found Vault not found Inline
500 Internal Server Error Delete vault failed Inline

Response Schema

Status Code 403

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Create an external address

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/vaults/{vaultId}/accounts/{accountIndex}/addresses',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /{coinType}/api/v1.0/vaults/{vaultId}/accounts/{accountIndex}/addresses \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /{coinType}/api/v1.0/vaults/{vaultId}/accounts/{accountIndex}/addresses

Create a new external address

Create a new BIP44 external address. See the Keychain Management section for more information.

Parameters

Parameter In Type Required Description
coinType path string true Coin type
vaultId path string true Vault ID
accountIndex path integer(int32) true The account index

Example responses

200 Response

{
  "address": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad request Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» address string false none This generated address

Status Code 400

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 406

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Start withdrawal process

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/vaults/{id}/withdrawals',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /{coinType}/api/v1.0/vaults/{id}/withdrawals \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /{coinType}/api/v1.0/vaults/{id}/withdrawals

Start withdrawal process

Starts the process of a quorum-based transaction signing operation that is used when withdrawing a cryptoasset.

The operation finishes when the minimum number of participants approve the transaction signing operation.

You can check the task status by calling the /withdrawals service. This service should be used when the blockchain management is done within CASP, as it will sign the transaction and send it to the relevant blockchain.

Body parameter

{
  "amount": 0,
  "recipientAddress": "string",
  "fee": "LOW",
  "description": "string",
  "bip44AccountIndex": 0,
  "contractAddress": "string"
}

Parameters

Parameter In Type Required Description
coinType path string true Coin type
id path string true Vault ID
body body object true Withdrawal Request
» amount body number(double) true Transaction amount
» recipientAddress body string true Recipient address for the transaction
» fee body string true Transaction fee
» description body string true Transaction description
» bip44AccountIndex body integer(int32) false The account index
» contractAddress body string false Contract Address (For use ETH-ERC20 coins only)

Enumerated Values

Parameter Value
» fee LOW
» fee MEDIUM
» fee HIGH

Example responses

200 Response

{
  "operationID": "string"
}

Responses

Status Meaning Description Schema
200 OK Withdrawal request accepted Inline
400 Bad Request Bad withdrawal request Inline
403 Forbidden Not allowed Inline
404 Not Found Missing data Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Withdrawal failed Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID

Status Code 400

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 403

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 406

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Get withdrawal information

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/withdrawals/{operationid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /{coinType}/api/v1.0/withdrawals/{operationid} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /{coinType}/api/v1.0/withdrawals/{operationid}

Get withdrawal information

Signing a withdrawal with a quorum vault requires approval of the quorum. This request queries the withdrawal information and status of such an asynchronous operation.

Parameters

Parameter In Type Required Description
coinType path string true Coin type
operationid path string true Operation ID

Example responses

200 Response

{
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultId": "string",
  "description": "string",
  "amount": 0,
  "fee": "string",
  "recipientAddress": "string",
  "details": "string",
  "transactionID": "string",
  "dataToSign": [
    "string"
  ],
  "signatures": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Withdrawal operation not found Inline
500 Internal Server Error Get Operation details failed Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultId string true none Vault ID
» description string true none Description of the operation
» amount number(double) true none Withdrawal amount
» fee string true none Withdrawal fee
» recipientAddress string true none Recipient address
» details string true none This is a field that can be used to store formatted operation information in the CASP database. The information can subsequently be sent to the end point for display
» transactionID string false none Withdrawal transaction ID
» dataToSign [string] true none List of data to sign
» signatures [string] true none Signatures

Enumerated Values

Property Value
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Get operation status

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/operations/{operationid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/operations/{operationid} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/operations/{operationid}

Get operation status

Quorum vault operations require approval of the quorum. This request queries the status of such an asynchronous operation.

Parameters

Parameter In Type Required Description
operationid path string true Operation ID

Example responses

200 Response

{
  "operationID": "string",
  "kind": "CREATE_VAULT",
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultID": "string",
  "description": "string",
  "groups": [
    {
      "name": "string",
      "members": [
        {
          "approvedAt": "string",
          "id": "string",
          "isApproved": true,
          "name": "string",
          "status": "STARTED",
          "approvalGroupAccount": {
            "id": "string",
            "name": "string"
          },
          "label": "string",
          "isGlobal": true,
          "isActive": true
        }
      ],
      "requiredApprovals": 0,
      "order": 0,
      "deactivateAllowed": true
    }
  ],
  "isApproved": true,
  "accountID": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Operation not found Inline
500 Internal Server Error Get Operation status failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID
» kind string true none Request kind
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultID string true none Vault ID
» description string true none Description of the operation
» groups [object] true none Operation approval groups
»» name string true none Approval group name
»» members [object] true none A list of participants in the group
»»» approvedAt string true none Participant approval time
»»» id string true none Participant ID
»»» isApproved boolean true none Participant approval state
»»» name string true none Participant name
»»» status string true none Participant task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none Participant label
»»» isGlobal boolean true none Participant global state
»»» isActive boolean true none none
»» requiredApprovals integer(int32) true none The number of group participants that need to give approval
»» order integer(int32) true none This field determines the order in which groups are prompted for approvals
»» deactivateAllowed boolean true none A group participant can be deactivated for this group
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for the operation

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR
status STARTED
status DONE
status DECLINED

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Cancel a pending operation

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/operations/{operationid}/cancel',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/operations/{operationid}/cancel \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/operations/{operationid}/cancel

Cancel a pending operation

Parameters

Parameter In Type Required Description
operationid path string true Operation ID

Example responses

404 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
404 Not Found Operation not found Inline
409 Conflict Operation on running Inline
500 Internal Server Error Cancel a pending operation failed Inline

Response Schema

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Resend sign transaction operation

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/operations/sign/{operationid}/resend',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/operations/sign/{operationid}/resend \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/operations/sign/{operationid}/resend

Resend sign transaction operation

Resend the sign operation metadata. This tries to resend the results of the sign operation and complete the coin transaction

Parameters

Parameter In Type Required Description
operationid path string true Operation ID

Example responses

400 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Cannot resend the sign operation Inline
404 Not Found Operation not found Inline
500 Internal Server Error Resend Operation failed Inline

Response Schema

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List operations per account

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}/operations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/accounts/{id}/operations \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/accounts/{id}/operations

List operations per account

List operations associated with account vaults. By default, only operations which are in process (not completed) will be returned.

Parameters

Parameter In Type Required Description
id path string true Account ID
withCompleted query boolean false Include completed operations
onlyApproved query boolean false Show only approved operations

Example responses

200 Response

[
  {
    "operationID": "string",
    "kind": "CREATE_VAULT",
    "status": "PENDING",
    "statusText": "string",
    "createdAt": "string",
    "vaultID": "string",
    "description": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
500 Internal Server Error List operations per account failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID
» kind string true none Request kind
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultID string true none Vault ID
» description string true none Description of the operation

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Policy Management

Approvals are defined by a group of authorizing entities, of which a minimal-size subset (called a quorum) is required to approve the transaction. M approvals from a set of N entities is known as "MofN". For example, the client may define 8 entities, of which 4 must approve the transaction. Another example is where there must be 3 approvals from group A and 2 approvals from group B.

The number of groups, size of groups, and the size of the approving subset is fully flexible and can be different for each client. Every vault has an MofN policy associated with it, which is defined prior to the vault generation.

Add vault member

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/members',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/vaults/{id}/members \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/vaults/{id}/members

Add participant to an existing vault group

This API is used if a participant becomes unavailable or leaves an account and needs to be replaced with a new participant. A new participant may be added to an existing vault, but requires the approval of the existing vault quorum.

Body parameter

{
  "participantID": "string",
  "groupName": "string",
  "description": "string"
}

Parameters

Parameter In Type Required Description
id path string true Vault ID
body body object true Add vault group participant request
» participantID body string true Participant ID
» groupName body string true Vault group name
» description body string false Description

Example responses

200 Response

{
  "operationID": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Not allowed Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 405

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Deactivate a vault member

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/members/{participantid}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X PUT /casp/api/v1.0/mng/vaults/{id}/members/{participantid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

PUT /casp/api/v1.0/mng/vaults/{id}/members/{participantid}

Deactivate a participant for a specific vault

The deactivated participant no longer takes part in the vault transaction approval processes

Body parameter

{
  "status": "ACTIVATED"
}

Parameters

Parameter In Type Required Description
participantid path string true Participant ID
id path string true vault ID
body body object true Participant status update request
» status body string true Participant status

Enumerated Values

Parameter Value
» status ACTIVATED
» status DEACTIVATED

Example responses

403 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
403 Forbidden Deactivating this participant would make the vault not operational (too few active participants left) Inline
404 Not Found Participant not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Deactivate participant failed Inline

Response Schema

Status Code 403

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status of add member operation

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/operations/addmember/{operationid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/operations/addmember/{operationid} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/operations/addmember/{operationid}

Status of add member operation

Adding a new participant to a vault requires approval of the quorum. This request queries the status of such an asynchronous operation.

Parameters

Parameter In Type Required Description
operationid path string true Operation ID

Example responses

200 Response

{
  "operationID": "string",
  "kind": "CREATE_VAULT",
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultID": "string",
  "description": "string",
  "vaultName": "string",
  "groupName": "string",
  "participantName": "string",
  "participantID": "string",
  "groups": [
    {
      "name": "string",
      "members": [
        {
          "approvedAt": "string",
          "id": "string",
          "isApproved": true,
          "name": "string",
          "status": "STARTED",
          "approvalGroupAccount": {
            "id": "string",
            "name": "string"
          },
          "label": "string",
          "isGlobal": true,
          "isActive": true
        }
      ],
      "requiredApprovals": 0,
      "order": 0,
      "deactivateAllowed": true
    }
  ],
  "isApproved": true,
  "accountID": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Operation not found Inline
500 Internal Server Error Get Operation status failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID
» kind string true none Request kind
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultID string true none Vault ID
» description string true none Description of the operation
» vaultName string true none Vault name for the operation
» groupName string true none Group name to join
» participantName string true none Participant name
» participantID string true none Participant ID
» groups [object] true none Operation approval groups
»» name string true none Approval group name
»» members [object] true none A list of participants in the group
»»» approvedAt string true none Participant approval time
»»» id string true none Participant ID
»»» isApproved boolean true none Participant approval state
»»» name string true none Participant name
»»» status string true none Participant task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none Participant label
»»» isGlobal boolean true none Participant global state
»»» isActive boolean true none none
»» requiredApprovals integer(int32) true none The number of group participants that need to give approval
»» order integer(int32) true none This field determines the order in which groups are prompted for approvals
»» deactivateAllowed boolean true none A group participant can be deactivated for this group
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for the operation

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR
status STARTED
status DONE
status DECLINED

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Keychain Management

Some implementations require a higher level of anonymity, meaning that a key should only be used a minimal number of times before switching to a new key. To accomplish this goal, CASP provides keychains, known as hierarchical deterministic wallets (or "HD Wallets"). These keychains enable the creation of many keys for a single secret.

Working with the currency layer, CASP supports a specific hierarchy structure as defined in the BIP44 scheme. This scheme supports the following:

This section describes the APIs for management of these keychains. If you require a different keychain structure, see the section on BYOW Keychain Management.

Add account per coin type

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/vaults/{vaultId}/accounts',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /{coinType}/api/v1.0/vaults/{vaultId}/accounts \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /{coinType}/api/v1.0/vaults/{vaultId}/accounts

Add an account to a vault

Body parameter

{
  "accountName": "string"
}

Parameters

Parameter In Type Required Description
coinType path string true Coin type
vaultId path string true Vault ID
body body Create_an_accountBody false Add account request
» accountName body string true The account name

Example responses

200 Response

{
  "addresses": [
    "string"
  ],
  "balance": 0,
  "name": "string",
  "index": 0
}

Responses

Status Meaning Description Schema
200 OK Withdrawal request accepted Inline
400 Bad Request Bad withdrawal request Inline
403 Forbidden Not allowed Inline
404 Not Found Missing data Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Withdrawal failed Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» addresses [string] true none Account's addresses
» balance number(double) true none Account's balance
» name string true none Account's name
» index integer(int32) true none Account's index

Status Code 400

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 403

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 406

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Get account information

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/vaults/{vaultId}/accounts/{accountIdentifier}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /{coinType}/api/v1.0/vaults/{vaultId}/accounts/{accountIdentifier} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /{coinType}/api/v1.0/vaults/{vaultId}/accounts/{accountIdentifier}

Get the addresses and total balance of an account for a specific coin type

Parameters

Parameter In Type Required Description
coinType path string true Coin type
vaultId path string true Vault ID
accountIdentifier path string true Account index or account name
contractAddress query string false Contract Address (For use ETH-ERC20 coins only)

Example responses

200 Response

{
  "addresses": [
    "string"
  ],
  "balance": 0,
  "name": "string",
  "index": 0
}

Responses

Status Meaning Description Schema
200 OK Account addresses and total balance Inline
404 Not Found Account not found Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» addresses [string] true none Account's addresses
» balance number(double) true none Account's balance
» name string true none Account's name
» index integer(int32) true none Account's index

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

List accounts per coin type

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/{coinType}/api/v1.0/vaults/{vaultId}/accounts',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /{coinType}/api/v1.0/vaults/{vaultId}/accounts \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /{coinType}/api/v1.0/vaults/{vaultId}/accounts

List all the accounts in a vault

Parameters

Parameter In Type Required Description
coinType path string true Coin type
vaultId path string true Vault ID

Example responses

200 Response

[
  {
    "name": "string",
    "index": 0
  }
]

Responses

Status Meaning Description Schema
200 OK Withdrawal request accepted Inline
400 Bad Request Bad withdrawal request Inline
403 Forbidden Not allowed Inline
404 Not Found Missing data Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Withdrawal failed Inline
503 Service Unavailable CASP service is not available Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» name string false none an optional account name
» index integer(int32) true none the account's index

Status Code 400

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 403

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 404

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 406

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 500

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

Status Code 503

Name Type Required Restrictions Description
» type string false none none
» title string false none none
» details string false none none
» status integer(int64) false none none

BYOW Vault Operations

A vault is a secure container for the cryptographic material used to protect a crypto asset, such as the seed or private key. CASP uses Multiparty Computation (MPC) to split the crypto material between the different participants in the vault, which ensures that the material never exists in a single place. In addition, only the approved set of participants can complete a transaction based on the vault definition.

A Quorum vault shares the responsibility of executing a transaction between many different participants in a structure defined by the vault policy. The vault policy contains a quorum-based structure where there are any number of groups, any threshold value per group, any tree structure between different groups, etc. The MPC protocols used by CASP ensure that if and only if the quorum definition is satisfied, a transaction can take place, which is enforced on the cryptographic level.

These APIs provide added parameters that enable you to handle your own coin type.

Create new vault

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}/vaults',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/accounts/{id}/vaults \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/accounts/{id}/vaults

Create new vault

This request starts the process of creating a new vault. The vault is created only after the participants approve the vault creation according to the vault policy.

Body parameter

{
  "name": "string",
  "description": "string",
  "groups": [
    {
      "name": "string",
      "requiredApprovals": 0,
      "members": [
        {
          "id": "string"
        }
      ]
    }
  ],
  "cryptoKind": "ECDSA",
  "providerKind": "string",
  "hierarchy": "NONE",
  "coinType": 0,
  "firstAccountName": "string",
  "additionalData": "string"
}

Parameters

Parameter In Type Required Description
id path string true Account ID
body body object true Create Vault Request
» name body string true Vault name
» description body string true Vault description
» groups body [object] true Vault approval groups
»» name body string true Vault group name
»» requiredApprovals body integer(int32) true Vault group required approvals
»» members body [object] true Vault group participants
»»» id body string true Participant ID
»» cryptoKind body string true Type of cryptographic algorithm
»» providerKind body string true Type of crypto currency
»» hierarchy body string false Vault hierarchy. defaults to deterministic
»» coinType body integer(int32) false optional BIP44 coin type. see examples in https://github.com/satoshilabs/slips/blob/master/slip-0044.md
»» firstAccountName body string false The name of the first account
»» additionalData body string false Some additional data about the vault, in string form, that can be stored in CASP

Enumerated Values

Parameter Value
»» cryptoKind ECDSA
»» cryptoKind EDDSA
»» hierarchy NONE
»» hierarchy BIP32
»» hierarchy BIP44

Example responses

201 Response

{
  "id": "string",
  "name": "string",
  "description": "string",
  "accountID": "string"
}

Responses

Status Meaning Description Schema
201 Created New vault created successfully, waiting for participant approval Inline
400 Bad Request Bad Request Inline
404 Not Found Missing data Inline
409 Conflict Vault name already exists Inline
500 Internal Server Error Create vault failed Inline

Response Schema

Status Code 201

Name Type Required Restrictions Description
» id string true none Vault ID
» name string true none Vault name
» description string true none Vault description
» accountID string true none Vault account ID

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List vaults per account

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}/vaults',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/accounts/{id}/vaults \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/accounts/{id}/vaults

List vaults per account

List all vaults in the account. By default only active vaults are listed.

Parameters

Parameter In Type Required Description
id path string true Account ID
withDeactivated query boolean false Include deactivated vaults
providerKind query string false Filter by coin type

Example responses

200 Response

[
  {
    "id": "string",
    "name": "string",
    "description": "string",
    "cryptoKind": "ECDSA",
    "providerKind": "string",
    "kind": "QUORUM",
    "isActive": true,
    "status": "NOT_INITIALIZED",
    "statusText": "string",
    "providerData": "string",
    "pendingRequests": 0,
    "hierarchy": "NONE",
    "additionalData": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Account not found Inline
500 Internal Server Error List vaults per account failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none Vault ID
» name string true none Vault name
» description string true none Vault description
» cryptoKind string false none Type of cryptographic algorithm
» providerKind string false none Coin type that created the vault
» kind string true none Type of vault
» isActive boolean true none Vault active state
» status string true none Vault status
» statusText string true none Vault status text
» providerData string true none This is a field that can be used to store information in the CASP database. The information can subsequently be read back as needed.
» pendingRequests integer(int64) true none Vault pending requests
» hierarchy string true none Vault status text
» additionalData string false none Some additional data, in String form, that was specified when the vault was created

Enumerated Values

Property Value
cryptoKind ECDSA
cryptoKind EDDSA
kind QUORUM
kind PRIVATE
status NOT_INITIALIZED
status INITIALIZED
status DEACTIVATED
hierarchy NONE
hierarchy BIP32
hierarchy BIP44

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get BYOW vault info

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{id}

Get BYOW vault info

Get details of a vault

Parameters

Parameter In Type Required Description
id path string true Vault ID

Example responses

200 Response

{
  "description": "string",
  "groups": [
    {
      "name": "string",
      "members": [
        {
          "approvedAt": "string",
          "id": "string",
          "isApproved": true,
          "name": "string",
          "status": "STARTED",
          "approvalGroupAccount": {
            "id": "string",
            "name": "string"
          },
          "label": "string",
          "isGlobal": true,
          "isActive": true
        }
      ],
      "requiredApprovals": 0,
      "order": 0,
      "deactivateAllowed": true
    }
  ],
  "id": "string",
  "name": "string",
  "accountID": "string",
  "status": "NOT_INITIALIZED",
  "statusText": "string",
  "kind": "QUORUM",
  "cryptoKind": "ECDSA",
  "providerKind": "string",
  "providerData": "string",
  "hierarchy": "string",
  "additionalData": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
500 Internal Server Error Get vault details failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» description string true none Vault description
» groups [object] true none Vault approval groups
»» name string true none Approval group name
»» members [object] true none A list of participants in the group
»»» approvedAt string true none Participant approval time
»»» id string true none Participant ID
»»» isApproved boolean true none Participant approval state
»»» name string true none Participant name
»»» status string true none Participant task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none Participant label
»»» isGlobal boolean true none Participant global state
»»» isActive boolean true none none
»» requiredApprovals integer(int32) true none The number of group participants that need to give approval
»» order integer(int32) true none This field determines the order in which groups are prompted for approvals
»» deactivateAllowed boolean true none A group participant can be deactivated for this group
» id string true none Vault ID
» name string true none Vault name
» accountID string true none Vault account ID
» status string true none Vault textual status
» statusText string true none Vault status text
» kind string true none Type of vault
» cryptoKind string false none Type of cryptographic algorithm
» providerKind string false none Coin type that created the vault
» providerData string true none This is a field that can be used to store information in the CASP database. The information can subsequently be read back as needed.
» hierarchy string true none Vault hierarchy
» additionalData string false none Some additional data, in String form, that was specified when the vault was created

Enumerated Values

Property Value
status STARTED
status DONE
status DECLINED
status NOT_INITIALIZED
status INITIALIZED
status DEACTIVATED
kind QUORUM
kind PRIVATE
cryptoKind ECDSA
cryptoKind EDDSA

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Create an address

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses

Create a new address

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
accountIndex path integer(int32) true Account index
chain path string true Add vault group member request

Enumerated Values

Parameter Value
chain change
chain external

Example responses

200 Response

{
  "publicKey": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad request Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» publicKey string true none The public key of the new address

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Start a signing process

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/sign',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/vaults/{id}/sign \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/vaults/{id}/sign

Start a vault signing process

Starts the process of a signing operation.

You can check the task status by calling the /operations API. When the signature is ready it is provided in the response payload.

This service should be used when the blockchain management is done outside of CASP, as it only signs the transaction without sending it to the relevant blockchain.

Body parameter

{
  "dataToSign": [
    "string"
  ],
  "publicKeys": [
    "string"
  ],
  "description": "string",
  "providerData": "string",
  "details": "string",
  "callbackUrl": "string",
  "rawTransactions": [
    "string"
  ],
  "ledgerHashAlgorithm": "NONE"
}

Parameters

Parameter In Type Required Description
id path string true Vault ID
body body object true Sign Request
» dataToSign body [string] true Data to be signed
» publicKeys body [string] true none
» description body string true Description of the sign request
» providerData body string false This is a field that can be used to store information in the CASP database. The information can subsequently be read back as needed.
» details body string false This is a field that can be used to store formatted operation information in the CASP database. The information can subsequently be sent to the end point for display
» callbackUrl body string false URL to get back to task initiator
» rawTransactions body [string] false An array of raw transaction strings that are sent to ledger.
» ledgerHashAlgorithm body string false Algorithm used to create data to sign

Detailed descriptions

» rawTransactions: An array of raw transaction strings that are sent to ledger. The strings must all have the same format, where the format of the strings depends on the ledger’s hash algorithm:

Enumerated Values

Parameter Value
» ledgerHashAlgorithm NONE
» ledgerHashAlgorithm SHA256

Example responses

200 Response

{
  "operationID": "string"
}

Responses

Status Meaning Description Schema
200 OK Sign request accepted Inline
400 Bad Request Bad request Inline
403 Forbidden Not allowed Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Sign failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 403

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get sign metadata

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/operations/sign/{operationid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/operations/sign/{operationid} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/operations/sign/{operationid}

Get sign metadata

Returns the sign operation metadata

Parameters

Parameter In Type Required Description
operationid path string true Operation ID

Example responses

200 Response

{
  "operationID": "string",
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultID": "string",
  "description": "string",
  "publicKeys": [
    "string"
  ],
  "dataToSign": [
    "string"
  ],
  "signatures": [
    "string"
  ],
  "v": [
    0
  ],
  "providerData": "string",
  "details": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Operation not found Inline
500 Internal Server Error Get Operation status failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultID string true none Vault ID
» description string true none Description of the operation
» publicKeys [string] true none the public corresponding to the private keys that will sign teh data
» dataToSign [string] true none List data to sign
» signatures [string] true none Signatures
» v [integer] true none the recovery code
» providerData string true none This is a field that can be used to store information in the CASP database. The information can subsequently be read back as needed.
» details string true none This is a field that can be used to store formatted operation information in the CASP database. The information can subsequently be sent to the end point for display

Enumerated Values

Property Value
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List BYOW operations

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/accounts/{id}/operations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/accounts/{id}/operations \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/accounts/{id}/operations

List BYOW operations

List operations associated with account vaults. By default, only operations which are in process (not completed) will be returned.

Parameters

Parameter In Type Required Description
id path string true Account ID
withCompleted query boolean false Include completed operations
onlyApproved query boolean false Show only approved operations

Example responses

200 Response

[
  {
    "operationID": "string",
    "kind": "CREATE_VAULT",
    "status": "PENDING",
    "statusText": "string",
    "createdAt": "string",
    "vaultID": "string",
    "description": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
500 Internal Server Error List BYOW operations failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID
» kind string true none Request kind
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultID string true none Vault ID
» description string true none Description of the operation

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List sub account operations

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/operations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/operations \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/operations

List sub account operations

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
accountIdentifier path string true Account identifier, which can be the index or the name

Example responses

200 Response

[
  {
    "operationID": "string",
    "kind": "CREATE_VAULT",
    "status": "PENDING",
    "statusText": "string",
    "createdAt": "string",
    "vaultID": "string",
    "description": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
500 Internal Server Error List sub account operations failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID
» kind string true none Request kind
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultID string true none Vault ID
» description string true none Description of the operation

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get BYOW operation status

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/operations/{operationid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/operations/{operationid} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/operations/{operationid}

Get BYOW operation status

Quorum vault operations require approval of the quorum. This request queries the status of such an asynchronous operation.

Parameters

Parameter In Type Required Description
operationid path string true Operation ID

Example responses

200 Response

{
  "operationID": "string",
  "kind": "CREATE_VAULT",
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultID": "string",
  "description": "string",
  "groups": [
    {
      "name": "string",
      "members": [
        {
          "approvedAt": "string",
          "id": "string",
          "isApproved": true,
          "name": "string",
          "status": "STARTED",
          "approvalGroupAccount": {
            "id": "string",
            "name": "string"
          },
          "label": "string",
          "isGlobal": true,
          "isActive": true
        }
      ],
      "requiredApprovals": 0,
      "order": 0,
      "deactivateAllowed": true
    }
  ],
  "isApproved": true,
  "accountID": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Operation not found Inline
500 Internal Server Error Get Operation status failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID
» kind string true none Request kind
» status string true none Operation status
» statusText string true none Operation status text
» createdAt string true none Operation creation time
» vaultID string true none Vault ID
» description string true none Description of the operation
» groups [object] true none Operation approval groups
»» name string true none Approval group name
»» members [object] true none A list of participants in the group
»»» approvedAt string true none Participant approval time
»»» id string true none Participant ID
»»» isApproved boolean true none Participant approval state
»»» name string true none Participant name
»»» status string true none Participant task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none Participant label
»»» isGlobal boolean true none Participant global state
»»» isActive boolean true none none
»» requiredApprovals integer(int32) true none The number of group participants that need to give approval
»» order integer(int32) true none This field determines the order in which groups are prompted for approvals
»» deactivateAllowed boolean true none A group participant can be deactivated for this group
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for the operation

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR
status STARTED
status DONE
status DECLINED

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Cancel pending operation

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/operations/{operationid}/cancel',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/operations/{operationid}/cancel \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/operations/{operationid}/cancel

Cancel pending operation

Parameters

Parameter In Type Required Description
operationid path string true Operation ID

Example responses

404 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
404 Not Found Operation not found Inline
409 Conflict Operation on running Inline
500 Internal Server Error Cancel pending operation failed Inline

Response Schema

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

BYOW Policy Management

Approvals are defined by a group of authorizing entities, of which a minimal-size subset (called a quorum) is required to approve the transaction. M approvals from a set of N entities is known as "MofN". For example, the client may define 8 entities, of which 4 must approve the transaction. Another example is where there must be 3 approvals from group A and 2 approvals from group B.

The number of groups, size of groups, and the size of the approving subset is fully flexible and can be different for each client. Every vault has an MofN policy associated with it, which is defined prior to the vault generation.

Add member to vault

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/members',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/vaults/{id}/members \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/vaults/{id}/members

Add participant to an existing vault group

This API is used if a participant becomes unavailable or leaves an account and needs to be replaced with a new participant. A new participant may be added to an existing vault, but requires the approval of the existing vault quorum.

Body parameter

{
  "participantID": "string",
  "groupName": "string",
  "description": "string"
}

Parameters

Parameter In Type Required Description
id path string true Vault ID
body body object true Add vault group participant request
» participantID body string true Participant ID
» groupName body string true Vault group name
» description body string false Description

Example responses

200 Response

{
  "operationID": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Not allowed Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operationID string true none Operation ID

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 405

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Deactivate vault member

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/members/{participantid}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X PUT /casp/api/v1.0/mng/vaults/{id}/members/{participantid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

PUT /casp/api/v1.0/mng/vaults/{id}/members/{participantid}

Deactivate a participant for a specific vault

The deactivated participant no longer takes part in the vault transaction approval processes

Body parameter

{
  "status": "ACTIVATED"
}

Parameters

Parameter In Type Required Description
participantid path string true Participant ID
id path string true vault ID
body body object true Participant status update request
» status body string true Participant status

Enumerated Values

Parameter Value
» status ACTIVATED
» status DEACTIVATED

Example responses

403 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
403 Forbidden Deactivating this participant would make the vault not operational (too few active participants left) Inline
404 Not Found Participant not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Deactivate participant failed Inline

Response Schema

Status Code 403

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

BYOW Keychain Management

Some implementations require a higher level of anonymity, meaning that a key should only be used a minimal number of times before switching to a new key. To accomplish this goal, CASP provides keychains, known as hierarchical deterministic wallets (or "HD Wallets"). Working with the CASP layer allows you to build any hierarchy of your choice. These keychains enable the creation of many keys for a single secret.

This section describes the APIs that enable you to create a different keychain structure to support your own coin type.

Add coin type to a vault

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/coins',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/vaults/{id}/coins \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/vaults/{id}/coins

Add a coin type to a vault

Body parameter

{
  "coinType": 0
}

Parameters

Parameter In Type Required Description
id path string true Vault ID
body body object true Add vault group participant request
» coinType body integer(int32) true The coin type

Example responses

404 Response

{
  "type": "string",
  "title": "string",
  "details": "string",
  "status": 0
}

Responses

Status Meaning Description Schema
200 OK OK None
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List coins in a vault

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/coins',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{id}/coins \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{id}/coins

List all the coins in a vault

Parameters

Parameter In Type Required Description
id path string true Vault ID

Example responses

200 Response

{
  "coins": [
    0
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» coins [integer] true none none

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get vault public key

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/publickey',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/publickey \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/publickey

Returns a deterministic vault's public key

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID

Example responses

200 Response

{
  "publicKey": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Request incorrectly formed Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» publicKey string true none Vault's public key

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Create an account

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts

Add an account to a coin in a vault

Body parameter

{
  "accountName": "string"
}

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
body body Create_an_accountBody false Add account request
» accountName body string true The account name

Example responses

200 Response

{
  "publicKeys": [
    "string"
  ],
  "accountName": "string",
  "accountIndex": 0
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad Request Inline
404 Not Found Item not found Inline
405 Method Not Allowed Vault hierarchy is not BIP 44 Inline
409 Conflict Account name already exists Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» publicKeys [string] true none the public keys
» accountName string false none the account's name
» accountIndex integer(int32) true none the account's index

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 405

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 409

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List accounts in a vault

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts

List all the accounts in a vault for a given coin

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type

Example responses

200 Response

[
  {
    "name": "string",
    "index": 0
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» name string false none an optional account name
» index integer(int32) true none the account's index

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Find account index by name

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/find',
  method: 'get',
  data: '?accountName=string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/find?accountName=string \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/find

Find account index by name

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
accountName query string true Account name

Example responses

200 Response

{
  "index": 0
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Account index not found Inline
500 Internal Server Error find account index failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» index integer(int32) true none The account index

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get account by identifier

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}

Get detailed information, including the public keys, about a vault for a given coin type and account index.

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
accountIdentifier path string true Account identifier, which can be the index or the name

Example responses

200 Response

{
  "publicKeys": [
    "string"
  ],
  "accountName": "string",
  "accountIndex": 0
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Request incorrectly formed Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» publicKeys [string] true none the public keys
» accountName string false none the account's name
» accountIndex integer(int32) true none the account's index

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List chain addresses

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses

List all the public keys for addresses in a vault for a given coin type, account index and address chain type

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
accountIndex path integer(int32) true Account index
chain path string true Add vault group participant request

Enumerated Values

Parameter Value
chain change
chain external

Example responses

200 Response

{
  "publicKeys": [
    "string"
  ],
  "accountName": "string",
  "accountIndex": 0
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Request incorrectly formed Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» publicKeys [string] true none the public keys
» accountName string false none the account's name
» accountIndex integer(int32) true none the account's index

Status Code 400

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get BYOW account backup

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/backup',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/backup \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/backup

Get backup for BIP44 account

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
accountIdentifier path string true Account identifier, which can be the index or the name

Example responses

200 Response

{
  "backupData": "string",
  "bipLevel": 0,
  "cpar": "string",
  "parentFingerprint": 0,
  "childNumber": 0,
  "publicKey": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Get account backup failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» backupData string true none the bip44 account private key, in an encrypted form
» bipLevel integer(int32) true none the account bip level, should always be 3
» cpar string true none the CPar
» parentFingerprint integer(int32) true none parent fingerprint
» childNumber integer(int32) true none child number
» publicKey string false none none

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Derive a key in a vault

Code samples

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/derivations',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X POST /casp/api/v1.0/mng/vaults/{vaultId}/derivations \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

POST /casp/api/v1.0/mng/vaults/{vaultId}/derivations

Derive a key in a vault

Body parameter

{
  "pathToDeriveFrom": "string",
  "hardDerivation": true,
  "childIndex": 0
}

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
body body object false Derive a keypair in a vault
» pathToDeriveFrom body string true The derivation path
» hardDerivation body boolean true Use hard derivation
» childIndex body integer(int32) true The child index

Example responses

200 Response

{
  "derivationPath": "string",
  "publicKey": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» derivationPath string true none the public derivation path
» publicKey string true none the public key

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

List all keys in a vault

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/derivations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/derivations \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/derivations

List all keys in a vault

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID

Example responses

200 Response

[
  {
    "derivationPath": "string",
    "publicKey": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» derivationPath string true none the public derivation path
» publicKey string true none the public key

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get public key by derivation path

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/derivation',
  method: 'get',
  data: '?derivationPath=string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/derivation?derivationPath=string \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/derivation

Get public key by derivation path

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
derivationPath query string true Derivation path

Example responses

200 Response

{
  "derivationPath": "string",
  "publicKey": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Get derivation failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» derivationPath string true none the public derivation path
» publicKey string true none the public key

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get backup data for public key

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/backup/{publicKey}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/backup/{publicKey} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/backup/{publicKey}

Get backup data for public key

The vault cryptographic material is backed up with a key that is external to the CASP system. The backup can be used for safe recovery of the vault in case of service failure, participants losing their shares, or termination of CASP usage.

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
publicKey path string true public key

Example responses

200 Response

{
  "vaultID": "string",
  "backupData": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Get vault backup data failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» vaultID string true none Vault ID
» backupData string true none Vault backup data

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Backup

CASP supports backing up key material and restoring the backup information for the different levels of the CASP entities: per vault, per sub-account (for HD wallets), and per specific address (for HD wallets).

When backing up a key (instead of backing up a vault seed), the CASP backup mechanism supports a publicly verifiable backup. Using only the backup public key, you can verify that the encrypted data is indeed the EC private key, which matches the known EC public key.

Get vault backup data

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{id}/backup',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{id}/backup \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{id}/backup

Get vault backup data

The vault cryptographic material is backed up with a key that is external to the CASP system. The backup can be used for safe recovery of the vault in case of service failure, participants losing their shares, or termination of CASP usage.

Parameters

Parameter In Type Required Description
id path string true Vault ID

Example responses

200 Response

{
  "vaultID": "string",
  "backupData": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Get vault backup data failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» vaultID string true none Vault ID
» backupData string true none Vault backup data

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get backup for account

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/backup',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/backup \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/backup

Get backup for BIP44 account

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
accountIdentifier path string true Account identifier, which can be the index or the name

Example responses

200 Response

{
  "backupData": "string",
  "bipLevel": 0,
  "cpar": "string",
  "parentFingerprint": 0,
  "childNumber": 0,
  "publicKey": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Get account backup failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» backupData string true none the bip44 account private key, in an encrypted form
» bipLevel integer(int32) true none the account bip level, should always be 3
» cpar string true none the CPar
» parentFingerprint integer(int32) true none parent fingerprint
» childNumber integer(int32) true none child number
» publicKey string false none none

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Get public key backup data

Code samples

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: '/casp/api/v1.0/mng/vaults/{vaultId}/backup/{publicKey}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

# You can also use wget
curl -X GET /casp/api/v1.0/mng/vaults/{vaultId}/backup/{publicKey} \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

GET /casp/api/v1.0/mng/vaults/{vaultId}/backup/{publicKey}

Get public key backup data

The vault cryptographic material is backed up with a key that is external to the CASP system. The backup can be used for safe recovery of the vault in case of service failure, participants losing their shares, or termination of CASP usage.

Parameters

Parameter In Type Required Description
vaultId path string true Vault ID
publicKey path string true public key

Example responses

200 Response

{
  "vaultID": "string",
  "backupData": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Get vault backup data failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» vaultID string true none Vault ID
» backupData string true none Vault backup data

Status Code 404

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 406

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code

Status Code 500

Name Type Required Restrictions Description
» type string true none Error identification
» title string true none Error summary
» details string true none Error details
» status integer(int64) true none Original HTTP status code