Vault
6 min
vault list get api/external/vaults/ list vaults in your organization that the api user has access to with pagination and optional filters json get /api/external/vaults/?limit={limit}\&cursor={cursor}&{filters} request (query params) { "limit" number, "cursor" string | null, "params" record\<string, string> } response vaultlistresponse { "results" vault\[], "nextcursor" string | null, "hasnext" boolean } help text \ (optional) `limit` page size; defaults to `20` \ (optional) `cursor` opaque pagination cursor pass the `nextcursor` returned by the previous response to fetch the next page; omit or pass "" for the first page \ (optional) `params` additional key value filters accepted by the vaults api (e g , `vaulttype`, `vaultname`) js getvaults(params? record\<string, string>, limit? number, cursor? string | null) promise\<vaultlistresponse> curl curl x get 'https //api primevault com/api/external/vaults/?limit=10\&cursor=\&vaulttype=default' \\ h 'content type application/json' \\ h 'authorization bearer \<your access token>' response { "results" \[ { "id" "vault 123", "orgid" "org 456", "vaultname" "treasury vault", "vaulttype" "default", "wallets" \[ { "id" "wallet eth 1", "blockchain" "ethereum", "address" "0xabc123 ", "publickey" "0x04a1b2 " }, { "id" "wallet poly 1", "blockchain" "polygon", "address" "0xabc123 " } ], "walletsgenerated" true, "createdat" "2025 01 15t10 30 00z", "updatedat" "2025 01 15t10 30 00z", "isdeleted" false } ], "nextcursor" "eyjvzmzzzxqiojiwfq==", "hasnext" true } vault get get api/external/vaults/ / fetch a single vault record by id json request (path param) { "vaultid" string } response vault help text \ (required) `vaultid` the unique id of the vault (`results\[] id` from the list response, or the `id` returned by create) js getvaultbyid(vaultid string) promise\<vault> curl curl x get 'https //api primevault com/api/external/vaults/vault 123/' \\ h 'content type application/json' \\ h 'authorization bearer \<your access token>' response { "id" "vault 123", "orgid" "org 456", "vaultname" "treasury vault", "vaulttype" "default", "wallets" \[ { "id" "wallet eth 1", "blockchain" "ethereum", "address" "0xabc123 ", "publickey" "0x04a1b2 " }, { "id" "wallet sol 1", "blockchain" "solana", "address" "9xqewv " } ], "walletsgenerated" true, "createdat" "2025 01 15t10 30 00z", "updatedat" "2025 01 15t10 30 00z", "isdeleted" false } vault create post api/external/vaults/ create a new vault with an optional chains selection and optional vault groups this internally creates addresses (wallets) on all selected chains vault creation goes through an approval flow the create call returns a vault that is not yet active ( walletsgenerated false ), and the change request must be approved before wallets are generated json createvaultrequest request body { "vaultname" string, "chains" string\[], "vaultgroupids" string\[] | null, "testnetvault" boolean | null } response vault // returned before approval; walletsgenerated = false help text "vaultname" name for the vault; should be unique "chains" (optional) list of chains to generate wallets on (e g \["ethereum", "solana"]) "vaultgroupids" (optional) vault group ids (from the ui) to add this vault to "testnetvault" (optional) set to true to create a testnet vault for testnet supported chains defaults to false note `templateid` is no longer required and should be removed from the payload — it is not needed js createvault(request createvaultrequest) promise\<vault> createvaultapproval(vault vault) promise\<vault> createvaultwithapproval(request createvaultrequest) promise\<vault> curl curl x post 'https //api primevault com/api/external/vaults/' \\ h 'content type application/json' \\ h 'authorization bearer \<your access token>' \\ d '{ "vaultname" "treasury vault", "chains" \["ethereum", "polygon"], "vaultgroupids" \[], "testnetvault" false }' response { "id" "vault 123", "orgid" "org 456", "vaultname" "treasury vault", "vaulttype" "default", "wallets" \[], "walletsgenerated" false, "createdat" "2025 01 15t10 30 00z", "updatedat" "2025 01 15t10 30 00z", "isdeleted" false } approval flow vault creation must be approved before wallets are generated do it as two steps createvault({ vaultname, chains, vaultgroupids }) → returns the vault before approval ( walletsgenerated false ) createvaultapproval(vault) → approves the vault's change request then poll getvaultbyid(vaultid) until walletsgenerated === true to read the generated wallets (addresses) use createvaultwithapproval(request) to run both steps (create + approve) in a single call internally, approval is performed via the change request endpoint approvechangerequest({ entityid vault id, action approvalaction approve }) vault balances get api/external/vaults/ /detailed balances/ retrieve token by token balances (including token metadata) for a specific vault this returns balances across chains json request (path param) { "vaultid" string, "params" record\<string, string> } response detailedbalanceresponse // detailedbalance\[] help text \ (required) `vaultid` the unique id of the vault whose balances you want to read \ (optional) `params` additional key value filters accepted by the balances api js getdetailedbalances(vaultid string, params? record\<string, string>) promise\<detailedbalanceresponse> curl curl x get 'https //api primevault com/api/external/vaults/vault 123/detailed balances/' \\ h 'content type application/json' \\ h 'authorization bearer \<your access token>' response \[ { "symbol" "eth", "balance" "1 5", "name" "ethereum", "chain" "ethereum", "tokenaddress" null, "balanceinusd" "5250 00", "price" "3500 00" }, { "symbol" "usdc", "balance" "1000 0", "name" "usd coin", "chain" "polygon", "tokenaddress" "0x2791bca1 ", "balanceinusd" "1000 00", "price" "1 00" } ]