Automation Rules
Automation Rules let you streamline how funds move from your Fern wallets to your bank account. Instead of manually off-ramping, you can set up rules that automatically convert and transfer funds based on conditions you define.
Typical use cases include:
Scheduled Cash-outs: Set a recurring schedule (daily, weekly, etc.) to automatically convert and transfer funds.
Threshold-based Sweeps: Automatically off-ramp once your wallet balance reaches a set amount.
Get an automation rule by its ID
Configuration for automated transaction execution
GET /automation-rules/{ruleId} HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Configuration for automated transaction execution
{
"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": {
"type": "FLAT",
"value": "text"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}
List all automation rules
ID of the customer whose automation rules to list
da1f853f-b083-40f3-b729-30c99826e4ed
Filter by source payment account ID
acc_src_123abc
Default Response
GET /automation-rules HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"automationRules": [
{
"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": {
"type": "FLAT",
"value": "text"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}
]
}
Create an 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
Configuration for automated transaction execution
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
POST /automation-rules HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 588
{
"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": {
"type": "FLAT",
"value": "text"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
}
}
{
"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": {
"type": "FLAT",
"value": "text"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}
Update an automation rule
Configuration for automated transaction execution
Unique identifier for the automation rule
40442f88-5331-4e35-85ce-7513477857ea
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
Configuration for automated transaction execution
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
PUT /automation-rules/{ruleId} HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 632
{
"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": {
"type": "FLAT",
"value": "text"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
}
}
{
"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": {
"type": "FLAT",
"value": "text"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}
Delete an automation rule
Configuration for automated transaction execution
DELETE /automation-rules/{ruleId} HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Configuration for automated transaction execution
{
"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": {
"type": "FLAT",
"value": "text"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}
Last updated