GET /swap/status/:id

GET /swap/status/{swapId} | Auth: Required

Retrieve the current status of a swap by its ID. Use this endpoint to poll for transaction completion after executing a swap via POST /swap/execute.

Request

Path Parameters

Field
Type
Required
Description

swapId

integer

Yes

The swap ID returned from POST /swap/execute

Example Request

GET /swap/status/4821

Response

Field
Type
Description

success

boolean

Whether the request succeeded

swap_id

integer

The swap identifier

status

string

Current status: "submitted", "pending", "completed", or "failed"

tx_hash

string | null

Transaction hash, or null if not yet broadcast

from_token

string

Source token symbol (e.g., "ETH")

to_token

string

Destination token symbol (e.g., "USDC")

Status Lifecycle

  • submitted -- The transaction has been signed and sent to the network.

  • pending -- The transaction is waiting for on-chain confirmation.

  • completed -- The swap executed successfully and is confirmed on-chain.

  • failed -- The transaction reverted or could not be confirmed.

Example Response

Errors

Status
Error
Cause

401

"Unauthorized"

Missing or invalid API key

404

"Swap not found"

No swap exists with the given ID, or it belongs to a different agent

Code Examples

curl

Python

TypeScript

Last updated