curl --request PUT \
--url https://api.fernhq.com/automation-rules/{ruleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "40442f88-5331-4e35-85ce-7513477857ea",
"name": "Sweep when over 5000 USDC",
"customerId": "da1f853f-b083-40f3-b729-30c99826e4ed",
"transactionTemplate": {
"source": {
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"sourcePaymentMethod": "ACH",
"sourceCurrency": "USD"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"amount": {
"value": "<string>"
}
},
"trigger": {
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
}
}
'import requests
url = "https://api.fernhq.com/automation-rules/{ruleId}"
payload = {
"id": "40442f88-5331-4e35-85ce-7513477857ea",
"name": "Sweep when over 5000 USDC",
"customerId": "da1f853f-b083-40f3-b729-30c99826e4ed",
"transactionTemplate": {
"source": {
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"sourcePaymentMethod": "ACH",
"sourceCurrency": "USD"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"amount": { "value": "<string>" }
},
"trigger": {
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '40442f88-5331-4e35-85ce-7513477857ea',
name: 'Sweep when over 5000 USDC',
customerId: 'da1f853f-b083-40f3-b729-30c99826e4ed',
transactionTemplate: {
source: {
sourcePaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
sourcePaymentMethod: 'ACH',
sourceCurrency: 'USD'
},
destination: {
destinationPaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
destinationPaymentMethod: 'ETHEREUM',
destinationCurrency: 'USD'
},
amount: {value: '<string>'}
},
trigger: {cronSchedule: '* * * * *', thresholdAmount: '5000'}
})
};
fetch('https://api.fernhq.com/automation-rules/{ruleId}', 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.fernhq.com/automation-rules/{ruleId}",
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([
'id' => '40442f88-5331-4e35-85ce-7513477857ea',
'name' => 'Sweep when over 5000 USDC',
'customerId' => 'da1f853f-b083-40f3-b729-30c99826e4ed',
'transactionTemplate' => [
'source' => [
'sourcePaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
'sourcePaymentMethod' => 'ACH',
'sourceCurrency' => 'USD'
],
'destination' => [
'destinationPaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
'destinationPaymentMethod' => 'ETHEREUM',
'destinationCurrency' => 'USD'
],
'amount' => [
'value' => '<string>'
]
],
'trigger' => [
'cronSchedule' => '* * * * *',
'thresholdAmount' => '5000'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.fernhq.com/automation-rules/{ruleId}"
payload := strings.NewReader("{\n \"id\": \"40442f88-5331-4e35-85ce-7513477857ea\",\n \"name\": \"Sweep when over 5000 USDC\",\n \"customerId\": \"da1f853f-b083-40f3-b729-30c99826e4ed\",\n \"transactionTemplate\": {\n \"source\": {\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceCurrency\": \"USD\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"amount\": {\n \"value\": \"<string>\"\n }\n },\n \"trigger\": {\n \"cronSchedule\": \"* * * * *\",\n \"thresholdAmount\": \"5000\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.fernhq.com/automation-rules/{ruleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"40442f88-5331-4e35-85ce-7513477857ea\",\n \"name\": \"Sweep when over 5000 USDC\",\n \"customerId\": \"da1f853f-b083-40f3-b729-30c99826e4ed\",\n \"transactionTemplate\": {\n \"source\": {\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceCurrency\": \"USD\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"amount\": {\n \"value\": \"<string>\"\n }\n },\n \"trigger\": {\n \"cronSchedule\": \"* * * * *\",\n \"thresholdAmount\": \"5000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/automation-rules/{ruleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"40442f88-5331-4e35-85ce-7513477857ea\",\n \"name\": \"Sweep when over 5000 USDC\",\n \"customerId\": \"da1f853f-b083-40f3-b729-30c99826e4ed\",\n \"transactionTemplate\": {\n \"source\": {\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceCurrency\": \"USD\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"amount\": {\n \"value\": \"<string>\"\n }\n },\n \"trigger\": {\n \"cronSchedule\": \"* * * * *\",\n \"thresholdAmount\": \"5000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "rule_ghi789",
"name": "Sweep when over 5000 USDC",
"customerId": "da1f853f-b083-40f3-b729-30c99826e4ed",
"transactionTemplate": {
"source": {
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"sourcePaymentMethod": "ACH",
"sourceCurrency": {
"label": "USDC",
"chain": "ETHEREUM",
"contractAddress": "0x123456789abcd123456789abcd123456789abcd",
"currencyDecimals": 18
}
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": {
"label": "USDC",
"chain": "ETHEREUM",
"contractAddress": "0x123456789abcd123456789abcd123456789abcd",
"currencyDecimals": 18
}
},
"amount": {
"value": "<string>"
},
"developerFee": {
"developerFeeAmount": "5.45"
}
},
"trigger": {
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}Update automation rule
Update an automation rule
curl --request PUT \
--url https://api.fernhq.com/automation-rules/{ruleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "40442f88-5331-4e35-85ce-7513477857ea",
"name": "Sweep when over 5000 USDC",
"customerId": "da1f853f-b083-40f3-b729-30c99826e4ed",
"transactionTemplate": {
"source": {
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"sourcePaymentMethod": "ACH",
"sourceCurrency": "USD"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"amount": {
"value": "<string>"
}
},
"trigger": {
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
}
}
'import requests
url = "https://api.fernhq.com/automation-rules/{ruleId}"
payload = {
"id": "40442f88-5331-4e35-85ce-7513477857ea",
"name": "Sweep when over 5000 USDC",
"customerId": "da1f853f-b083-40f3-b729-30c99826e4ed",
"transactionTemplate": {
"source": {
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"sourcePaymentMethod": "ACH",
"sourceCurrency": "USD"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"amount": { "value": "<string>" }
},
"trigger": {
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '40442f88-5331-4e35-85ce-7513477857ea',
name: 'Sweep when over 5000 USDC',
customerId: 'da1f853f-b083-40f3-b729-30c99826e4ed',
transactionTemplate: {
source: {
sourcePaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
sourcePaymentMethod: 'ACH',
sourceCurrency: 'USD'
},
destination: {
destinationPaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
destinationPaymentMethod: 'ETHEREUM',
destinationCurrency: 'USD'
},
amount: {value: '<string>'}
},
trigger: {cronSchedule: '* * * * *', thresholdAmount: '5000'}
})
};
fetch('https://api.fernhq.com/automation-rules/{ruleId}', 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.fernhq.com/automation-rules/{ruleId}",
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([
'id' => '40442f88-5331-4e35-85ce-7513477857ea',
'name' => 'Sweep when over 5000 USDC',
'customerId' => 'da1f853f-b083-40f3-b729-30c99826e4ed',
'transactionTemplate' => [
'source' => [
'sourcePaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
'sourcePaymentMethod' => 'ACH',
'sourceCurrency' => 'USD'
],
'destination' => [
'destinationPaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
'destinationPaymentMethod' => 'ETHEREUM',
'destinationCurrency' => 'USD'
],
'amount' => [
'value' => '<string>'
]
],
'trigger' => [
'cronSchedule' => '* * * * *',
'thresholdAmount' => '5000'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.fernhq.com/automation-rules/{ruleId}"
payload := strings.NewReader("{\n \"id\": \"40442f88-5331-4e35-85ce-7513477857ea\",\n \"name\": \"Sweep when over 5000 USDC\",\n \"customerId\": \"da1f853f-b083-40f3-b729-30c99826e4ed\",\n \"transactionTemplate\": {\n \"source\": {\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceCurrency\": \"USD\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"amount\": {\n \"value\": \"<string>\"\n }\n },\n \"trigger\": {\n \"cronSchedule\": \"* * * * *\",\n \"thresholdAmount\": \"5000\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.fernhq.com/automation-rules/{ruleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"40442f88-5331-4e35-85ce-7513477857ea\",\n \"name\": \"Sweep when over 5000 USDC\",\n \"customerId\": \"da1f853f-b083-40f3-b729-30c99826e4ed\",\n \"transactionTemplate\": {\n \"source\": {\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceCurrency\": \"USD\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"amount\": {\n \"value\": \"<string>\"\n }\n },\n \"trigger\": {\n \"cronSchedule\": \"* * * * *\",\n \"thresholdAmount\": \"5000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/automation-rules/{ruleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"40442f88-5331-4e35-85ce-7513477857ea\",\n \"name\": \"Sweep when over 5000 USDC\",\n \"customerId\": \"da1f853f-b083-40f3-b729-30c99826e4ed\",\n \"transactionTemplate\": {\n \"source\": {\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceCurrency\": \"USD\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"amount\": {\n \"value\": \"<string>\"\n }\n },\n \"trigger\": {\n \"cronSchedule\": \"* * * * *\",\n \"thresholdAmount\": \"5000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "rule_ghi789",
"name": "Sweep when over 5000 USDC",
"customerId": "da1f853f-b083-40f3-b729-30c99826e4ed",
"transactionTemplate": {
"source": {
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"sourcePaymentMethod": "ACH",
"sourceCurrency": {
"label": "USDC",
"chain": "ETHEREUM",
"contractAddress": "0x123456789abcd123456789abcd123456789abcd",
"currencyDecimals": 18
}
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": {
"label": "USDC",
"chain": "ETHEREUM",
"contractAddress": "0x123456789abcd123456789abcd123456789abcd",
"currencyDecimals": 18
}
},
"amount": {
"value": "<string>"
},
"developerFee": {
"developerFeeAmount": "5.45"
}
},
"trigger": {
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}Authorizations
To authenticate server-side requests
Path Parameters
Body
Configuration for automated transaction execution
Configuration for automated transaction execution
Unique identifier for the automation rule
"40442f88-5331-4e35-85ce-7513477857ea"
Human-readable name for the automation rule
1"Sweep when over 5000 USDC"
ID of the customer who owns this automation rule
"da1f853f-b083-40f3-b729-30c99826e4ed"
Template configuration for transactions created by automation rule
Show child attributes
Show child attributes
Trigger configuration for automation rules
Show child attributes
Show child attributes
Response
Response schema for retrieving an automation rule
Configuration for automated transaction execution
Unique identifier for the automation rule
"rule_ghi789"
Human-readable name for the automation rule
"Sweep when over 5000 USDC"
ID of the customer who owns this automation rule
"da1f853f-b083-40f3-b729-30c99826e4ed"
Template configuration for transactions created by automation rule
Show child attributes
Show child attributes
Trigger configuration for automation rules
Show child attributes
Show child attributes
ISO timestamp when this automation rule was created
"2025-09-12T12:00:00Z"
Was this page helpful?