NAV Navigation
JavaScript Shell

Unbound CASP API for BYOW v1.0.2001

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.

For information about using these APIs, see the Unbound CASP Developers Guide, or the API references:

For more information about CASP, see:

For more information about the BIP standards, see:

Email: Unbound Tech Support Web: Unbound Tech Support

BYOW Vault Operations

Refer to the Vault Operations section in the Unbound CASP Developers Guide

Create new vault

Code samples

const inputBody = '{
  "name": "string",
  "description": "string",
  "cryptoKind": "ECDSA",
  "curveName": "Ed25519",
  "providerKind": "string",
  "hierarchy": "NONE",
  "coinType": 0,
  "firstAccountName": "string",
  "groups": [
    {
      "name": "string",
      "requiredApprovals": 1,
      "members": [
        {
          "id": "string"
        }
      ]
    }
  ],
  "policies": [
    {
      "name": "string",
      "description": "string",
      "enabled": true,
      "timeZone": "string",
      "groups": [
        {
          "name": "string",
          "requiredApprovals": 1,
          "members": [
            {
              "id": "string"
            }
          ]
        }
      ],
      "rules": {
        "weeklyTimeSlots": [
          {
            "days": "string",
            "timeStart": "string",
            "timeEnd": "string"
          }
        ],
        "amountRange": {
          "property1": {
            "minimum": 0,
            "maximum": 0
          },
          "property2": {
            "minimum": 0,
            "maximum": 0
          }
        },
        "whiteList": [
          "string"
        ],
        "derivedWhitelist": [
          {
            "chainCode": "string",
            "publicKey": "string",
            "level": 0,
            "parentFingerprint": "string",
            "childNumber": 0
          }
        ]
      }
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/accounts/{accountId}/vaults',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

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",
  "cryptoKind": "ECDSA",
  "curveName": "Ed25519",
  "providerKind": "string",
  "hierarchy": "NONE",
  "coinType": 0,
  "firstAccountName": "string",
  "groups": [
    {
      "name": "string",
      "requiredApprovals": 1,
      "members": [
        {
          "id": "string"
        }
      ]
    }
  ],
  "policies": [
    {
      "name": "string",
      "description": "string",
      "enabled": true,
      "timeZone": "string",
      "groups": [
        {
          "name": "string",
          "requiredApprovals": 1,
          "members": [
            {
              "id": "string"
            }
          ]
        }
      ],
      "rules": {
        "weeklyTimeSlots": [
          {
            "days": "string",
            "timeStart": "string",
            "timeEnd": "string"
          }
        ],
        "amountRange": {
          "property1": {
            "minimum": 0,
            "maximum": 0
          },
          "property2": {
            "minimum": 0,
            "maximum": 0
          }
        },
        "whiteList": [
          "string"
        ],
        "derivedWhitelist": [
          {
            "chainCode": "string",
            "publicKey": "string",
            "level": 0,
            "parentFingerprint": "string",
            "childNumber": 0
          }
        ]
      }
    }
  ]
}

Parameters

Name In Type Required Description
accountId path string true Account ID
body body object true Create Vault Request
» name body string true Vault name
» description body string false vault description
» cryptoKind body string true Type of cryptographic algorithm
» curveName body string false The name of the curve
» providerKind body string false Type of crypto currency
» hierarchy body string false Vault hierarchy. defaults to deterministic
» coinType body integer(int32) false BIP44 coin type. see examples of known coin types in https://github.com/satoshilabs/slips/blob/master/slip-0044.md
» 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 participants
»»» id body string true Participant ID
» policies body [object] false policies set
»» name body string true policy name
»» description body string false Policy description
»» enabled body boolean false is the policy enabled, default is TRUE
»» timeZone body string false Policy time zone, default is UTC
»» groups body [object] true none
»»» 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
»» rules body object false Policy rules
»»» weeklyTimeSlots body [object] false none
»»»» days body string true Days of the week in comma separated list. e.g. 0,1,3 for Sunday, Monday and Wednesday
»»»» timeStart body string true UTC time of day in the following format: HH:MM
»»»» timeEnd body string true UTC time of day in the following format: HH:MM
»»» amountRange body object false none
»»»» additionalProperties body object false none
»»»»» minimum body integer false lower limit
»»»»» maximum body integer false upper limit
»»» whiteList body [string] false none
»»» derivedWhitelist body [object] false none
»»»» chainCode body string false none
»»»» publicKey body string false none
»»»» level body integer(int32) false none
»»»» parentFingerprint body string false none
»»»» childNumber body integer(int32) false none

Enumerated Values

Parameter Value
» cryptoKind ECDSA
» cryptoKind EDDSA
» curveName Ed25519
» curveName secp256r1
» curveName secp256k1
» 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 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 BYOW vaults

Code samples


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

};

fetch('/casp/api/v1.0/mng/accounts/{accountId}/vaults',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

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

Parameters

Name In Type Required Description
accountId path string true Account ID
withDeactivated query boolean false Include deactivated vaults
providerKind query string false Filter by coin type
filter query string false Search the vault names and descriptions
sort query string false Specify the column name to sort by and the sort direction. The format is '{column_name}:{asc/desc}'. The default sort is ascending.

The column name can be one of the following: Name, Provider, Description, Status
skip query integer(int32) false The number of results to skip from the beginning of the results after applying the filter and sort
limit query integer(int32) false Maximum number of results to return

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad Request 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
» totalItems integer(int32) true none Total Items
» items [object] true none Items
»» 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.
»» pendingOperations integer(int64) true none Vault pending requests
»» hierarchy string true none Vault status text

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 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

Get BYOW vault info

Code samples


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

Get details of a vault

Parameters

Name In Type Required Description
vaultId 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,
          "globalStatus": "string"
        }
      ],
      "requiredApprovals": 0,
      "order": 0,
      "deactivateAllowed": true,
      "sparePartiesLeft": 0
    }
  ],
  "id": "string",
  "name": "string",
  "accountID": "string",
  "status": "NOT_INITIALIZED",
  "statusText": "string",
  "isActive": true,
  "cryptoKind": "ECDSA",
  "curveName": "string",
  "providerKind": "string",
  "providerData": "string",
  "hierarchy": "string",
  "policies": [
    {
      "name": "string",
      "id": "string",
      "description": "string",
      "enabled": true,
      "timeZone": "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,
              "globalStatus": "string"
            }
          ],
          "requiredApprovals": 0,
          "order": 0,
          "deactivateAllowed": true
        }
      ],
      "rules": {
        "weeklyTimeSlots": [
          {
            "days": "string",
            "timeStart": "string",
            "timeEnd": "string"
          }
        ],
        "amountRange": {
          "property1": {
            "minimum": 0,
            "maximum": 0
          },
          "property2": {
            "minimum": 0,
            "maximum": 0
          }
        },
        "whiteList": [
          "string"
        ],
        "derivedWhitelist": [
          {
            "chainCode": "string",
            "publicKey": "string",
            "level": 0,
            "parentFingerprint": "string",
            "childNumber": 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

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 ParticipantWithVault approval time
»»» id string true none ParticipantWithVault ID
»»» isApproved boolean true none ParticipantWithVault approval state
»»» name string true none ParticipantWithVault name
»»» status string true none ParticipantWithVault task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none ParticipantWithVault label
»»» isGlobal boolean true none ParticipantWithVault global state
»»» isActive boolean true none none
»»» globalStatus string 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 suspended or revoked from this group
»» sparePartiesLeft integer(int32) true none Count Spare Parties left By Group Name
» 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
» isActive boolean true none Vault active state
» cryptoKind string false none Type of cryptographic algorithm
» curveName string true none Vault's curve
» 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
» policies [object] false none Vault policies
»» name string true none policy name
»» id string true none policy id
»» description string false none Policy description
»» enabled boolean false none is the policy enabled, default is TRUE
»» timeZone string false none Policy time zone
»» groups [object] true none Approval groups
»»» name string true none Approval group name
»»» members [object] true none A list of participants in the group
»»»» approvedAt string true none ParticipantWithVault approval time
»»»» id string true none ParticipantWithVault ID
»»»» isApproved boolean true none ParticipantWithVault approval state
»»»» name string true none ParticipantWithVault name
»»»» status string true none ParticipantWithVault task status
»»»» approvalGroupAccount object true none none
»»»»» id string true none Account ID
»»»»» name string true none Account name
»»»» label string true none ParticipantWithVault label
»»»» isGlobal boolean true none ParticipantWithVault global state
»»»» isActive boolean true none none
»»»» globalStatus string 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 suspended or revoked from this group
»» rules object false none Policy rules
»»» weeklyTimeSlots [object] false none none
»»»» days string true none Days of the week in comma separated list. e.g. 0,1,3 for Sunday, Monday and Wednesday
»»»» timeStart string true none UTC time of day in the following format: HH:MM
»»»» timeEnd string true none UTC time of day in the following format: HH:MM
»»» amountRange object false none none
»»»» additionalProperties object false none none
»»»»» minimum integer false none lower limit
»»»»» maximum integer false none upper limit
»»» whiteList [string] false none none
»»» derivedWhitelist [object] false none none
»»»» chainCode string false none none
»»»» publicKey string false none none
»»»» level integer(int32) false none none
»»»» parentFingerprint string false none none
»»»» childNumber integer(int32) false none none

Enumerated Values

Property Value
status STARTED
status DONE
status DECLINED
status NOT_INITIALIZED
status INITIALIZED
status DEACTIVATED
cryptoKind ECDSA
cryptoKind EDDSA
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

Create a new address

Code samples


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

Parameters

Name 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
encoding query string false Key encoding. The default is DER.

Enumerated Values

Parameter Value
chain change
chain external
encoding DER
encoding compressed
encoding uncompressed

Example responses

200 Response

{
  "publicKey": "string",
  "derivationString": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type 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
» derivationString string true none The derivation string of the new address

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 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

const inputBody = '{
  "dataToSign": [
    "string"
  ],
  "publicKeys": [
    "string"
  ],
  "derivationStrings": [
    "string"
  ],
  "description": "string",
  "providerData": "string",
  "details": "string",
  "callbackUrl": "string",
  "allowConcurrentKeyUsage": true,
  "rawTransactions": [
    "string"
  ],
  "ledgerHashAlgorithm": "IGNORE",
  "changeAddressDerivationString": "string",
  "decimals": [
    0
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/sign',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

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.

Either publicKeys or derivationStrings must be provided.

Body parameter

{
  "dataToSign": [
    "string"
  ],
  "publicKeys": [
    "string"
  ],
  "derivationStrings": [
    "string"
  ],
  "description": "string",
  "providerData": "string",
  "details": "string",
  "callbackUrl": "string",
  "allowConcurrentKeyUsage": true,
  "rawTransactions": [
    "string"
  ],
  "ledgerHashAlgorithm": "IGNORE",
  "changeAddressDerivationString": "string",
  "decimals": [
    0
  ]
}

Parameters

Name In Type Required Description
vaultId path string true Vault ID
body body object true Sign Request
» dataToSign body [string] true Data to be signed (as list of HEX strings).
» publicKeys body [string] false Public keys. Either publicKeys or derivationStrings must be provided.
» derivationStrings body [string] false The derivation paths to sign. Either publicKeys or derivationStrings must be provided.
» 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 operation information as a JSON string 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
» allowConcurrentKeyUsage body boolean false Allow concurrent key usage. The default is false
» rawTransactions body [string] false An array of raw transactions ledger in the specific ledger format (as list of HEX strings).
» ledgerHashAlgorithm body string false Algorithm used to calculate data to sign
» changeAddressDerivationString body string false the derivation string of the change address
» decimals body [integer] false Decimals of cryptocurrency units

Enumerated Values

Parameter Value
» ledgerHashAlgorithm IGNORE
» ledgerHashAlgorithm PLAIN
» ledgerHashAlgorithm SHA256
» ledgerHashAlgorithm DOUBLE_SHA256
» ledgerHashAlgorithm SHA3_256

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 operation

Code samples


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

};

fetch('/casp/api/v1.0/mng/operations/sign/{operationid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

Returns the sign operation metadata.

Parameters

Name In Type Required Description
operationid path string true Operation ID. The Operation ID parameter must be from a 'QUORUM_SIGN' operation.

Example responses

200 Response

{
  "operationID": "string",
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultID": "string",
  "description": "string",
  "isApproved": true,
  "accountID": "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,
          "globalStatus": "string"
        }
      ],
      "requiredApprovals": 0,
      "order": 0,
      "deactivateAllowed": true
    }
  ],
  "policy": {
    "id": "string",
    "name": "string"
  },
  "vaultName": "string",
  "publicKeys": [
    "string"
  ],
  "dataToSign": [
    "string"
  ],
  "signatures": [
    "string"
  ],
  "v": [
    0
  ],
  "providerData": "string",
  "details": "string",
  "rawTransactions": [
    "string"
  ],
  "ledgerHashAlgorithm": "IGNORE",
  "callbackUrl": "string",
  "subAccount": 0
}

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
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for 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 ParticipantWithVault approval time
»»» id string true none ParticipantWithVault ID
»»» isApproved boolean true none ParticipantWithVault approval state
»»» name string true none ParticipantWithVault name
»»» status string true none ParticipantWithVault task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none ParticipantWithVault label
»»» isGlobal boolean true none ParticipantWithVault global state
»»» isActive boolean true none none
»»» globalStatus string 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 suspended or revoked from this group
» policy object false none Operation approval groups
»» id string true none Policy id
»» name string true none Policy name
» vaultName string true none Vault name for the operation
» publicKeys [string] true none The public keys corresponding to the private keys that will sign the data
» dataToSign [string] true none List data to sign
» signatures [string] true none Signatures. Each signature is 64 bytes, with 32 bytes R and 32 bytes S (in big-endian order).
» v [integer] true none This parameter returns raw values 0 or 1, which can be used to recover the public key from the generated signature.
» 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 operation information as a JSON string in the CASP database. The information can subsequently be sent to the end point for display.
» rawTransactions [string] false none 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:
- For SHA3_256, it is a hex encoded string.
- For DOUBLE_SHA256, it is a hex encoded string.
- For SHA256, it is a hex encoded string.
- For PLAIN, it is a base64 string.
- For IGNORE do not compare.
» ledgerHashAlgorithm string false none Algorithm used to create data to sign
» callbackUrl string false none URL to get back to task initiator
» subAccount integer(int32) false none the sub account index

Enumerated Values

Property Value
status PENDING
status PENDING_ACTIVATION
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR
status STARTED
status DONE
status DECLINED
ledgerHashAlgorithm IGNORE
ledgerHashAlgorithm PLAIN
ledgerHashAlgorithm SHA256
ledgerHashAlgorithm DOUBLE_SHA256
ledgerHashAlgorithm SHA3_256

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

Code samples


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

};

fetch('/casp/api/v1.0/mng/accounts/{accountId}/operations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

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

Parameters

Name In Type Required Description
accountId path string true Account ID
status query array[string] false Show operations with one or more of the following statuses: approved, completed, pending, pending_activation, canceled, declined, failed, error
filter query string false Search the operation names and descriptions
sort query string false Specify the column name to sort by and the sort direction. The format is '{column_name}:{asc/desc}'. The default sort is ascending.

The column name can be one of the following: Vault, Kind, CreatedAt, StatusText, Description
skip query integer(int32) false The number of results to skip from the beginning of the results after applying the filter and sort
limit query integer(int32) false The maximum number of results to return

Example responses

200 Response

{
  "totalItems": 0,
  "items": [
    {
      "operationID": "string",
      "kind": "CREATE_VAULT",
      "status": "PENDING",
      "statusText": "string",
      "createdAt": "string",
      "vaultID": "string",
      "description": "string",
      "isApproved": true,
      "accountID": "string",
      "vaultName": "string",
      "providerKind": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad Request Inline
404 Not Found Not found Inline
500 Internal Server Error List operations per account failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» totalItems integer(int32) true none Total Items
» items [object] true none Items
»» 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
»» isApproved boolean true none Approval state for the operation
»» accountID string true none Account ID for the operation
»» vaultName string true none Vault Name
»» providerKind string true none Provider Kind

Enumerated Values

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

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 sub account operations

Code samples


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/operations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

Parameters

Name 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
skip query integer(int32) false The number of results to skip from the beginning of the results
limit query integer(int32) false The maximum number of results to return

Example responses

200 Response

{
  "totalItems": 0,
  "items": [
    {
      "operationID": "string",
      "kind": "CREATE_VAULT",
      "status": "PENDING",
      "statusText": "string",
      "createdAt": "string",
      "vaultID": "string",
      "description": "string",
      "isApproved": true,
      "accountID": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
405 Method Not Allowed Incorrect vault type Inline
500 Internal Server Error List sub account operations failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» totalItems integer(int32) true none Total Items
» items [object] true none Items
»» 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
»» 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 PENDING_ACTIVATION
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR

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 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 operation status

Code samples


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

};

fetch('/casp/api/v1.0/mng/operations/{operationid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

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

Parameters

Name 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",
  "isApproved": true,
  "accountID": "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,
          "globalStatus": "string"
        }
      ],
      "requiredApprovals": 0,
      "order": 0,
      "deactivateAllowed": true
    }
  ],
  "policy": {
    "id": "string",
    "name": "string"
  },
  "vaultName": "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
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for 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 ParticipantWithVault approval time
»»» id string true none ParticipantWithVault ID
»»» isApproved boolean true none ParticipantWithVault approval state
»»» name string true none ParticipantWithVault name
»»» status string true none ParticipantWithVault task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none ParticipantWithVault label
»»» isGlobal boolean true none ParticipantWithVault global state
»»» isActive boolean true none none
»»» globalStatus string 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 suspended or revoked from this group
» policy object false none Operation approval groups
»» id string true none Policy id
»» name string true none Policy name
» vaultName string true none Vault name for the operation

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status PENDING_ACTIVATION
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


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

};

fetch('/casp/api/v1.0/mng/operations/{operationid}/cancel',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

Parameters

Name 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

Update vault policies

Code samples

const inputBody = '[
  {
    "name": "string",
    "id": "string",
    "description": "string",
    "enabled": true,
    "timeZone": "string",
    "rules": {
      "weeklyTimeSlots": [
        {
          "days": "string",
          "timeStart": "string",
          "timeEnd": "string"
        }
      ],
      "amountRange": {
        "property1": {
          "minimum": 0,
          "maximum": 0
        },
        "property2": {
          "minimum": 0,
          "maximum": 0
        }
      },
      "whiteList": [
        "string"
      ],
      "derivedWhitelist": [
        {
          "chainCode": "string",
          "publicKey": "string",
          "level": 0,
          "parentFingerprint": "string",
          "childNumber": 0
        }
      ]
    }
  }
]';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/policies',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

PUT /casp/api/v1.0/mng/vaults/{vaultId}/policies

Update vault policies

Body parameter

[
  {
    "name": "string",
    "id": "string",
    "description": "string",
    "enabled": true,
    "timeZone": "string",
    "rules": {
      "weeklyTimeSlots": [
        {
          "days": "string",
          "timeStart": "string",
          "timeEnd": "string"
        }
      ],
      "amountRange": {
        "property1": {
          "minimum": 0,
          "maximum": 0
        },
        "property2": {
          "minimum": 0,
          "maximum": 0
        }
      },
      "whiteList": [
        "string"
      ],
      "derivedWhitelist": [
        {
          "chainCode": "string",
          "publicKey": "string",
          "level": 0,
          "parentFingerprint": "string",
          "childNumber": 0
        }
      ]
    }
  }
]

Parameters

Name In Type Required Description
vaultId path string true Vault ID
body body array[object] true Create Vault Request

Example responses

200 Response

{
  "operationID": "string",
  "kind": "CREATE_VAULT",
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultID": "string",
  "description": "string",
  "isApproved": true,
  "accountID": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request bad request Inline
404 Not Found Vault not found Inline
500 Internal Server Error Update vault policies 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
» 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 PENDING_ACTIVATION
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR

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

BYOW Policy Management

Refer to the Policy Management section in the Unbound CASP Developers Guide

Add member to vault

Code samples

const inputBody = '{
  "participantID": "string",
  "description": "string",
  "policyId": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/approval_groups/{approvalGroupId}/members',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

POST /casp/api/v1.0/mng/vaults/{vaultId}/approval_groups/{approvalGroupId}/members

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",
  "description": "string",
  "policyId": "string"
}

Parameters

Name In Type Required Description
vaultId path string true Vault ID
approvalGroupId path string true Approval Group Id
body body object true Add vault group participant request
» participantID body string true ParticipantWithVault ID
» description body string false Description
» policyId body string false policy id to join

Example responses

200 Response

{
  "operation": {
    "operationID": "string",
    "kind": "CREATE_VAULT",
    "status": "PENDING",
    "statusText": "string",
    "createdAt": "string",
    "vaultID": "string",
    "description": "string",
    "isApproved": true,
    "accountID": "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,
            "globalStatus": "string"
          }
        ],
        "requiredApprovals": 0,
        "order": 0,
        "deactivateAllowed": true
      }
    ],
    "policy": {
      "id": "string",
      "name": "string"
    },
    "vaultName": "string"
  },
  "participant": {
    "id": "string",
    "accountID": "string",
    "name": "string",
    "email": "string",
    "status": "NOT_ACTIVATED",
    "isActive": true,
    "accountName": "string",
    "role": "string",
    "pushEnabled": true,
    "offline": true,
    "activeOperations": 0
  }
}

Responses

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

Response Schema

Status Code 200

Name Type Required Restrictions Description
» operation object true none Operation
»» 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
»» isApproved boolean true none Approval state for the operation
»» accountID string true none Account ID for 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 ParticipantWithVault approval time
»»»» id string true none ParticipantWithVault ID
»»»» isApproved boolean true none ParticipantWithVault approval state
»»»» name string true none ParticipantWithVault name
»»»» status string true none ParticipantWithVault task status
»»»» approvalGroupAccount object true none none
»»»»» id string true none Account ID
»»»»» name string true none Account name
»»»» label string true none ParticipantWithVault label
»»»» isGlobal boolean true none ParticipantWithVault global state
»»»» isActive boolean true none none
»»»» globalStatus string 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 suspended or revoked from this group
»» policy object false none Operation approval groups
»»» id string true none Policy id
»»» name string true none Policy name
»» vaultName string true none Vault name for the operation
» participant object true none ParticipantWithVault
»» 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
»» pushEnabled boolean true none Is the push notifications enabled for this participant
»» offline boolean true none Participant is offline
»» activeOperations integer(int64) true none Participant is offline

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status PENDING_ACTIVATION
status APPROVED
status COMPLETED
status DECLINED
status CANCELED
status FAILED
status ERROR
status STARTED
status DONE
status DECLINED
status NOT_ACTIVATED
status ACTIVATED
status DEACTIVATED
status SUSPENDED
status REVOKED

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 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 join policy vault operation

Code samples


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

};

fetch('/casp/api/v1.0/mng/operations/joinpolicyvault/{operationid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

Returns join policy vault operation details.

Parameters

Name In Type Required Description
operationid path string true Operation ID. The Operation ID parameter must be from a 'JOIN_POLICY_VAULT' operation.

Example responses

200 Response

{
  "operationID": "string",
  "kind": "CREATE_VAULT",
  "status": "PENDING",
  "statusText": "string",
  "createdAt": "string",
  "vaultID": "string",
  "description": "string",
  "isApproved": true,
  "accountID": "string",
  "policies": [
    {
      "name": "string",
      "id": "string",
      "description": "string",
      "enabled": true,
      "timeZone": "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,
              "globalStatus": "string"
            }
          ],
          "requiredApprovals": 0,
          "order": 0,
          "deactivateAllowed": true
        }
      ],
      "rules": {
        "weeklyTimeSlots": [
          {
            "days": "string",
            "timeStart": "string",
            "timeEnd": "string"
          }
        ],
        "amountRange": {
          "property1": {
            "minimum": 0,
            "maximum": 0
          },
          "property2": {
            "minimum": 0,
            "maximum": 0
          }
        },
        "whiteList": [
          "string"
        ],
        "derivedWhitelist": [
          {
            "chainCode": "string",
            "publicKey": "string",
            "level": 0,
            "parentFingerprint": "string",
            "childNumber": 0
          }
        ]
      }
    }
  ],
  "vaultName": "string",
  "groupNameToJoin": "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
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for the operation
» policies [object] true none Policies
»» name string true none policy name
»» id string true none policy id
»» description string false none Policy description
»» enabled boolean false none is the policy enabled, default is TRUE
»» timeZone string false none Policy time zone
»» groups [object] true none Approval groups
»»» name string true none Approval group name
»»» members [object] true none A list of participants in the group
»»»» approvedAt string true none ParticipantWithVault approval time
»»»» id string true none ParticipantWithVault ID
»»»» isApproved boolean true none ParticipantWithVault approval state
»»»» name string true none ParticipantWithVault name
»»»» status string true none ParticipantWithVault task status
»»»» approvalGroupAccount object true none none
»»»»» id string true none Account ID
»»»»» name string true none Account name
»»»» label string true none ParticipantWithVault label
»»»» isGlobal boolean true none ParticipantWithVault global state
»»»» isActive boolean true none none
»»»» globalStatus string 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 suspended or revoked from this group
»» rules object false none Policy rules
»»» weeklyTimeSlots [object] false none none
»»»» days string true none Days of the week in comma separated list. e.g. 0,1,3 for Sunday, Monday and Wednesday
»»»» timeStart string true none UTC time of day in the following format: HH:MM
»»»» timeEnd string true none UTC time of day in the following format: HH:MM
»»» amountRange object false none none
»»»» additionalProperties object false none none
»»»»» minimum integer false none lower limit
»»»»» maximum integer false none upper limit
»»» whiteList [string] false none none
»»» derivedWhitelist [object] false none none
»»»» chainCode string false none none
»»»» publicKey string false none none
»»»» level integer(int32) false none none
»»»» parentFingerprint string false none none
»»»» childNumber integer(int32) false none none
» vaultName string true none Vault name for the operation
» groupNameToJoin string true none Group to join

Enumerated Values

Property Value
kind CREATE_VAULT
kind ADD_MEMBER
kind SIGN
status PENDING
status PENDING_ACTIVATION
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

Set vault member status

Code samples

const inputBody = '{
  "status": "DEACTIVATED"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/members/{participantId}/status',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

PUT /casp/api/v1.0/mng/vaults/{vaultId}/members/{participantId}/status

The suspended participant no longer takes part in the vault approval processes. Note that you can only suspend or revoke a user if the remaining number of participants is sufficient for the quorum, unless 'force' flag is provided.

Body parameter

{
  "status": "DEACTIVATED"
}

Parameters

Name In Type Required Description
participantId path string true Participant ID
vaultId path string true vault ID
force query boolean false Force update of participant status. Warning: Using this flag can result in an unusable vault!
body body object true Participant status update request
» status body string true ParticipantWithVault status in vault

Enumerated Values

Parameter Value
» status DEACTIVATED
» status SUSPENDED
» status REVOKED
» status ACTIVATED

Example responses

200 Response

{
  "id": "string",
  "name": "string",
  "status": "ACTIVATED",
  "approvalGroupAccount": {
    "id": "string",
    "name": "string"
  },
  "label": "string",
  "isGlobal": true,
  "isActive": true
}

Responses

Status Meaning Description Schema
200 OK OK Inline
202 Accepted Accepted Inline
403 Forbidden Suspending or revoking 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 Set vault member status failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none ParticipantWithVault ID
» name string true none ParticipantWithVault name
» status string true none ParticipantWithVault task status
» approvalGroupAccount object true none none
»» id string true none Account ID
»» name string true none Account name
» label string true none ParticipantWithVault label
» isGlobal boolean true none ParticipantWithVault global state
» isActive boolean true none none

Enumerated Values

Property Value
status ACTIVATED
status SUSPENDED
status REVOKED

Status Code 202

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
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for 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 ParticipantWithVault approval time
»»» id string true none ParticipantWithVault ID
»»» isApproved boolean true none ParticipantWithVault approval state
»»» name string true none ParticipantWithVault name
»»» status string true none ParticipantWithVault task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none ParticipantWithVault label
»»» isGlobal boolean true none ParticipantWithVault global state
»»» isActive boolean true none none
»»» globalStatus string 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 suspended or revoked from this group
» policy object false none Operation approval groups
»» id string true none Policy id
»» name string true none Policy name
» vaultName string true none Vault name for the operation

Enumerated Values

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

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

Set vault member status (deprecated)

Code samples

const inputBody = '{
  "status": "DEACTIVATED",
  "policyId": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/members/{participantId}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

PUT /casp/api/v1.0/mng/vaults/{vaultId}/members/{participantId}

The suspended participant no longer takes part in the vault transaction approval processes. Note that you can only suspend or revoke a user, if the remaining number of participants is sufficient for the quorum policy, unless 'force' flag is provided.

Body parameter

{
  "status": "DEACTIVATED",
  "policyId": "string"
}

Parameters

Name In Type Required Description
participantId path string true Participant ID
vaultId path string true vault ID
body body object true Participant status update request
» status body string true ParticipantWithVault status in vault
» policyId body string false The policy ID in which to change a participant's status. If none is specified, the participant's status will be changed in the admin quorum.

Enumerated Values

Parameter Value
» status DEACTIVATED
» status SUSPENDED
» status REVOKED
» status ACTIVATED

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
406 Not Acceptable Not supported Inline
500 Internal Server Error Set vault member status 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

Set policy member status

Code samples

const inputBody = '{
  "status": "DEACTIVATED"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/policies/{policyId}/members/{participantId}/status',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

PUT /casp/api/v1.0/mng/vaults/{vaultId}/policies/{policyId}/members/{participantId}/status

The suspended participant no longer takes part in the vault transaction approval processes. Note that you can only suspend or revoke a user, if the remaining number of participants is sufficient for the quorum policy, unless 'force' flag is provided.

Body parameter

{
  "status": "DEACTIVATED"
}

Parameters

Name In Type Required Description
participantId path string true Participant ID
vaultId path string true vault ID
policyId path string true policy ID
force query boolean false Force update of participant status
body body object true Participant status update request
» status body string true ParticipantWithVault status in vault

Enumerated Values

Parameter Value
» status DEACTIVATED
» status SUSPENDED
» status REVOKED
» status ACTIVATED

Example responses

200 Response

{
  "id": "string",
  "name": "string",
  "status": "ACTIVATED",
  "approvalGroupAccount": {
    "id": "string",
    "name": "string"
  },
  "label": "string",
  "isGlobal": true,
  "isActive": true
}

Responses

Status Meaning Description Schema
200 OK OK Inline
202 Accepted Accepted Inline
403 Forbidden Suspending or revoking this participant would make the vault not operational (too few active participants left) Inline
404 Not Found Item not found Inline
406 Not Acceptable Not supported Inline
500 Internal Server Error Set vault member status participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none ParticipantWithVault ID
» name string true none ParticipantWithVault name
» status string true none ParticipantWithVault task status
» approvalGroupAccount object true none none
»» id string true none Account ID
»» name string true none Account name
» label string true none ParticipantWithVault label
» isGlobal boolean true none ParticipantWithVault global state
» isActive boolean true none none

Enumerated Values

Property Value
status ACTIVATED
status SUSPENDED
status REVOKED

Status Code 202

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
» isApproved boolean true none Approval state for the operation
» accountID string true none Account ID for 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 ParticipantWithVault approval time
»»» id string true none ParticipantWithVault ID
»»» isApproved boolean true none ParticipantWithVault approval state
»»» name string true none ParticipantWithVault name
»»» status string true none ParticipantWithVault task status
»»» approvalGroupAccount object true none none
»»»» id string true none Account ID
»»»» name string true none Account name
»»» label string true none ParticipantWithVault label
»»» isGlobal boolean true none ParticipantWithVault global state
»»» isActive boolean true none none
»»» globalStatus string 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 suspended or revoked from this group
» policy object false none Operation approval groups
»» id string true none Policy id
»» name string true none Policy name
» vaultName string true none Vault name for the operation

Enumerated Values

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

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

Refer to the Keychain Management section in the Unbound CASP Developers Guide

Add a coin type to a vault

Code samples

const inputBody = '{
  "coinType": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

Body parameter

{
  "coinType": 0
}

Parameters

Name In Type Required Description
vaultId 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
405 Method Not Allowed Incorrect vault type 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 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 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 the coins in a vault

Code samples


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

This endpoint is only functional if you generated a BIP44 vault.

Parameters

Name In Type Required Description
vaultId path string true Vault ID
skip query integer(int32) false The number of results to skip from the beginning of the results
limit query integer(int32) false The maximum number of results to return

Example responses

200 Response

{
  "totalItems": 0,
  "items": [
    0
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» totalItems integer(int32) true none Total Items
» items [integer] true none Items

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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/publickey',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

Returns a deterministic vault's public key. Note that this is only valid for a vault with no hierarchy.

Parameters

Name In Type Required Description
vaultId path string true Vault ID
encoding query string false Key encoding. The default is DER.

Enumerated Values

Parameter Value
encoding DER
encoding compressed
encoding uncompressed

Example responses

200 Response

{
  "publicKey": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type 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 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 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

const inputBody = '{
  "accountName": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

Add an account to a coin in a vault.

This endpoint is only functional if you generated a BIP44 vault.

Body parameter

{
  "accountName": "string"
}

Parameters

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

Example responses

200 Response

{
  "publicKeys": [
    "string"
  ],
  "chains": [
    "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 Incorrect vault type 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
» chains [string] true none chains
» 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

List all the accounts in a vault for a given coin.

This endpoint is only functional if you generated a BIP44 vault.

Parameters

Name In Type Required Description
vaultId path string true Vault ID
coinType path integer(int32) true Coin type
skip query integer(int32) false The number of results to skip from the beginning of the results
limit query integer(int32) false The maximum number of results to return

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» totalItems integer(int32) true none Total Items
» items [object] true none Items
»» 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 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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/find?accountName=string',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

This endpoint is only functional if you generated a BIP44 vault.

Parameters

Name 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
405 Method Not Allowed Incorrect vault type 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 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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

Get detailed information about a vault for a given coin type and account index.

Parameters

Name 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

{
  "accountName": "string",
  "accountIndex": 0
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» accountName string false none the account's name
» accountIndex 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 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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIndex}/chains/{chain}/addresses',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

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

This endpoint is only functional if you generated a BIP44 vault.

Parameters

Name 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 Address type
encoding query string false Key encoding. The default is DER.
sort query string false Specify the column name to sort by and the sort direction. The format is '{column_name}:{asc/desc}'. The default sort is ascending.

The column name can be one of the following: lastUpdatedAt
skip query integer(int32) false The number of results to skip from the beginning of the results
limit query integer(int32) false The maximum number of results to return

Enumerated Values

Parameter Value
chain change
chain external
chain all
encoding DER
encoding compressed
encoding uncompressed

Example responses

200 Response

{
  "totalItems": 0,
  "items": [
    "string"
  ],
  "chains": [
    "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 Incorrect vault type Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» totalItems integer(int32) true none Total Items
» items [string] true none Public key items
» chains [string] true none chains
» 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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/coins/{coinType}/accounts/{accountIdentifier}/backup',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

Get backup for BIP44 account.

This endpoint is only functional if you generated a BIP44 vault.

Parameters

Name 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

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

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
405 Method Not Allowed Incorrect vault type Inline
500 Internal Server Error Get account backup failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» vaultId string true none the vault ID
» backupData string true none The backup data, in encrypted form
» bipLevel integer(int32) true none derivation level
» cpar string true none CPar
» parentFingerprint string 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 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 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

const inputBody = '{
  "pathToDeriveFrom": "string",
  "hardDerivation": true,
  "childIndex": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/derivations',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

# 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: Bearer API_KEY'

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

This endpoint is only functional if you generated a BIP32 vault.

Body parameter

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

Parameters

Name In Type Required Description
vaultId path string true Vault ID
encoding query string false Key encoding. The default is DER.
body body object true Derive a keypair in a vault
» pathToDeriveFrom body string true The derivation path to derive from
» hardDerivation body boolean true Use hard derivation
» childIndex body integer(int32) true The child index

Enumerated Values

Parameter Value
encoding DER
encoding compressed
encoding uncompressed

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type 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 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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/derivations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

This endpoint is only functional if you generated a BIP32 vault.

Parameters

Name In Type Required Description
vaultId path string true Vault ID
encoding query string false Key encoding. The default is DER.
skip query integer(int32) false The number of results to skip from the beginning of the results
limit query integer(int32) false The maximum number of results to return

Enumerated Values

Parameter Value
encoding DER
encoding compressed
encoding uncompressed

Example responses

200 Response

{
  "totalItems": 0,
  "items": [
    {
      "derivationPath": "string",
      "publicKey": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type Inline
500 Internal Server Error Add participant failed Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» totalItems integer(int32) true none Total Items
» items [object] true none Items
»» 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 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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/derivation?derivationPath=string',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

This endpoint is only functional if you generated a BIP32 vault.

Parameters

Name In Type Required Description
vaultId path string true Vault ID
derivationPath query string true Derivation path
encoding query string false Key encoding. The default is DER.

Enumerated Values

Parameter Value
encoding DER
encoding compressed
encoding uncompressed

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Item not found Inline
405 Method Not Allowed Incorrect vault type 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 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 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


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

};

fetch('/casp/api/v1.0/mng/vaults/{vaultId}/backup/{publicKey}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

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.

This endpoint is only functional if you generated a BIP32 vault.

Parameters

Name In Type Required Description
vaultId path string true Vault ID
publicKey path string true public key

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK OK Inline
404 Not Found Vault not found Inline
405 Method Not Allowed Incorrect vault type 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 the vault ID
» backupData string true none The backup data, in encrypted form
» bipLevel integer(int32) true none derivation level
» cpar string true none CPar
» parentFingerprint string 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 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 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