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

# Create wallet automation

> Create a reusable wallet automation definition.



## OpenAPI

````yaml post /v1/wallet_automations
openapi: 3.1.0
info:
  version: 0.0.1
  title: Privy API
  description: >-
    REST API for Privy's wallet infrastructure — provision and manage wallets
    across EVM, Solana, and Bitcoin, authenticate users, sign transactions, and
    configure programmable policies and authorization intents.
  contact:
    name: Privy
    url: https://www.privy.io/
    email: support@privy.io
servers:
  - url: https://api.privy.io
security: []
tags:
  - name: Accounts
    description: Operations related to asset accounts
  - name: Actions
    description: Operations related to looking up wallet actions across an app
  - name: Aggregations
    description: Operations related to aggregations for tracking and measuring metrics
  - name: Apps
    description: Operations related to app settings and allowlist management
  - name: Cards
    description: Operations related to stablecoin-backed card issuing
  - name: Client Auth
    description: OAuth token exchange and device authorization operations
  - name: Condition Sets
    description: Operations related to condition sets
  - name: Embedded wallets
    description: Operations related to embedded wallet creation and authentication
  - name: Fiat
    description: Operations related to fiat onramping and offramping
  - name: Intents
    description: Operations related to authorization intents for wallet actions
  - name: Key quorums
    description: Operations related to key quorums
  - name: Kraken Embed
    description: >-
      Operations for Kraken Embed integration, including quotes, trades, user
      management, and portfolio operations
  - name: OAuth
    description: >-
      OAuth 2.0 endpoints including Device Authorization Grant (RFC 8628) for
      CLI and limited-input device login flows
  - name: Organizations
    description: Operations related to organizations
  - name: Policies
    description: Operations related to policies
  - name: Shared
    description: Common schemas shared across resources
  - name: Swaps
    description: Operations for swapping tokens within wallets
  - name: Teams
    description: Operations related to dashboard team management
  - name: Transactions
    description: Operations related to transactions
  - name: User signers
    description: Operations related to user signers
  - name: Users
    description: Operations related to users
  - name: Wallet Actions
    description: Operations related to wallet actions
  - name: Wallet Automations
    description: Operations related to wallet automations
  - name: Wallets
    description: Operations related to wallets
  - name: Webhooks
    description: >-
      Webhook events that Privy sends to your configured endpoint when specific
      actions occur in your app
  - name: Yield
    description: >-
      Operations for depositing and withdrawing funds from ERC-4626 yield vaults
      (Morpho, Aave)
paths:
  /v1/wallet_automations:
    post:
      tags:
        - Wallet Automations
      summary: Create wallet automation
      description: Create a new wallet automation that triggers actions on deposit events.
      operationId: createWalletAutomation
      parameters:
        - schema:
            type: string
            description: ID of your Privy app.
          required: true
          name: privy-app-id
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAutomationRequestBody'
      responses:
        '200':
          description: The created wallet automation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletAutomationResponse'
      security:
        - appSecretAuth: []
components:
  schemas:
    CreateAutomationRequestBody:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/AutomationConfigInput'
        name:
          type: string
          minLength: 1
          maxLength: 100
        owner_id:
          type:
            - string
            - 'null'
          minLength: 1
      required:
        - config
        - owner_id
      description: Request body for creating a wallet automation.
      title: CreateAutomationRequestBody
      x-stainless-model: wallet_automations.create_automation_request_body
    WalletAutomationResponse:
      type: object
      properties:
        id:
          type: string
        app_id:
          type: string
        name:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/WalletAutomationStatus'
        owner_id:
          type:
            - string
            - 'null'
        config:
          $ref: '#/components/schemas/AutomationConfig'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - app_id
        - name
        - status
        - owner_id
        - config
        - created_at
        - updated_at
      additionalProperties: false
      description: A wallet automation.
      title: WalletAutomationResponse
      x-stainless-model: wallet_automations.wallet_automation_response
    AutomationConfigInput:
      type: object
      properties:
        trigger:
          $ref: '#/components/schemas/AutomationTriggerConfigInput'
        action:
          $ref: '#/components/schemas/AutomationActionConfigInput'
      required:
        - trigger
        - action
      description: >-
        Full configuration for a wallet automation (trigger + action) accepting
        human-readable aliases.
      title: AutomationConfigInput
      x-stainless-model: wallet_automations.automation_config_input
    WalletAutomationStatus:
      type: string
      enum:
        - enabled
        - disabled
      description: >-
        Automation lifecycle state: 'enabled' = running, 'disabled' = not
        running.
      title: WalletAutomationStatus
      x-stainless-model: wallet_automations.wallet_automation_status
    AutomationConfig:
      type: object
      properties:
        trigger:
          $ref: '#/components/schemas/AutomationTriggerConfig'
        action:
          $ref: '#/components/schemas/AutomationActionConfig'
      required:
        - trigger
        - action
      additionalProperties: false
      description: Full configuration for a wallet automation (trigger + action).
      title: AutomationConfig
      x-stainless-model: wallet_automations.automation_config
    AutomationTriggerConfigInput:
      oneOf:
        - $ref: '#/components/schemas/AutomationDepositTriggerConfigInput'
      discriminator:
        propertyName: type
        mapping:
          deposit:
            $ref: '#/components/schemas/AutomationDepositTriggerConfigInput'
      description: Configuration for an automation trigger (input form with alias support).
      title: AutomationTriggerConfigInput
      x-stainless-model: wallet_automations.automation_trigger_config_input
    AutomationActionConfigInput:
      oneOf:
        - $ref: '#/components/schemas/AutomationSwapActionConfigInput'
        - $ref: '#/components/schemas/AutomationEarnDepositActionConfigInput'
      discriminator:
        propertyName: type
        mapping:
          swap:
            $ref: '#/components/schemas/AutomationSwapActionConfigInput'
          earn_deposit:
            $ref: '#/components/schemas/AutomationEarnDepositActionConfigInput'
      description: Configuration for an automation action (input form with alias support).
      title: AutomationActionConfigInput
      x-stainless-model: wallet_automations.automation_action_config_input
    AutomationTriggerConfig:
      oneOf:
        - $ref: '#/components/schemas/AutomationDepositTriggerConfig'
      discriminator:
        propertyName: type
        mapping:
          deposit:
            $ref: '#/components/schemas/AutomationDepositTriggerConfig'
      description: Configuration for an automation trigger.
      title: AutomationTriggerConfig
      x-stainless-model: wallet_automations.automation_trigger_config
    AutomationActionConfig:
      oneOf:
        - $ref: '#/components/schemas/AutomationSwapActionConfig'
        - $ref: '#/components/schemas/AutomationEarnDepositActionConfig'
      discriminator:
        propertyName: type
        mapping:
          swap:
            $ref: '#/components/schemas/AutomationSwapActionConfig'
          earn_deposit:
            $ref: '#/components/schemas/AutomationEarnDepositActionConfig'
      description: Configuration for an automation action.
      title: AutomationActionConfig
      x-stainless-model: wallet_automations.automation_action_config
    AutomationDepositTriggerConfigInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - deposit
        assets:
          $ref: '#/components/schemas/AutomationAssetFilterInput'
      required:
        - type
        - assets
      description: >-
        Trigger configuration for deposit events (input form with alias
        support).
      title: AutomationDepositTriggerConfigInput
      x-stainless-model: wallet_automations.automation_deposit_trigger_config_input
    AutomationSwapActionConfigInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - swap
        destination_chain_asset:
          $ref: '#/components/schemas/AutomationDestinationAssetInput'
      required:
        - type
        - destination_chain_asset
      description: >-
        Action configuration for swap operations (input form with alias
        support).
      title: AutomationSwapActionConfigInput
      x-stainless-model: wallet_automations.automation_swap_action_config_input
    AutomationEarnDepositActionConfigInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - earn_deposit
        vault_id:
          type: string
          minLength: 1
          maxLength: 64
      required:
        - type
        - vault_id
      description: Action configuration for depositing into an Earn vault (input form).
      title: AutomationEarnDepositActionConfigInput
      x-stainless-model: wallet_automations.automation_earn_deposit_action_config_input
    AutomationDepositTriggerConfig:
      type: object
      properties:
        type:
          type: string
          enum:
            - deposit
        assets:
          $ref: '#/components/schemas/AutomationAssetFilter'
      required:
        - type
        - assets
      additionalProperties: false
      description: Trigger configuration for deposit events.
      title: AutomationDepositTriggerConfig
      x-stainless-model: wallet_automations.automation_deposit_trigger_config
    AutomationSwapActionConfig:
      type: object
      properties:
        type:
          type: string
          enum:
            - swap
        destination_chain_asset:
          $ref: '#/components/schemas/AutomationDestinationAsset'
      required:
        - type
        - destination_chain_asset
      additionalProperties: false
      description: Action configuration for swap operations.
      title: AutomationSwapActionConfig
      x-stainless-model: wallet_automations.automation_swap_action_config
    AutomationEarnDepositActionConfig:
      type: object
      properties:
        type:
          type: string
          enum:
            - earn_deposit
        vault_id:
          type: string
          minLength: 1
          maxLength: 64
      required:
        - type
        - vault_id
      additionalProperties: false
      description: Action configuration for depositing into an Earn vault.
      title: AutomationEarnDepositActionConfig
      x-stainless-model: wallet_automations.automation_earn_deposit_action_config
    AutomationAssetFilterInput:
      oneOf:
        - $ref: '#/components/schemas/AutomationAssetFilterAll'
        - $ref: '#/components/schemas/AutomationAssetFilterInputInclude'
        - $ref: '#/components/schemas/AutomationAssetFilterInputExclude'
      discriminator:
        propertyName: mode
        mapping:
          all:
            $ref: '#/components/schemas/AutomationAssetFilterAll'
          include:
            $ref: '#/components/schemas/AutomationAssetFilterInputInclude'
          exclude:
            $ref: '#/components/schemas/AutomationAssetFilterInputExclude'
      description: >-
        Which assets to include/exclude for an automation trigger (input form
        with alias support).
      title: AutomationAssetFilterInput
      x-stainless-model: wallet_automations.automation_asset_filter_input
    AutomationDestinationAssetInput:
      allOf:
        - $ref: '#/components/schemas/AutomationDestinationAsset'
        - type: object
          properties:
            asset:
              type: string
              minLength: 1
              maxLength: 64
            chain:
              type: string
              minLength: 1
              maxLength: 64
      description: >-
        A destination asset spec accepting either raw identifiers
        (asset_address, caip2) or human-readable aliases (asset, chain). Exactly
        one of asset_address or asset must be provided; exactly one of caip2 or
        chain must be provided.
      title: AutomationDestinationAssetInput
      x-stainless-model: wallet_automations.automation_destination_asset_input
    AutomationAssetFilter:
      oneOf:
        - $ref: '#/components/schemas/AutomationAssetFilterAll'
        - $ref: '#/components/schemas/AutomationAssetFilterInclude'
        - $ref: '#/components/schemas/AutomationAssetFilterExclude'
      discriminator:
        propertyName: mode
        mapping:
          all:
            $ref: '#/components/schemas/AutomationAssetFilterAll'
          include:
            $ref: '#/components/schemas/AutomationAssetFilterInclude'
          exclude:
            $ref: '#/components/schemas/AutomationAssetFilterExclude'
      description: Which assets to include/exclude for an automation trigger.
      title: AutomationAssetFilter
      x-stainless-model: wallet_automations.automation_asset_filter
    AutomationDestinationAsset:
      type: object
      properties:
        asset_address:
          type: string
          minLength: 1
          maxLength: 128
        caip2:
          type: string
          minLength: 1
          maxLength: 64
      required:
        - asset_address
        - caip2
      additionalProperties: false
      description: >-
        Destination asset identified by contract address on a specific chain
        (CAIP-2).
      title: AutomationDestinationAsset
      x-stainless-model: wallet_automations.automation_destination_asset
    AutomationAssetFilterAll:
      type: object
      properties:
        mode:
          type: string
          enum:
            - all
      required:
        - mode
      description: Match all assets.
      title: AutomationAssetFilterAll
      x-stainless-model: wallet_automations.automation_asset_filter_all
    AutomationAssetFilterInputInclude:
      type: object
      properties:
        mode:
          type: string
          enum:
            - include
        values:
          type: array
          items:
            $ref: '#/components/schemas/AutomationAssetSpecInput'
          minItems: 1
          maxItems: 20
      required:
        - mode
        - values
      description: Match only the specified assets (input form with alias support).
      title: AutomationAssetFilterInputInclude
      x-stainless-model: wallet_automations.automation_asset_filter_input_include
    AutomationAssetFilterInputExclude:
      type: object
      properties:
        mode:
          type: string
          enum:
            - exclude
        values:
          type: array
          items:
            $ref: '#/components/schemas/AutomationAssetSpecInput'
          minItems: 1
          maxItems: 20
      required:
        - mode
        - values
      description: >-
        Match all assets except the specified ones (input form with alias
        support).
      title: AutomationAssetFilterInputExclude
      x-stainless-model: wallet_automations.automation_asset_filter_input_exclude
    AutomationAssetFilterInclude:
      type: object
      properties:
        mode:
          type: string
          enum:
            - include
        values:
          type: array
          items:
            $ref: '#/components/schemas/AutomationAssetSpec'
          minItems: 1
          maxItems: 500
      required:
        - mode
        - values
      additionalProperties: false
      description: Match only the specified assets.
      title: AutomationAssetFilterInclude
      x-stainless-model: wallet_automations.automation_asset_filter_include
    AutomationAssetFilterExclude:
      type: object
      properties:
        mode:
          type: string
          enum:
            - exclude
        values:
          type: array
          items:
            $ref: '#/components/schemas/AutomationAssetSpec'
          minItems: 1
          maxItems: 500
      required:
        - mode
        - values
      additionalProperties: false
      description: Match all assets except the specified ones.
      title: AutomationAssetFilterExclude
      x-stainless-model: wallet_automations.automation_asset_filter_exclude
    AutomationAssetSpecInput:
      allOf:
        - $ref: '#/components/schemas/AutomationAssetSpec'
        - type: object
          properties:
            asset:
              type: string
              minLength: 1
              maxLength: 64
            chain:
              type: string
              minLength: 1
              maxLength: 64
      description: >-
        An asset spec accepting either raw identifiers (asset_address, caip2) or
        human-readable aliases (asset, chain). Exactly one of asset_address or
        asset must be provided; at most one of caip2 or chain may be provided.
      title: AutomationAssetSpecInput
      x-stainless-model: wallet_automations.automation_asset_spec_input
    AutomationAssetSpec:
      type: object
      properties:
        asset_address:
          type: string
          minLength: 1
          maxLength: 128
        caip2:
          type: string
          minLength: 1
          maxLength: 64
      required:
        - asset_address
        - caip2
      additionalProperties: false
      description: An asset identified by contract address, scoped to a chain via CAIP-2.
      title: AutomationAssetSpec
      x-stainless-model: wallet_automations.automation_asset_spec
  securitySchemes:
    appSecretAuth:
      type: http
      scheme: basic
      description: >-
        Basic Auth header with your app ID as the username and your app secret
        as the password.

````