Skip to main content

How do I call the Route API with curl?

POST to https://api.enso.build/api/v1/shortcuts/route with your API key and a JSON body of tokens, amounts, chain, and slippage. Copy current field names from the docs.

J
Written by Javier Diaz

POST to https://api.enso.build/api/v1/shortcuts/route with your API key and a JSON body that includes the tokens, amount, chain, and slippage. Copy current field names from the docs, not from memory.

Definition

A curl call is a direct HTTP request to the Route API. It is useful for testing a quote before you wire a wallet or SDK.

How it works

  • Authenticate with Authorization: Bearer $ENSO_API_KEY (or the apikey query parameter).

  • Send chainId, fromAddress, tokenIn, tokenOut, amountIn, and a protection field — usually slippage in basis points, for example "50".

  • For a cross-chain quote, also set destinationChainId and a receiver when needed.

  • Submit the returned tx.to, tx.data, and tx.value unchanged. Do not also set minAmountOut if you already set slippage.

How Enso does this

The Route API host is https://api.enso.build. From a shell, send an HTTP POST to https://api.enso.build/api/v1/shortcuts/route with your API key, a Content-Type of application/json, and a JSON body whose field names are taken from the current Route guide. A typical body includes chainId, fromAddress, tokenIn, tokenOut, amountIn, a slippage value such as 50, and routingStrategy. Confirm arrays, required fields, and any new options in the live docs before you ship.

FAQ

Can I use GET instead of POST?

The docs also describe a GET route endpoint. Prefer the POST body shown in the current Route guide, and copy the method from that page if you need GET.

Where do I get an API key?

In the Developer Portal. Verify it with GET /api/v1/account/accountId first.

Related articles

  • How do I authenticate Enso API requests?

  • How do I handle native token inputs?

  • How do I set slippage on an Enso route?

  • How do I use the Enso SDK?

  • How do I submit Enso transaction data from my app?

Sources

Did this answer your question?