curl --request DELETE \
--url https://api.platform.dakota.xyz/policies/{policy_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"signatures": [
"LS0tLS1CRUdJ...0tLS0tCg=="
],
"intent": {
"type": "delete_policy",
"policy_id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"idempotency_key": "0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
}
}
'const options = {
method: 'DELETE',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
signatures: ['LS0tLS1CRUdJ...0tLS0tCg=='],
intent: {
type: 'delete_policy',
policy_id: 'pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT',
idempotency_key: '0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b'
}
})
};
fetch('https://api.platform.dakota.xyz/policies/{policy_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/policies/{policy_id}"
payload = {
"signatures": ["LS0tLS1CRUdJ...0tLS0tCg=="],
"intent": {
"type": "delete_policy",
"policy_id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"idempotency_key": "0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
}
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(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/{policy_id}"
payload := strings.NewReader("{\n \"signatures\": [\n \"LS0tLS1CRUdJ...0tLS0tCg==\"\n ],\n \"intent\": {\n \"type\": \"delete_policy\",\n \"policy_id\": \"pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT\",\n \"idempotency_key\": \"0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b\"\n }\n}")
req, _ := http.NewRequest("DELETE", 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))
}{
"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/example-id",
"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/example-id",
"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/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Policy not found",
"status": 404,
"detail": "Policy not found",
"instance": "https://api.platform.dakota.xyz/policies/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#conflict",
"title": "Conflict",
"status": 409,
"detail": "Conflict",
"instance": "https://api.platform.dakota.xyz/policies/example-id",
"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/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#service-unavailable",
"title": "Service unavailable",
"status": 503,
"detail": "Service unavailable",
"instance": "https://api.platform.dakota.xyz/policies/example-id",
"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/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}Delete a policy
Deletes a policy by policy_id. The request body must be a delete_policy intent for this policy, signed by a member of the signer group that governs the policy. One valid signature is enough, and every signature sent must come from a different member. A request without a valid endorsement is rejected with 400 and the policy is not deleted. Deleting a policy also detaches it from every wallet it is attached to.
A policy governed by a platform-managed signer group can be deleted, and have rules added, updated or removed, only while a wallet still holds it. Once no wallet holds such a policy, these requests are refused with 409.
A refused request is remembered under its idempotency_key for 24 hours, and a retry with the same key returns the same error. To retry after a 409 or 503, use a new idempotency_key, which means signing the intent again.
curl --request DELETE \
--url https://api.platform.dakota.xyz/policies/{policy_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"signatures": [
"LS0tLS1CRUdJ...0tLS0tCg=="
],
"intent": {
"type": "delete_policy",
"policy_id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"idempotency_key": "0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
}
}
'const options = {
method: 'DELETE',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
signatures: ['LS0tLS1CRUdJ...0tLS0tCg=='],
intent: {
type: 'delete_policy',
policy_id: 'pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT',
idempotency_key: '0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b'
}
})
};
fetch('https://api.platform.dakota.xyz/policies/{policy_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/policies/{policy_id}"
payload = {
"signatures": ["LS0tLS1CRUdJ...0tLS0tCg=="],
"intent": {
"type": "delete_policy",
"policy_id": "pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT",
"idempotency_key": "0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
}
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(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/{policy_id}"
payload := strings.NewReader("{\n \"signatures\": [\n \"LS0tLS1CRUdJ...0tLS0tCg==\"\n ],\n \"intent\": {\n \"type\": \"delete_policy\",\n \"policy_id\": \"pol_2N4YkKpKu7M3mKpGYmF8kcJ8oZT\",\n \"idempotency_key\": \"0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b\"\n }\n}")
req, _ := http.NewRequest("DELETE", 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))
}{
"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/example-id",
"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/example-id",
"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/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Policy not found",
"status": 404,
"detail": "Policy not found",
"instance": "https://api.platform.dakota.xyz/policies/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#conflict",
"title": "Conflict",
"status": 409,
"detail": "Conflict",
"instance": "https://api.platform.dakota.xyz/policies/example-id",
"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/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#service-unavailable",
"title": "Service unavailable",
"status": 503,
"detail": "Service unavailable",
"instance": "https://api.platform.dakota.xyz/policies/example-id",
"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/example-id",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}Authorizations
Headers
Unique key (UUID) to ensure request idempotency on POST, PUT and PATCH requests.
A key is scoped to your client, the HTTP method and the path, and is remembered for 24 hours after a
successful (below 400) response. Repeating the same request (same JSON body, whatever the key order or
whitespace) with the same key within that window returns the original response with
X-Idempotent-Replayed: true instead of executing the request again. Using the same key on the same
endpoint with a different body returns 422 with problem type idempotency-key-reused; the request is
not executed. Error responses (4xx and 5xx) are not remembered, so a request refused for a fixable reason
can be corrected and retried under the same key. Request bodies that are not JSON (for example file
uploads) are not compared.
Path Parameters
Unique identifier of the policy
Body
List of signatures over the intent
Cryptographic signature over the intent, base64-encoded. For an ES256 signer this is the ASN.1 DER ECDSA signature over the SHA-256 of the canonical intent. For a WEBAUTHN signer this is the base64 of the WebAuthn assertion JSON (id, rawId, type, and response.authenticatorData / clientDataJSON / signature). See the WebAuthn & Passkey Signing guide.
The intent being endorsed
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
Show child attributes
Show child attributes
Response
Policy deleted successfully
Was this page helpful?

