> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fernhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get automation rule by ID

> Get an automation rule by its ID



## OpenAPI

````yaml https://api.fernhq.com/json get /automation-rules/{ruleId}
openapi: 3.1.1
info:
  title: Fern Developer API
  description: >-
    Fern is a seamless currency conversion and payments API that enables
    developers to integrate onramps, offramps, and third-party fiat/crypto
    payments into their applications. 


    Fern works with licensed liquidity providers and financial institutions to
    offer global currency support in one standardized API. 
  termsOfService: https://fernhq.com/terms
  version: 1.0.0
  contact:
    name: Fern API Support
    url: https://support.fernhq.com
    email: support@fernhq.com
servers:
  - url: https://api.fernhq.com
    description: API Server
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: >-
      Use Customers API to create a customer, update their details, and get
      their details.
  - name: Payment Accounts
    description: >-
      Use Payment Accounts API to add, update and get bank accounts for an
      existing customer. Currently, only USD bank accounts with domestic
      ACH/wire routing numbers are supported.
  - name: Quotes
    description: >-
      Use Quotes API to create and fetch quotes for transactions. Currently,
      onramp and offramp transaction types are supported and will be inferred
      from the source and destination. 


      Before you can create a transaction, you must create a quote. Quotes
      enable you to specify important information about the transaction, such as
      the source and destination currencies and accounts and your developer
      fees. Quotes also provide useful information that you can use to display
      in your application, such as exchange rates and total fees. 


      - **Quotes expire after 5 minutes** 

      - You must create a quote before you create a transaction, and you will
      use the quote ID when creating a transaction. 

      - Quotes can only be created for verified customers. /n- Once you create a
      transaction with a quote, that quote can no longer be used. To generate a
      new transaction, you will have to create a new quote.
  - name: Transactions
    description: >-
      Use Transactions API to create and get transactions for a customer and a
      quote. Requires the creation of a quote beforehand per transaction.
  - name: Automation Rules
    description: >-
      Use Automation Rules API to create and manage automation rules for a
      customer.
  - name: Webhooks
    description: >-
      Use Webhooks API to manage webhook endpoints and view recent webhook
      deliveries.
paths:
  /automation-rules/{ruleId}:
    get:
      tags:
        - Automation Rules
      summary: Get automation rule by ID
      description: Get an automation rule by its ID
      operationId: getAutomationRuleById
      parameters:
        - schema:
            type: string
          in: path
          name: ruleId
          required: true
      responses:
        '200':
          description: Response schema for retrieving an automation rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationRuleSchema'
components:
  schemas:
    AutomationRuleSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the automation rule
          example: rule_ghi789
        name:
          type: string
          description: Human-readable name for the automation rule
          example: Sweep when over 5000 USDC
        customerId:
          format: uuid
          type: string
          description: ID of the customer who owns this automation rule
          example: da1f853f-b083-40f3-b729-30c99826e4ed
        transactionTemplate:
          $ref: '#/components/schemas/TransactionTemplateResponseSchema'
        trigger:
          $ref: '#/components/schemas/TriggerSchema'
        createdAt:
          type: string
          description: ISO timestamp when this automation rule was created
          example: '2025-09-12T12:00:00Z'
      required:
        - id
        - name
        - customerId
        - transactionTemplate
        - trigger
      additionalProperties: false
      title: Automation Rule Schema
      description: Configuration for automated transaction execution
    TransactionTemplateResponseSchema:
      type: object
      properties:
        source:
          $ref: '#/components/schemas/AutomationRuleTransactionSourceResponseSchema'
        destination:
          $ref: >-
            #/components/schemas/AutomationRuleTransactionDestinationResponseSchema
        amount:
          $ref: '#/components/schemas/AmountConfigSchema'
        developerFee:
          $ref: '#/components/schemas/DeveloperFeeSchema'
      required:
        - source
        - destination
        - amount
      additionalProperties: false
      title: Transaction Template Response Schema
      description: Template configuration for transactions created by automation rule
    TriggerSchema:
      type: object
      properties:
        type:
          enum:
            - THRESHOLD_BASED
            - TIME_BASED
          type: string
        cronSchedule:
          type: string
          description: Cron expression or time schedule that triggers the automation rule
          example: '* * * * *'
        thresholdAmount:
          type: string
          description: Threshold value that triggers the automation rule
          example: '5000'
      required:
        - type
      additionalProperties: false
      title: Trigger Schema
      description: Trigger configuration for automation rules
    AutomationRuleTransactionSourceResponseSchema:
      title: Automation Rule Transaction Source Response Schema
      description: Source details for a transaction in an automation rule
      type: object
      properties:
        sourcePaymentAccountId:
          format: uuid
          type: string
          title: Source Payment Account ID Schema
          description: The sending Payment Account Id.
          example: 072a8b7b-38c7-429a-a6cf-35dae7f2fb77
        sourcePaymentMethod:
          title: Source Payment Method Schema
          description: The payment method for the source transaction
          anyOf:
            - enum:
                - ACH
                - WIRE
                - SEPA
                - AE_UAEFTS
                - AR_TRANSFERS_3
                - AU_BECS
                - BD_BEFTN
                - BO_RTGS
                - BR_TED_DOC_PIX
                - CA_INTERAC
                - CL_TEF
                - CN_CNAPS
                - CO_ACH
                - CR_SINPE
                - CZ_CERTIS
                - DK_NEMKONTO_FI
                - DO_ACH
                - EC_LOCAL
                - EG_RTGS_IPN
                - GB_BACS_CHAPS_FPS
                - GH_GHIPSS
                - GT_ACH
                - HK_HKICL_CHATS_ECG
                - HU_GIRO
                - ID_SKN_RTGS
                - IL_ZAHAV
                - IN_NEFT_RTGS_IMPS
                - JM_LOCAL
                - JO_ACH
                - JP_ZENGIN
                - KE_KIBBS_PESALINK
                - KR_LOCAL
                - LK_LOCAL
                - MX_SPEI
                - MY_IBG_RENTAS
                - NG_NIBSS_NEFT
                - NO_NICS
                - NP_LOCAL
                - NZ_LOCAL
                - PE_CCE
                - PH_INSTAPAY_PESONET
                - PK_RAAST_IBFT
                - PL_ELIXIR_BLUE_CASH
                - QA_QPS
                - RO_RTGS
                - SA_MADA
                - SE_BANKGIROT
                - SG_FAST_MEPS
                - SV_LOCAL
                - SWIFT
                - TH_BAHTNET_PROMPTPAY
                - TR_FAST_EFT
                - TZ_RTGS
                - VN_IBPS
                - ZA_RTGS_EFT
                - ACH_SAME_DAY
              title: Fiat Payment Method
              description: The payment method for the source funds (fiat)
              type: string
            - enum:
                - ARBITRUM
                - BASE
                - ETHEREUM
                - OPTIMISM
                - POLYGON
                - SOLANA
              title: Crypto Payment Method
              description: The payment method for the source funds (crypto)
              type: string
          example: ACH
        sourceCurrency:
          $ref: '#/components/schemas/CurrencySchema'
      required:
        - sourcePaymentAccountId
        - sourcePaymentMethod
        - sourceCurrency
    AutomationRuleTransactionDestinationResponseSchema:
      title: Automation Rule Transaction Destination Response Schema
      description: Destination details for a transaction in an automation rule
      type: object
      properties:
        destinationPaymentAccountId:
          format: uuid
          type: string
          description: The receiving Payment Account Id.
          example: 072a8b7b-38c7-429a-a6cf-35dae7f2fb77
        destinationPaymentMethod:
          title: Destination Payment Method Schema
          description: The payment method for the destination transaction
          anyOf:
            - enum:
                - ACH
                - WIRE
                - SEPA
                - AE_UAEFTS
                - AR_TRANSFERS_3
                - AU_BECS
                - BD_BEFTN
                - BO_RTGS
                - BR_TED_DOC_PIX
                - CA_INTERAC
                - CL_TEF
                - CN_CNAPS
                - CO_ACH
                - CR_SINPE
                - CZ_CERTIS
                - DK_NEMKONTO_FI
                - DO_ACH
                - EC_LOCAL
                - EG_RTGS_IPN
                - GB_BACS_CHAPS_FPS
                - GH_GHIPSS
                - GT_ACH
                - HK_HKICL_CHATS_ECG
                - HU_GIRO
                - ID_SKN_RTGS
                - IL_ZAHAV
                - IN_NEFT_RTGS_IMPS
                - JM_LOCAL
                - JO_ACH
                - JP_ZENGIN
                - KE_KIBBS_PESALINK
                - KR_LOCAL
                - LK_LOCAL
                - MX_SPEI
                - MY_IBG_RENTAS
                - NG_NIBSS_NEFT
                - NO_NICS
                - NP_LOCAL
                - NZ_LOCAL
                - PE_CCE
                - PH_INSTAPAY_PESONET
                - PK_RAAST_IBFT
                - PL_ELIXIR_BLUE_CASH
                - QA_QPS
                - RO_RTGS
                - SA_MADA
                - SE_BANKGIROT
                - SG_FAST_MEPS
                - SV_LOCAL
                - SWIFT
                - TH_BAHTNET_PROMPTPAY
                - TR_FAST_EFT
                - TZ_RTGS
                - VN_IBPS
                - ZA_RTGS_EFT
                - ACH_SAME_DAY
              title: Fiat Payment Method
              description: The payment method for the source funds (fiat)
              type: string
            - enum:
                - ARBITRUM
                - BASE
                - ETHEREUM
                - OPTIMISM
                - POLYGON
                - SOLANA
              title: Crypto Payment Method
              description: The payment method for the source funds (crypto)
              type: string
          example: ETHEREUM
        destinationCurrency:
          $ref: '#/components/schemas/CurrencySchema'
      required:
        - destinationPaymentAccountId
        - destinationPaymentMethod
        - destinationCurrency
    AmountConfigSchema:
      anyOf:
        - type: object
          properties:
            type:
              type: string
              description: Type of amount configuration
              enum:
                - FLAT
                - PCT
            value:
              type: string
              description: Fixed amount to transfer
          required:
            - type
            - value
          additionalProperties: false
          title: Flat Amount Schema
          description: Fixed amount configuration
        - type: object
          properties:
            type:
              type: string
              description: Type of amount configuration
              enum:
                - FLAT
                - PCT
            value:
              type: string
              description: Percentage of balance to transfer (0-100)
          required:
            - type
            - value
          additionalProperties: false
          title: Percentage Amount Schema
          description: Percentage-based amount configuration
      title: Amount Configuration Schema
      description: Configuration for transaction amount (flat or percentage)
    DeveloperFeeSchema:
      type: object
      properties:
        developerFeeType:
          type: string
          description: The Developer Fee type
          enum:
            - USD
            - SOURCE_CURRENCY
        developerFeeAmount:
          type: string
          description: Amount of this fee that was applied
          example: '5.45'
      required:
        - developerFeeType
        - developerFeeAmount
      additionalProperties: false
      title: Developer Fees Schema
      description: >-
        The fee amount you would like Fern to deduct from the transaction. For
        Builder tier, developer fee must be greater than or equal to the
        fernFee.
    CurrencySchema:
      title: Currency Schema
      description: Schema representing either a fiat or crypto currency
      anyOf:
        - type: object
          properties:
            label:
              type: string
            chain:
              enum:
                - ARBITRUM
                - BASE
                - ETHEREUM
                - OPTIMISM
                - POLYGON
                - SOLANA
              title: Crypto Chain
              description: The chain the crypto currency is on
              type: string
            contractAddress:
              type: string
            currencyDecimals:
              type: number
          required:
            - label
        - type: object
          properties:
            label:
              type: string
          required:
            - label
      example:
        label: USDC
        chain: ETHEREUM
        contractAddress: '0x123456789abcd123456789abcd123456789abcd'
        currencyDecimals: 18
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: To authenticate server-side requests

````