Skip to main content
PUT
/
automation-rules
/
{ruleId}
Update 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": {
      "type": "FLAT",
      "value": "<string>"
    },
    "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": "<string>"
},
"developerFee": {
"developerFeeType": "USD",
"developerFeeAmount": "5.45"
}
},
"trigger": {
"type": "THRESHOLD_BASED",
"cronSchedule": "* * * * *",
"thresholdAmount": "5000"
},
"createdAt": "2025-09-12T12:00:00Z"
}

Authorizations

Authorization
string
header
required

To authenticate server-side requests

Path Parameters

ruleId
string
required

Body

application/json

Configuration for automated transaction execution

id
string<uuid>
required

Unique identifier for the automation rule

Example:

"40442f88-5331-4e35-85ce-7513477857ea"

name
string
required

Human-readable name for the automation rule

Minimum length: 1
Example:

"Sweep when over 5000 USDC"

customerId
string<uuid>
required

ID of the customer who owns this automation rule

Example:

"da1f853f-b083-40f3-b729-30c99826e4ed"

transactionTemplate
object
required

Template configuration for transactions created by automation rule

trigger
object
required

Trigger configuration for automation rules

Response

Response schema for retrieving an automation rule

Configuration for automated transaction execution

id
string
required

Unique identifier for the automation rule

Example:

"rule_ghi789"

name
string
required

Human-readable name for the automation rule

Example:

"Sweep when over 5000 USDC"

customerId
string<uuid>
required

ID of the customer who owns this automation rule

Example:

"da1f853f-b083-40f3-b729-30c99826e4ed"

transactionTemplate
object
required

Template configuration for transactions created by automation rule

trigger
object
required

Trigger configuration for automation rules

createdAt
string

ISO timestamp when this automation rule was created

Example:

"2025-09-12T12:00:00Z"