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 automation rule by ID

get

Get an automation rule by its ID

Authorizations
Path parameters
ruleIdstringRequired
Responses
200

Configuration for automated transaction execution

application/json
get
GET /automation-rules/{ruleId} HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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 automation rules

get

List all automation rules

Authorizations
Query parameters
customerIdstring · uuidOptional

ID of the customer whose automation rules to list

Example: da1f853f-b083-40f3-b729-30c99826e4ed
sourcePaymentAccountIdstringOptional

Filter by source payment account ID

Example: acc_src_123abc
Responses
200

Default Response

application/json
get
GET /automation-rules HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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 automation rule

post

Create an automation rule

Authorizations
Body

Request schema for creating a new automation rule

namestringRequired

Human-readable name for the automation rule

Example: Sweep when over 5000 USDC
customerIdstring · uuidRequired

ID of the customer who owns this automation rule

Example: da1f853f-b083-40f3-b729-30c99826e4ed
Responses
201

Configuration for automated transaction execution

application/json
post
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 automation rule

put

Update an automation rule

Authorizations
Path parameters
ruleIdstringRequired
Body

Configuration for automated transaction execution

idstringRequired

Unique identifier for the automation rule

Example: 40442f88-5331-4e35-85ce-7513477857ea
namestringRequired

Human-readable name for the automation rule

Example: Sweep when over 5000 USDC
customerIdstring · uuidRequired

ID of the customer who owns this automation rule

Example: da1f853f-b083-40f3-b729-30c99826e4ed
Responses
200

Configuration for automated transaction execution

application/json
put
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 automation rule

delete

Delete an automation rule

Authorizations
Path parameters
ruleIdstringRequired
Responses
200

Configuration for automated transaction execution

application/json
delete
DELETE /automation-rules/{ruleId} HTTP/1.1
Host: api.fernhq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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