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

# Create Automation

> Create an automation for a virtual account identified by reference



## OpenAPI

````yaml /openapi.yaml post /partners/accounts/{account_ref}/automations
openapi: 3.1.0
info:
  contact:
    email: support@boomfi.xyz
    name: API Support
  description: >-
    The BoomFi Merchants API provides a set of endpoints for merchants to manage
    their accounts, transactions, and more. Hosts differ per brand/environment;
    use the brand-specific base URL from the docs.
  title: ZBX Merchants API
  version: '1.0'
servers:
  - url: https://mapi.zbx.boomfi.xyz/v1
    description: Production
security: []
tags:
  - description: Payment links
    name: Paylinks
  - description: Billing plans
    name: Plans
  - description: Subscriptions
    name: Subscriptions
  - description: Customer records
    name: Customers
  - description: Invoices
    name: Invoices
  - description: Payments
    name: Payments
  - description: Organisation events
    name: Events
  - description: Organisation profile and display settings
    name: Organisation
  - description: Webhook and request-signing secrets
    name: Secrets
  - description: Settlement accounts
    name: Accounts
  - name: Bank Address Book
  - description: Managed virtual accounts, balances, pay-in, and payout
    name: Virtual Accounts
  - description: Partner-managed accounts, virtual accounts, pay-in, and payout
    name: Partners
  - description: Partner virtual account automations and run history
    name: Partner Automations
  - description: Partner maintain-balance automations
    name: Partner Balance Monitoring
  - description: Tradeable currencies, instruments, and swap targets
    name: Instruments
  - description: RFQ quotes
    name: Quotes
  - description: RFQ orders and one-click trades
    name: Orders
  - description: Executed trades
    name: Trades
paths:
  /partners/accounts/{account_ref}/automations:
    post:
      tags:
        - Partner Automations
      summary: Create Automation
      description: Create an automation for a virtual account identified by reference
      parameters:
        - description: Merchant-defined virtual account reference
          in: path
          name: account_ref
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/accounts.CreateAutomationRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal.Response-accounts_AccountAutomationResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal.ErrorResponse'
      security:
        - ApiKeyAuth: []
          ApiNonce: []
          ApiSignature: []
components:
  requestBodies:
    accounts.CreateAutomationRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/accounts.CreateAutomationRequest'
      description: Automation request
      required: true
  schemas:
    internal.Response-accounts_AccountAutomationResponse:
      properties:
        data:
          allOf:
            - $ref: '#/components/schemas/accounts.AccountAutomationResponse'
          description: Response payload when the request succeeded.
        error:
          description: True when the request failed.
          type: boolean
        message:
          description: Human-readable status or error message.
          type: string
      type: object
    internal.ErrorResponse:
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/internal.ErrorStruct'
          description: Error details including HTTP-style code and message.
      type: object
    accounts.CreateAutomationRequest:
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/accounts.ActionRequest'
          description: Action to run when the schedule or condition triggers.
        schedule:
          allOf:
            - $ref: '#/components/schemas/accounts.ScheduleRequest'
          description: Schedule that controls when the automation evaluates.
      required:
        - action
        - schedule
      type: object
    accounts.AccountAutomationResponse:
      properties:
        account_id:
          description: Unique identifier of the account this automation belongs to.
          type: integer
        action:
          description: Action configuration payload for the automation.
        action_type:
          description: >-
            Automation action type. Rebalance may appear on existing rows but is
            not accepted on create.
          enum:
            - Payout
            - Swap
            - Sweep
            - Rebalance
            - Alert
          example: Sweep
          type: string
        condition:
          allOf:
            - $ref: '#/components/schemas/accounts.ConditionRequest'
          description: Trigger condition when the automation is condition-driven.
        created_at:
          description: When the automation was created (RFC3339).
          type: string
        enabled:
          description: Whether this automation is currently enabled.
          type: boolean
        id:
          description: Unique automation identifier.
          type: integer
        last_run_at:
          description: When the automation last ran (RFC3339), if ever.
          type: string
        rule_id:
          description: Linked rule identifier when the automation is condition-driven.
          type: integer
        schedule:
          allOf:
            - $ref: '#/components/schemas/accounts.ScheduleRequest'
          description: Schedule that controls when the automation evaluates.
        updated_at:
          description: When the automation was last updated (RFC3339).
          type: string
      type: object
    internal.ErrorStruct:
      properties:
        code:
          description: |-
            Error code
            Example: 400
          example: 400
          type: integer
        errors:
          description: List of errors
          items:
            $ref: '#/components/schemas/internal.SingleError'
          type: array
        message:
          description: |-
            Error message
            Example: Insufficient quantity
          example: Insufficient quantity
          type: string
      type: object
    accounts.ActionRequest:
      properties:
        action_type:
          description: Automation action type.
          enum:
            - Payout
            - Swap
            - Sweep
            - Alert
          example: Sweep
          type: string
        condition:
          allOf:
            - $ref: '#/components/schemas/accounts.ConditionRequest'
          description: Trigger condition for the automation.
        data:
          description: >-
            Data is action-specific: PayoutRequest, SwapRequest, SweepRequest,
            or AlertRequest.
          type: object
      required:
        - action_type
        - data
      type: object
    accounts.ScheduleRequest:
      properties:
        frequency:
          description: How often the schedule runs (for example daily or weekly).
          type: string
        offset:
          description: Schedule offset within the frequency period.
          type: integer
        time:
          description: Time-of-day for the schedule, when applicable.
          type: string
      required:
        - frequency
      type: object
    accounts.ConditionRequest:
      properties:
        amount:
          description: Amount as a decimal string in major units.
          type: string
        amount_currency:
          description: Currency code for the amount field.
          type: string
        asset_symbol:
          description: 'Optional: specific asset to check (e.g., "ETH")'
          type: string
        comparison:
          description: >-
            Comparison operator for the automation condition (for example gt,
            gte, lt).
          type: string
        entity:
          description: Entity the automation condition evaluates (for example balance).
          type: string
      required:
        - amount
        - amount_currency
        - comparison
        - entity
      type: object
    internal.SingleError:
      properties:
        domain:
          description: |-
            Domain
            Example: orders
          example: orders
          type: string
        reason:
          description: |-
            Error Reason
            Example: InsufficientQuantity
          example: InsufficientQuantity
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-API-KEY
      type: apiKey
    ApiNonce:
      in: header
      name: X-API-Nonce
      type: apiKey
    ApiSignature:
      in: header
      name: X-API-Signature
      type: apiKey

````