Update Policy
curl --request PUT \
--url https://api.agentwallex.com/api/v1/policies/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"rules": {
"max_transaction_amount": "1000",
"daily_limit": "10000"
}
}
'import requests
url = "https://api.agentwallex.com/api/v1/policies/{id}"
payload = { "rules": {
"max_transaction_amount": "1000",
"daily_limit": "10000"
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({rules: {max_transaction_amount: '1000', daily_limit: '10000'}})
};
fetch('https://api.agentwallex.com/api/v1/policies/{id}', 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://api.agentwallex.com/api/v1/policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
'max_transaction_amount' => '1000',
'daily_limit' => '10000'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-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://api.agentwallex.com/api/v1/policies/{id}"
payload := strings.NewReader("{\n \"rules\": {\n \"max_transaction_amount\": \"1000\",\n \"daily_limit\": \"10000\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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))
}HttpResponse<String> response = Unirest.put("https://api.agentwallex.com/api/v1/policies/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": {\n \"max_transaction_amount\": \"1000\",\n \"daily_limit\": \"10000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentwallex.com/api/v1/policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": {\n \"max_transaction_amount\": \"1000\",\n \"daily_limit\": \"10000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_id": "<string>",
"rules": {
"max_transaction_amount": "<string>",
"daily_limit": "<string>",
"monthly_limit": "<string>",
"allowed_addresses": [
"<string>"
],
"blocked_addresses": [
"<string>"
],
"allowed_tokens": [
"<string>"
],
"max_count": 123,
"window_seconds": 123,
"timezone": "<string>",
"allowed_hours": {
"start": 11,
"end": 11
},
"allowed_days": [
4
],
"threshold": "<string>",
"timeout_seconds": 123,
"approvers": [
"jsmith@example.com"
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "invalid_request",
"type": "invalid_request_error",
"message": "The request body is missing required fields."
}{
"code": "authentication_failed",
"type": "authentication_error",
"message": "The provided API key is invalid or expired."
}{
"code": "insufficient_permissions",
"type": "authorization_error",
"message": "You do not have permission to perform this action."
}{
"code": "resource_not_found",
"type": "not_found_error",
"message": "The requested resource was not found."
}{
"code": "rate_limit_exceeded",
"type": "rate_limit_error",
"message": "Too many requests. Please retry after a short delay."
}{
"code": "server_error",
"type": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}Policies
Update Policy
Update an existing policy’s rules.
PUT
/
api
/
v1
/
policies
/
{id}
Update Policy
curl --request PUT \
--url https://api.agentwallex.com/api/v1/policies/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"rules": {
"max_transaction_amount": "1000",
"daily_limit": "10000"
}
}
'import requests
url = "https://api.agentwallex.com/api/v1/policies/{id}"
payload = { "rules": {
"max_transaction_amount": "1000",
"daily_limit": "10000"
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({rules: {max_transaction_amount: '1000', daily_limit: '10000'}})
};
fetch('https://api.agentwallex.com/api/v1/policies/{id}', 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://api.agentwallex.com/api/v1/policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
'max_transaction_amount' => '1000',
'daily_limit' => '10000'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-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://api.agentwallex.com/api/v1/policies/{id}"
payload := strings.NewReader("{\n \"rules\": {\n \"max_transaction_amount\": \"1000\",\n \"daily_limit\": \"10000\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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))
}HttpResponse<String> response = Unirest.put("https://api.agentwallex.com/api/v1/policies/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": {\n \"max_transaction_amount\": \"1000\",\n \"daily_limit\": \"10000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentwallex.com/api/v1/policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": {\n \"max_transaction_amount\": \"1000\",\n \"daily_limit\": \"10000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_id": "<string>",
"rules": {
"max_transaction_amount": "<string>",
"daily_limit": "<string>",
"monthly_limit": "<string>",
"allowed_addresses": [
"<string>"
],
"blocked_addresses": [
"<string>"
],
"allowed_tokens": [
"<string>"
],
"max_count": 123,
"window_seconds": 123,
"timezone": "<string>",
"allowed_hours": {
"start": 11,
"end": 11
},
"allowed_days": [
4
],
"threshold": "<string>",
"timeout_seconds": 123,
"approvers": [
"jsmith@example.com"
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "invalid_request",
"type": "invalid_request_error",
"message": "The request body is missing required fields."
}{
"code": "authentication_failed",
"type": "authentication_error",
"message": "The provided API key is invalid or expired."
}{
"code": "insufficient_permissions",
"type": "authorization_error",
"message": "You do not have permission to perform this action."
}{
"code": "resource_not_found",
"type": "not_found_error",
"message": "The requested resource was not found."
}{
"code": "rate_limit_exceeded",
"type": "rate_limit_error",
"message": "Too many requests. Please retry after a short delay."
}{
"code": "server_error",
"type": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}Path Parameters
string
required
The policy ID to update (e.g.,
pol_abc123).Request Body
object
required
Updated policy rules object. Structure depends on the policy’s
type.Example
curl -X PUT https://api.agentwallex.com/api/v1/policies/pol_abc123 \
-H "X-API-Key: awx_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"rules": {
"max_transaction_amount": "1000",
"daily_limit": "10000"
}
}'
Authorizations
ApiKeyAuthBearerAuth
API key authentication. Keys are prefixed with awx_.
Path Parameters
The policy ID to update (e.g., pol_abc123).
Body
application/json
Policy rules object. Structure depends on the policy type.
Show child attributes
Show child attributes
Response
Policy updated successfully.
A policy that controls what transactions an agent is allowed to execute.
Unique policy identifier (e.g., pol_abc123).
Agent this policy is attached to.
Policy type.
Available options:
spending_limit, address_control, token_control, velocity_control, schedule, human_approval Policy rules object. Structure depends on the policy type.
Show child attributes
Show child attributes
ISO 8601 creation timestamp.
ISO 8601 last-update timestamp.
⌘I