> ## 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.

# Attach wallet automations

> Attach one or more automations to a wallet.

<Warning>
  The wallet must be generated by Privy and never exported. Users cannot attach automations to
  imported or previously exported wallets.
</Warning>

Attaching an automation that is already attached updates its parameters and preserves its matching priority.


## OpenAPI

````yaml post /v1/wallets/{wallet_id}/automations/attach
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/wallets/{wallet_id}/automations/attach:
    post:
      tags:
        - Wallets
      summary: Attach automations to wallet
      description: Attach one or more automations to a wallet.
      operationId: attachWalletAutomations
      parameters:
        - schema:
            type: string
            description: ID of the wallet.
          required: true
          name: wallet_id
          in: path
        - schema:
            type: string
            description: ID of your Privy app.
          required: true
          name: privy-app-id
          in: header
        - schema:
            type: string
            description: >-
              Request authorization signature. If multiple signatures are
              required, they should be comma separated.
          required: false
          name: privy-authorization-signature
          in: header
        - schema:
            type: string
            description: >-
              Request expiry. Value is a Unix timestamp in milliseconds
              representing the deadline by which the request must be processed.
          required: false
          name: privy-request-expiry
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachWalletAutomationRequestBody'
      responses:
        '200':
          description: The list of created automation attachments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletAutomationAttachmentListResponse'
      security:
        - appSecretAuth: []
components:
  schemas:
    AttachWalletAutomationRequestBody:
      type: object
      properties:
        automation_ids:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
          maxItems: 20
        params:
          allOf:
            - $ref: '#/components/schemas/SwapAttachmentParams'
            - description: >-
                Required for 'swap' automations (destination_address). Must be
                omitted for 'earn_deposit' automations — they take no
                per-attachment params.
      required:
        - automation_ids
      description: >-
        Request body for attaching automations to a wallet (wallet ID comes from
        the URL).
      title: AttachWalletAutomationRequestBody
      x-stainless-model: wallets.attach_wallet_automation_request_body
    WalletAutomationAttachmentListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WalletAutomationAttachmentResponse'
      required:
        - data
      additionalProperties: false
      description: List of wallet automation attachments.
      title: WalletAutomationAttachmentListResponse
      x-stainless-model: wallets.wallet_automation_attachment_list_response
    SwapAttachmentParams:
      type: object
      properties:
        destination_address:
          type: string
          minLength: 1
          maxLength: 128
      required:
        - destination_address
      additionalProperties: false
      description: Per-attachment parameters for swap automations.
      title: SwapAttachmentParams
      x-stainless-model: wallet_automations.swap_attachment_params
    WalletAutomationAttachmentResponse:
      type: object
      properties:
        id:
          type: string
        automation_id:
          type: string
        wallet_id:
          type: string
        params:
          anyOf:
            - $ref: '#/components/schemas/SwapAttachmentParams'
            - type: 'null'
        status:
          $ref: '#/components/schemas/WalletAutomationStatus'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - automation_id
        - wallet_id
        - params
        - status
        - created_at
        - updated_at
      additionalProperties: false
      description: >-
        A wallet automation attachment linking an automation to a specific
        wallet.
      title: WalletAutomationAttachmentResponse
      x-stainless-model: wallets.wallet_automation_attachment_response
    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
  securitySchemes:
    appSecretAuth:
      type: http
      scheme: basic
      description: >-
        Basic Auth header with your app ID as the username and your app secret
        as the password.

````