curl --request POST \
--url https://api.platform.dakota.xyz/policies \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"name": "High Value Transaction Policy",
"description": "Requires approval for transactions above $10,000",
"signer_group_id": "grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"rules": [
{
"rule_type": "amount_threshold",
"action": "deny",
"definition": {
"min_amount": 10000000000,
"threshold": 2,
"asset": {
"id": "USDC"
}
}
}
]
}
'const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'High Value Transaction Policy',
description: 'Requires approval for transactions above $10,000',
signer_group_id: 'grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT',
rules: [
{
rule_type: 'amount_threshold',
action: 'deny',
definition: {min_amount: 10000000000, threshold: 2, asset: {id: 'USDC'}}
}
]
})
};
fetch('https://api.platform.dakota.xyz/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/policies"
payload = {
"name": "High Value Transaction Policy",
"description": "Requires approval for transactions above $10,000",
"signer_group_id": "grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"rules": [
{
"rule_type": "amount_threshold",
"action": "deny",
"definition": {
"min_amount": 10000000000,
"threshold": 2,
"asset": { "id": "USDC" }
}
}
]
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.dakota.xyz/policies"
payload := strings.NewReader("{\n \"name\": \"High Value Transaction Policy\",\n \"description\": \"Requires approval for transactions above $10,000\",\n \"signer_group_id\": \"grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT\",\n \"rules\": [\n {\n \"rule_type\": \"amount_threshold\",\n \"action\": \"deny\",\n \"definition\": {\n \"min_amount\": 10000000000,\n \"threshold\": 2,\n \"asset\": {\n \"id\": \"USDC\"\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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))
}{
"id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"client_id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi",
"signer_group_id": "grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"version": 1,
"name": "High Value Transaction Policy",
"description": "Requires approval for transactions above $10,000",
"rules": [
{
"id": "rule_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"policy_id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"rule_type": "amount_threshold",
"action": "deny",
"definition": {
"min_amount": 10000000000,
"threshold": 2,
"asset": {
"id": "USDC"
}
},
"created_at": 1640995200
}
],
"created_at": 1640995200,
"updated_at": 1640995200
}{
"type": "https://docs.dakota.xyz/api-reference/errors#invalid-request",
"title": "Invalid request",
"status": 400,
"detail": "Invalid request",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#authentication-error",
"title": "Unauthorized",
"status": 401,
"detail": "Unauthorized",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Forbidden",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-implemented",
"title": "Not implemented",
"status": 501,
"detail": "Not implemented",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#internal-error",
"title": "Unexpected error",
"status": 500,
"detail": "Unexpected error",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}Create a new policy
Creates a new policy that can be attached to wallets for transaction governance.
curl --request POST \
--url https://api.platform.dakota.xyz/policies \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"name": "High Value Transaction Policy",
"description": "Requires approval for transactions above $10,000",
"signer_group_id": "grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"rules": [
{
"rule_type": "amount_threshold",
"action": "deny",
"definition": {
"min_amount": 10000000000,
"threshold": 2,
"asset": {
"id": "USDC"
}
}
}
]
}
'const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'High Value Transaction Policy',
description: 'Requires approval for transactions above $10,000',
signer_group_id: 'grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT',
rules: [
{
rule_type: 'amount_threshold',
action: 'deny',
definition: {min_amount: 10000000000, threshold: 2, asset: {id: 'USDC'}}
}
]
})
};
fetch('https://api.platform.dakota.xyz/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/policies"
payload = {
"name": "High Value Transaction Policy",
"description": "Requires approval for transactions above $10,000",
"signer_group_id": "grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"rules": [
{
"rule_type": "amount_threshold",
"action": "deny",
"definition": {
"min_amount": 10000000000,
"threshold": 2,
"asset": { "id": "USDC" }
}
}
]
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.dakota.xyz/policies"
payload := strings.NewReader("{\n \"name\": \"High Value Transaction Policy\",\n \"description\": \"Requires approval for transactions above $10,000\",\n \"signer_group_id\": \"grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT\",\n \"rules\": [\n {\n \"rule_type\": \"amount_threshold\",\n \"action\": \"deny\",\n \"definition\": {\n \"min_amount\": 10000000000,\n \"threshold\": 2,\n \"asset\": {\n \"id\": \"USDC\"\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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))
}{
"id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"client_id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi",
"signer_group_id": "grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"version": 1,
"name": "High Value Transaction Policy",
"description": "Requires approval for transactions above $10,000",
"rules": [
{
"id": "rule_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"policy_id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"rule_type": "amount_threshold",
"action": "deny",
"definition": {
"min_amount": 10000000000,
"threshold": 2,
"asset": {
"id": "USDC"
}
},
"created_at": 1640995200
}
],
"created_at": 1640995200,
"updated_at": 1640995200
}{
"type": "https://docs.dakota.xyz/api-reference/errors#invalid-request",
"title": "Invalid request",
"status": 400,
"detail": "Invalid request",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#authentication-error",
"title": "Unauthorized",
"status": 401,
"detail": "Unauthorized",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Forbidden",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-implemented",
"title": "Not implemented",
"status": 501,
"detail": "Not implemented",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#internal-error",
"title": "Unexpected error",
"status": 500,
"detail": "Unexpected error",
"instance": "https://api.platform.dakota.xyz/policies",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}Authorizations
Headers
Unique key to ensure request idempotency. If the same key is used within a certain time window, the original response will be returned instead of executing the request again.
Body
Human-readable name for the policy
"High Value Transaction Policy"
Optional description of the policy's purpose
"Requires approval for transactions above $10,000"
ID of the signer group to associate with this policy
"grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT"
Initial rules for this policy
Show child attributes
Show child attributes
Response
Policy created successfully
Unique identifier for the policy
"pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT"
Version number of the policy (incremented on rule changes)
1
Human-readable name for the policy
"High Value Transaction Policy"
Unix timestamp when the policy was created
1640995200
Unix timestamp when the policy was last updated
1640995200
KSUID is a 27-character globally unique ID that combines a timestamp with a random component. Used for all entity identifiers in the Dakota platform.
27^[0-9A-Za-z]{27}$"1NFHrqBHb3cTfLVkFSGmHZqdDPi"
ID of the signer group that governs mutations of this policy. Members of this group must endorse any add_policy_rule, update_policy_rule, remove_policy_rule, or delete_policy intent.
"grp_2N4YkKpKu7M3mKpGYmF8kcJ8oZT"
Optional description of the policy's purpose
"Requires approval for transactions above $10,000"
Rules that make up this policy
Show child attributes
Show child attributes
Was this page helpful?

