---
title: "Swap tokens via DEX aggregator"
method: POST
path: "/v1/treasury/wallets/{chain}/swap"
tags: ["Treasury Wallets"]
---

# Swap tokens via DEX aggregator

`POST /v1/treasury/wallets/{chain}/swap`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/treasury/wallets/{chain}/swap`
- Auth: HTTP bearer

Executes a token swap through a DEX aggregator from the user's active
wallet on the specified chain. Requires re-authentication via
`X-Auth-Confirm` header (account password). Human users only.

## Path parameters

- `chain` string, required

## Headers

- `X-Auth-Confirm` string, password, required

## Request body

- TreasuryWalletSwapRequest
  - `sell_token` string, required: Address of the token to sell (or "native" for ETH)
  - `buy_token` string, required: Address of the token to buy (or "native" for ETH)
  - `sell_amount` string, required: Amount to sell in token's smallest unit

## Response `200`

Swap executed

- TreasuryWalletSwapResponse
  - `tx_hash` string, required
  - `sell_token` string, required
  - `buy_token` string, required
  - `sell_amount` string, required
  - `buy_amount` string, required
  - `chain` string, required
  - `status` string, required

## Other responses

- `400`: Invalid request
- `401`: Authentication required or invalid
- `403`: Insufficient permissions
- `404`: Resource not found

---

[API](https://skmtc.dev/1claw/apis/1claw-api.md) · [All operations](https://skmtc.dev/1claw/apis/1claw-api/llms.txt) · [OpenAPI document](https://skmtc.dev/1claw/apis/1claw-api/revisions/5fa0918f3b41?raw)
