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

# Update Smart Account

> Update settings for an existing Smart Account

Update the configuration of an existing Smart Account, including signers, threshold, and optional settings.

### Key Concepts

* **Partial Updates**: Only specify the fields you want to modify
* **Transaction Signing**: Changes require signatures from current authorized signers or the admin address
* **Validation Rules**: Updates must maintain valid signer and threshold requirements

### Update Modes

#### Standard Mode

In standard mode (without admin), updates require:

* Meeting the current threshold requirement
* Multiple signers can approve the transaction
* When updating `smart_account_signers`, you must provide the complete desired state
* To unset a field, set it to an empty string `""` or `0`

Example request:

```json theme={null}
PATCH /api/v1/smart-accounts/{address}
{
  "smart_account_signers": [
    {
      "address": "existing1...",
      "permissions": ["CAN_INITIATE", "CAN_VOTE", "CAN_EXECUTE"]
    },
    {
      "address": "existing2...",
      "permissions": ["CAN_VOTE", "CAN_EXECUTE"]
    },
    {
      "address": "new_signer...",
      "permissions": ["CAN_VOTE", "CAN_EXECUTE"]
    }
  ],
  "threshold": 2,
  "transaction_signers": ["current1...", "current2..."]
}
```

#### Admin Mode

When a smart account has an admin address set, only that address can modify settings using admin mode:

* Must use the `admin=true` query parameter
* Only the admin address should be in `transaction_signers`

Example admin request:

```json theme={null}
PATCH /api/v1/smart-accounts/{address}?admin=true
{
  "smart_account_signers": [
    {
      "address": "signer1...",
      "permissions": ["CAN_INITIATE", "CAN_VOTE", "CAN_EXECUTE"]
    },
    {
      "address": "signer2...",
      "permissions": ["CAN_VOTE", "CAN_EXECUTE"]
    }
  ],
  "threshold": 2,
  "transaction_signers": ["admin_address"] // Must be only the admin address
}
```

### Understanding Updates

#### Modifying Fields

* **Adding/Updating Fields**: Include the field with its new value
* **Removing Optional Fields**: Set the field value to `""` or `0` to remove it
* **Required Fields**: Cannot be set to `""` or `0` (will return validation error)

Example removing admin\_address:

```json theme={null}
{
  "admin_address": ""
}
```

<Note>Only the admin address can remove the admin address.</Note>

### Validation Rules

#### Signer Configuration

1. Must always maintain:

   * At least one signer with CAN\_INITIATE permission
   * Enough signers with CAN\_VOTE permission to meet threshold
   * At least one signer with CAN\_EXECUTE permission

2. Invalid configurations:

```json theme={null}
{
  "smart_account_signers": [
    // ❌ Missing CAN_INITIATE permission
    {
      "address": "signer1...",
      "permissions": ["CAN_VOTE", "CAN_EXECUTE"]
    }
  ]
}
```

#### Threshold Requirements

* Must be greater than 0
* Must not exceed number of signers with CAN\_VOTE permission
* Changes require meeting current threshold for signing

#### Admin Mode Requirements

* Only admin address can be in `transaction_signers`
* Must use `admin=true` query parameter
* Updates are atomic - all succeed or all fail

#### Important Notes

* Changes only take effect after transaction settlement
* Required fields cannot be removed:
  * `smart_account_signers` (must maintain minimum permissions)
  * `threshold` (must be > 0)
* Admin can remove itself by setting `admin_address` to `""`

### Fee Configuration

The `fee_config` object controls how transaction fees are paid:

* **When `self_managed_fees` is true**: The `payer_address` becomes both the rent payer and transaction fee payer. The `currency` field is ignored.
* **When `self_managed_fees` is false or not set**: Uses gas abstraction with the specified `currency` (sol, usdc, or usdt) and `payer_address`.


## OpenAPI

````yaml PATCH /api/v1/smart-accounts/{smart_account_address}
openapi: 3.0.0
info:
  title: Squads API
  version: 1.0.0
  description: >
    The Squads API provides functionality for managing smart accounts and
    spending limits.

    This API allows you to create and manage smart accounts, set up spending
    limits, and perform transactions.
servers:
  - url: https://developer-api.squads.so
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/smart-accounts/{smart_account_address}:
    patch:
      summary: Update smart account settings
      description: >
        Update the configuration of an existing Smart Account. If the account
        has an admin address set,

        only that address can modify settings and must use admin mode.
      operationId: updateSmartAccount
      parameters:
        - $ref: '#/components/parameters/NetworkHeader'
        - $ref: '#/components/parameters/SmartAccountAddress'
        - $ref: '#/components/parameters/AdminMode'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                smart_account_signers:
                  type: array
                  items:
                    $ref: '#/components/schemas/Signer'
                  description: >-
                    List of signers and their permissions. At least one signer
                    must have CAN_INITIATE permission.
                threshold:
                  type: integer
                  format: uint32
                  description: >-
                    Number of CAN_VOTE signatures required for transaction
                    approval. Must not exceed the number of signers with
                    CAN_VOTE permission.
                admin_address:
                  type: string
                  description: >-
                    Admin address. When set, only this address can modify
                    account settings using the admin query parameter.
                transaction_signers:
                  type: array
                  items:
                    type: string
                  description: >
                    List of signers for this update transaction.

                    In admin mode, this must contain only the admin address.

                    In normal mode, must meet the account's threshold
                    requirement.
                fee_config:
                  $ref: '#/components/schemas/FeeConfig'
      responses:
        '200':
          description: Smart account updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction:
                    type: string
                  fee:
                    $ref: '#/components/schemas/Fee'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  parameters:
    NetworkHeader:
      name: x-squads-network
      in: header
      required: true
      schema:
        type: string
        enum:
          - mainnet
          - devnet
      description: Specifies the network for the API request
    SmartAccountAddress:
      name: smart_account_address
      in: path
      required: true
      schema:
        type: string
      description: The address of the smart account
    AdminMode:
      name: admin
      in: query
      required: false
      schema:
        type: boolean
      description: >-
        When true, indicates that the update is being performed by the smart
        account admin (configured in the admin_address field)
  schemas:
    Signer:
      type: object
      properties:
        address:
          type: string
          description: Address of the signer
        permissions:
          type: array
          items:
            type: string
            enum:
              - CAN_INITIATE
              - CAN_VOTE
              - CAN_EXECUTE
          description: List of permissions granted to the signer
    FeeConfig:
      type: object
      properties:
        currency:
          type: string
          description: Currency for the fee
        payer_address:
          type: string
          description: Address of the fee payer
        self_managed_fees:
          type: boolean
          default: false
          description: >-
            When true, the fee is paid by the smart account itself. When false
            or not set, the fee is paid by the transaction signers.
    Fee:
      type: object
      properties:
        amount:
          type: string
          format: uint64
          description: Fee amount in base units
        amount_decimal:
          type: string
          description: Decimal representation of the fee amount
        currency:
          type: string
          description: Currency of the fee
        sol_equivalent:
          $ref: '#/components/schemas/SolEquivalent'
    SolEquivalent:
      type: object
      properties:
        amount:
          type: string
          format: uint64
          description: Amount in base units
        amount_decimal:
          type: string
          description: Decimal representation of the amount
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        code:
          type: string
          description: Error code for easy lookup
        message:
          type: string
          description: Detailed error description
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
        metadata:
          $ref: '#/components/schemas/ErrorMetadata'
        custom:
          type: object
          additionalProperties:
            type: string
        simulation_logs:
          type: array
          items:
            type: string
          description: >-
            Transaction simulation logs. Returns an empty array when debug=false
            or not provided.
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          description: The field that failed validation
        code:
          type: string
          description: Error code specific to this validation failure
        message:
          type: string
          description: Detailed message about the validation failure
        expected:
          type: string
          description: Expected value or condition
        actual:
          type: string
          description: Actual value received
    ErrorMetadata:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        request_id:
          type: string
          description: Unique identifier for debugging
        timestamp:
          type: string
          format: date-time
          description: When the error occurred
        resource_id:
          type: string
          description: Identifier of the resource that experienced the error
        useful_links:
          type: array
          items:
            type: string
          description: Links to relevant documentation
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: UUID
      description: UUID-based API key provided by Squads

````