Skip to main content
PATCH
/
policies
/
{id}
/
rules
/
{rule_id}
Update an existing rule
curl --request PATCH \
  --url https://api.platform.dakota.xyz/policies/{id}/rules/{rule_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "signatures": [
    "LS0tLS1CRUdJ...0tLS0tCg=="
  ],
  "intent": {
    "wallet_id": "<string>",
    "caip2": "<string>",
    "sponsor": true,
    "operation": {
      "kind": "<string>",
      "from": "<string>",
      "to": "<string>",
      "asset": {
        "id": "USDC",
        "name": "USD Coin",
        "network_id": "ethereum-mainnet",
        "contract_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "token_standard": "erc20",
        "decimals": 6
      },
      "amount": "<string>",
      "method": "<string>",
      "args": [
        "<string>"
      ],
      "data": "<string>"
    },
    "idempotency_key": "<string>"
  }
}
'
{
  "id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
  "version": 1,
  "name": "High Value Transaction Policy",
  "created_at": 1640995200,
  "updated_at": 1640995200,
  "client_id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi",
  "description": "Requires approval for transactions above $10,000",
  "rules": [
    {
      "id": "rule_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
      "policy_id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
      "rule_type": "amount_threshold",
      "action": "deny",
      "definition": {
        "amount": "10000",
        "currency": "USD"
      },
      "created_at": 1640995200
    }
  ]
}

Authorizations

x-api-key
string
header
required

Path Parameters

id
string
required

Unique identifier of the policy

rule_id
string
required

Unique identifier of the rule

Body

application/json
signatures
string[]
required

List of signatures over the intent

Cryptographic signature of the endorsement base64 encoded

intent
object
required

The intent being endorsed

Response

Policy rule updated successfully

id
string
required

Unique identifier for the policy

Example:

"pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT"

version
integer<int32>
required

Version number of the policy (incremented on rule changes)

Example:

1

name
string
required

Human-readable name for the policy

Example:

"High Value Transaction Policy"

created_at
integer
required

Unix timestamp when the policy was created

Example:

1640995200

updated_at
integer
required

Unix timestamp when the policy was last updated

Example:

1640995200

client_id
string

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.

Required string length: 27
Example:

"1NFHrqBHb3cTfLVkFSGmHZqdDPi"

description
string | null

Optional description of the policy's purpose

Example:

"Requires approval for transactions above $10,000"

rules
object[]

Rules that make up this policy