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

# Create Agent

> Attach an automated trigger-action rule to a specific wallet.

## Request Headers

<ParamField header="x-api-key" type="string" required>
  Your live or test API key.
</ParamField>

## Path Parameters

<ParamField path="wallet_id" type="string" required>
  The Avenue wallet ID.
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  A descriptive name for the agent (e.g. `Auto-Sweep`).
</ParamField>

<ParamField body="trigger" type="string" required>
  The condition: `BALANCE_ABOVE`, `BALANCE_BELOW`, `ON_CREDIT`, or `ON_CREDIT_AMOUNT_ABOVE`.
</ParamField>

<ParamField body="threshold" type="integer">
  The amount in kobo that fires the trigger (if applicable).
</ParamField>

<ParamField body="action" type="string" required>
  What the agent does: `SWEEP`, `PARTIAL_SWEEP`, `WEBHOOK_NOTIFY`, `LOCK_WALLET`.
</ParamField>

<ParamField body="destination_wallet_id" type="string">
  The wallet to receive funds (required for SWEEP actions).
</ParamField>

<ParamField body="sweep_amount" type="integer">
  The amount in kobo to sweep (required for PARTIAL\_SWEEP actions).
</ParamField>

## Response

<Note>
  All amounts and balances in this endpoint are represented in **kobo** (e.g., `500000` = ₦5,000.00). Ensure you do not send or expect Naira values.
</Note>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "id": "a9b3e8e2-b1c4-48e0-a75d-35e982d6b2c2",
      "wallet_id": "e4b3e8e2-b1c4-48e0-a75d-35e982d6b2c2",
      "developer_id": "d7b3e8e2-b1c4-48e0-a75d-35e982d6b2c2",
      "name": "Auto-Sweep on Full Payment",
      "trigger": "BALANCE_ABOVE",
      "threshold": 10000000,
      "action": "SWEEP",
      "destination_wallet_id": "f5c3e8e2-b1c4-48e0-a75d-35e982d6b2c2",
      "sweep_amount": null,
      "is_active": true,
      "trigger_count": 0,
      "last_triggered_at": null,
      "created_at": "2026-07-01T13:00:00Z"
    }
  }
  ```
</ResponseExample>
