Prepare a delegation policy update
curl --request POST \
--url https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"action": "install",
"delegateAddress": "0x7777777777777777777777777777777777777777",
"leaves": [
{
"kind": 1,
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"maxAmountPerOperation": "1000000000",
"minimumOutputBps": 9950,
"minimumAllocationBps": 0,
"maximumAllocationBps": 8000,
"mayServiceRedemptions": true,
"allowedRecipient": "0x2222222222222222222222222222222222222222",
"allowedPauseFlags": 3
}
],
"validAfter": 1789066800,
"validUntil": 1791658800,
"nonce": "16",
"deadline": 1789088400
}
'import requests
url = "https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations"
payload = {
"action": "install",
"delegateAddress": "0x7777777777777777777777777777777777777777",
"leaves": [
{
"kind": 1,
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"maxAmountPerOperation": "1000000000",
"minimumOutputBps": 9950,
"minimumAllocationBps": 0,
"maximumAllocationBps": 8000,
"mayServiceRedemptions": True,
"allowedRecipient": "0x2222222222222222222222222222222222222222",
"allowedPauseFlags": 3
}
],
"validAfter": 1789066800,
"validUntil": 1791658800,
"nonce": "16",
"deadline": 1789088400
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'install',
delegateAddress: '0x7777777777777777777777777777777777777777',
leaves: [
{
kind: 1,
sourceId: '0x1111111111111111111111111111111111111111111111111111111111111111',
maxAmountPerOperation: '1000000000',
minimumOutputBps: 9950,
minimumAllocationBps: 0,
maximumAllocationBps: 8000,
mayServiceRedemptions: true,
allowedRecipient: '0x2222222222222222222222222222222222222222',
allowedPauseFlags: 3
}
],
validAfter: 1789066800,
validUntil: 1791658800,
nonce: '16',
deadline: 1789088400
})
};
fetch('https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'install',
'delegateAddress' => '0x7777777777777777777777777777777777777777',
'leaves' => [
[
'kind' => 1,
'sourceId' => '0x1111111111111111111111111111111111111111111111111111111111111111',
'maxAmountPerOperation' => '1000000000',
'minimumOutputBps' => 9950,
'minimumAllocationBps' => 0,
'maximumAllocationBps' => 8000,
'mayServiceRedemptions' => true,
'allowedRecipient' => '0x2222222222222222222222222222222222222222',
'allowedPauseFlags' => 3
]
],
'validAfter' => 1789066800,
'validUntil' => 1791658800,
'nonce' => '16',
'deadline' => 1789088400
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations"
payload := strings.NewReader("{\n \"action\": \"install\",\n \"delegateAddress\": \"0x7777777777777777777777777777777777777777\",\n \"leaves\": [\n {\n \"kind\": 1,\n \"sourceId\": \"0x1111111111111111111111111111111111111111111111111111111111111111\",\n \"maxAmountPerOperation\": \"1000000000\",\n \"minimumOutputBps\": 9950,\n \"minimumAllocationBps\": 0,\n \"maximumAllocationBps\": 8000,\n \"mayServiceRedemptions\": true,\n \"allowedRecipient\": \"0x2222222222222222222222222222222222222222\",\n \"allowedPauseFlags\": 3\n }\n ],\n \"validAfter\": 1789066800,\n \"validUntil\": 1791658800,\n \"nonce\": \"16\",\n \"deadline\": 1789088400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"install\",\n \"delegateAddress\": \"0x7777777777777777777777777777777777777777\",\n \"leaves\": [\n {\n \"kind\": 1,\n \"sourceId\": \"0x1111111111111111111111111111111111111111111111111111111111111111\",\n \"maxAmountPerOperation\": \"1000000000\",\n \"minimumOutputBps\": 9950,\n \"minimumAllocationBps\": 0,\n \"maximumAllocationBps\": 8000,\n \"mayServiceRedemptions\": true,\n \"allowedRecipient\": \"0x2222222222222222222222222222222222222222\",\n \"allowedPauseFlags\": 3\n }\n ],\n \"validAfter\": 1789066800,\n \"validUntil\": 1791658800,\n \"nonce\": \"16\",\n \"deadline\": 1789088400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"install\",\n \"delegateAddress\": \"0x7777777777777777777777777777777777777777\",\n \"leaves\": [\n {\n \"kind\": 1,\n \"sourceId\": \"0x1111111111111111111111111111111111111111111111111111111111111111\",\n \"maxAmountPerOperation\": \"1000000000\",\n \"minimumOutputBps\": 9950,\n \"minimumAllocationBps\": 0,\n \"maximumAllocationBps\": 8000,\n \"mayServiceRedemptions\": true,\n \"allowedRecipient\": \"0x2222222222222222222222222222222222222222\",\n \"allowedPauseFlags\": 3\n }\n ],\n \"validAfter\": 1789066800,\n \"validUntil\": 1791658800,\n \"nonce\": \"16\",\n \"deadline\": 1789088400\n}"
response = http.request(request)
puts response.read_body{
"id": "4f36d486-58c9-441b-8535-6097ad3f1832",
"status": "awaiting_signature",
"signingPayload": {
"action": "set_source_mode",
"chainId": 11155111,
"vault": "0x2222222222222222222222222222222222222222",
"parameters": {
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
},
"signingPayloadHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"summary": {
"text": "Set Morpho Steakhouse USDC Prime to active"
},
"predictedEffects": [
{
"kind": "source_mode",
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
],
"simulation": {
"ok": true
},
"turnkeyActivityId": null,
"turnkeyStatus": null
}{
"id": "4f36d486-58c9-441b-8535-6097ad3f1832",
"status": "awaiting_signature",
"signingPayload": {
"action": "set_source_mode",
"chainId": 11155111,
"vault": "0x2222222222222222222222222222222222222222",
"parameters": {
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
},
"signingPayloadHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"summary": {
"text": "Set Morpho Steakhouse USDC Prime to active"
},
"predictedEffects": [
{
"kind": "source_mode",
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
],
"simulation": {
"ok": true
},
"turnkeyActivityId": null,
"turnkeyStatus": null
}{
"error": "microvaults_not_enabled",
"message": "MicroVaults are not enabled for this organization"
}{
"error": "Unauthenticated request",
"message": "Missing or invalid bearer token"
}{
"error": "microvaults_not_enabled",
"message": "MicroVaults are not enabled for this organization"
}Delegation and Export
Update a MicroVault delegation
POST
/
v2
/
microvaults
/
vaults
/
{vaultId}
/
delegations
Prepare a delegation policy update
curl --request POST \
--url https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"action": "install",
"delegateAddress": "0x7777777777777777777777777777777777777777",
"leaves": [
{
"kind": 1,
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"maxAmountPerOperation": "1000000000",
"minimumOutputBps": 9950,
"minimumAllocationBps": 0,
"maximumAllocationBps": 8000,
"mayServiceRedemptions": true,
"allowedRecipient": "0x2222222222222222222222222222222222222222",
"allowedPauseFlags": 3
}
],
"validAfter": 1789066800,
"validUntil": 1791658800,
"nonce": "16",
"deadline": 1789088400
}
'import requests
url = "https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations"
payload = {
"action": "install",
"delegateAddress": "0x7777777777777777777777777777777777777777",
"leaves": [
{
"kind": 1,
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"maxAmountPerOperation": "1000000000",
"minimumOutputBps": 9950,
"minimumAllocationBps": 0,
"maximumAllocationBps": 8000,
"mayServiceRedemptions": True,
"allowedRecipient": "0x2222222222222222222222222222222222222222",
"allowedPauseFlags": 3
}
],
"validAfter": 1789066800,
"validUntil": 1791658800,
"nonce": "16",
"deadline": 1789088400
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'install',
delegateAddress: '0x7777777777777777777777777777777777777777',
leaves: [
{
kind: 1,
sourceId: '0x1111111111111111111111111111111111111111111111111111111111111111',
maxAmountPerOperation: '1000000000',
minimumOutputBps: 9950,
minimumAllocationBps: 0,
maximumAllocationBps: 8000,
mayServiceRedemptions: true,
allowedRecipient: '0x2222222222222222222222222222222222222222',
allowedPauseFlags: 3
}
],
validAfter: 1789066800,
validUntil: 1791658800,
nonce: '16',
deadline: 1789088400
})
};
fetch('https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'install',
'delegateAddress' => '0x7777777777777777777777777777777777777777',
'leaves' => [
[
'kind' => 1,
'sourceId' => '0x1111111111111111111111111111111111111111111111111111111111111111',
'maxAmountPerOperation' => '1000000000',
'minimumOutputBps' => 9950,
'minimumAllocationBps' => 0,
'maximumAllocationBps' => 8000,
'mayServiceRedemptions' => true,
'allowedRecipient' => '0x2222222222222222222222222222222222222222',
'allowedPauseFlags' => 3
]
],
'validAfter' => 1789066800,
'validUntil' => 1791658800,
'nonce' => '16',
'deadline' => 1789088400
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations"
payload := strings.NewReader("{\n \"action\": \"install\",\n \"delegateAddress\": \"0x7777777777777777777777777777777777777777\",\n \"leaves\": [\n {\n \"kind\": 1,\n \"sourceId\": \"0x1111111111111111111111111111111111111111111111111111111111111111\",\n \"maxAmountPerOperation\": \"1000000000\",\n \"minimumOutputBps\": 9950,\n \"minimumAllocationBps\": 0,\n \"maximumAllocationBps\": 8000,\n \"mayServiceRedemptions\": true,\n \"allowedRecipient\": \"0x2222222222222222222222222222222222222222\",\n \"allowedPauseFlags\": 3\n }\n ],\n \"validAfter\": 1789066800,\n \"validUntil\": 1791658800,\n \"nonce\": \"16\",\n \"deadline\": 1789088400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"install\",\n \"delegateAddress\": \"0x7777777777777777777777777777777777777777\",\n \"leaves\": [\n {\n \"kind\": 1,\n \"sourceId\": \"0x1111111111111111111111111111111111111111111111111111111111111111\",\n \"maxAmountPerOperation\": \"1000000000\",\n \"minimumOutputBps\": 9950,\n \"minimumAllocationBps\": 0,\n \"maximumAllocationBps\": 8000,\n \"mayServiceRedemptions\": true,\n \"allowedRecipient\": \"0x2222222222222222222222222222222222222222\",\n \"allowedPauseFlags\": 3\n }\n ],\n \"validAfter\": 1789066800,\n \"validUntil\": 1791658800,\n \"nonce\": \"16\",\n \"deadline\": 1789088400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.groundtech.co/v2/microvaults/vaults/{vaultId}/delegations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"install\",\n \"delegateAddress\": \"0x7777777777777777777777777777777777777777\",\n \"leaves\": [\n {\n \"kind\": 1,\n \"sourceId\": \"0x1111111111111111111111111111111111111111111111111111111111111111\",\n \"maxAmountPerOperation\": \"1000000000\",\n \"minimumOutputBps\": 9950,\n \"minimumAllocationBps\": 0,\n \"maximumAllocationBps\": 8000,\n \"mayServiceRedemptions\": true,\n \"allowedRecipient\": \"0x2222222222222222222222222222222222222222\",\n \"allowedPauseFlags\": 3\n }\n ],\n \"validAfter\": 1789066800,\n \"validUntil\": 1791658800,\n \"nonce\": \"16\",\n \"deadline\": 1789088400\n}"
response = http.request(request)
puts response.read_body{
"id": "4f36d486-58c9-441b-8535-6097ad3f1832",
"status": "awaiting_signature",
"signingPayload": {
"action": "set_source_mode",
"chainId": 11155111,
"vault": "0x2222222222222222222222222222222222222222",
"parameters": {
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
},
"signingPayloadHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"summary": {
"text": "Set Morpho Steakhouse USDC Prime to active"
},
"predictedEffects": [
{
"kind": "source_mode",
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
],
"simulation": {
"ok": true
},
"turnkeyActivityId": null,
"turnkeyStatus": null
}{
"id": "4f36d486-58c9-441b-8535-6097ad3f1832",
"status": "awaiting_signature",
"signingPayload": {
"action": "set_source_mode",
"chainId": 11155111,
"vault": "0x2222222222222222222222222222222222222222",
"parameters": {
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
},
"signingPayloadHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"summary": {
"text": "Set Morpho Steakhouse USDC Prime to active"
},
"predictedEffects": [
{
"kind": "source_mode",
"sourceId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"mode": "active"
}
],
"simulation": {
"ok": true
},
"turnkeyActivityId": null,
"turnkeyStatus": null
}{
"error": "microvaults_not_enabled",
"message": "MicroVaults are not enabled for this organization"
}{
"error": "Unauthenticated request",
"message": "Missing or invalid bearer token"
}{
"error": "microvaults_not_enabled",
"message": "MicroVaults are not enabled for this organization"
}Prepare an authorization to install, replace, or revoke a bounded manager policy.
MicroVaults are in private preview for enabled sandbox organizations on Ethereum Sepolia.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Reuse only when retrying the identical mutation.
Required string length:
1 - 200Path Parameters
Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Example:
"8f4c52d7-62ab-4db9-a964-92f481f6b851"
Body
application/json
- Install delegation
- Replace delegation
- Revoke delegation
- Revoke all delegations
Available options:
install Valid nonzero EVM EOA or contract address. Mixed-case values must use a valid EIP-55 checksum.
Required string length:
42Pattern:
^0x(?!0{40}$)[0-9a-fA-F]{40}$Example:
"0x3bf25a73a1f1033c2d50ac65f3c9d6a44123db81"
Minimum array length:
1Show child attributes
Show child attributes
Required range:
x >= 0Required range:
x >= 0Pattern:
^0x[0-9a-fA-F]{64}$Example:
"0x1111111111111111111111111111111111111111111111111111111111111111"
Unsigned base-10 integer string. Asset and share amounts use token base units.
Pattern:
^(0|[1-9][0-9]*)$Example:
"1000000"
Response
Existing authorization returned for an identical idempotent replay.
Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Example:
"8f4c52d7-62ab-4db9-a964-92f481f6b851"
Pattern:
^0x[0-9a-fA-F]{64}$Example:
"0x1111111111111111111111111111111111111111111111111111111111111111"
Show child attributes
Show child attributes
Example:
{ "to": "0x2222222222222222222222222222222222222222", "data": "0x12345678", "value": "0" }