curl --request POST \
--url https://api.fernhq.com/automation-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
payload = {
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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"
payload := strings.NewReader("{\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("POST", 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.post("https://api.fernhq.com/automation-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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"
}Create automation rule
Create an automation rule
curl --request POST \
--url https://api.fernhq.com/automation-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
payload = {
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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"
payload := strings.NewReader("{\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("POST", 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.post("https://api.fernhq.com/automation-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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
Body
Request schema for creating a new automation rule
Request schema for creating a new automation rule
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
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?