# ZaaS HTTP API

## ZaaS HTTP API

Please refer to the following server configuration and openapi file for the http API.

### Common Parameters

| Configuration        | Value                                                                                                                                                                                |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Base URL             | <ul><li><code><https://zap-api.kyberswap.com/{chain}></code> where chain is one of the supported chain. For example: <code><https://zap-api.kyberswap.com/arbitrum></code></li></ul> |
| Header `X-Client-Id` | <p>Some value to identify your client.</p><p>Please contact <a href="mailto:bd@kyber.network"><bd@kyber.network></a> to whitelist your client id with more rate limit quota</p>      |

{% hint style="info" %}
Please refer to dex-ids.md and zaps-supported-chains-dexes.md for list of supported DEXes for each chain and their corresponding IDs
{% endhint %}

### API list

#### Zap in

## GET /api/v1/in/route

> Get the best zap-in route.

```json
{"openapi":"3.0.1","info":{"title":"Zap Service","version":"1.2.0"},"tags":[{"name":"Service"}],"servers":[{"url":"https://zap-api.kyberswap.com/{chain}","description":"production","variables":{"chain":{"enum":["arbitrum","avalanche","base","blast","bsc","ethereum","linea","optimism","polygon","polygon-zkevm","scroll","zksync"],"default":"arbitrum"}}}],"paths":{"/api/v1/in/route":{"get":{"tags":["Service"],"summary":"Get the best zap-in route.","operationId":"Service_GetInRoute","parameters":[{"name":"dex","in":"query","description":"Refer to https://docs.kyberswap.com/kyberswap-solutions/kyberswap-zap-as-a-service/zaps-supported-chains-dexes for list of supported dexes for each chain","required":true,"style":"form","explode":true,"schema":{"type":"string","enum":["DEX_UNISWAPV3"]}},{"name":"pool.id","in":"query","description":"id of the pool to zap into.","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"position.id","in":"query","description":"id of the position to add liquidity to; omit to create a new uniswapV3 position. for uniswapV2 this is user address","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"position.tickLower","in":"query","description":"min tick of the position, required if creating a new uniswapV3 position.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int32"}},{"name":"position.tickUpper","in":"query","description":"max tick of the position, required if creating a new uniswapV3 position.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int32"}},{"name":"tokensIn","in":"query","description":"which token(s) to use as zap source. also accepts comma separated addresses","required":true,"style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}},{"name":"amountsIn","in":"query","description":"amount(s) to zap including fee, corresponding to tokenIn. also accepts comma separated amounts.","required":true,"style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}},{"name":"tokenIn","in":"query","description":"which token(s) to use as zap source. also accepts comma separated addresses.\ndeprecated: use tokens_in. if both fields are specified, they are combined","required":false,"style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}},{"name":"amountIn","in":"query","description":"amount(s) to zap including fee, corresponding to tokenIn. also accepts comma separated amounts.\ndeprecated: use amounts_in. if both fields are specified, they are combined","required":false,"style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}},{"name":"aggregatorOptions.disable","in":"query","description":"whether to disable swapping with the aggregator","required":false,"style":"form","explode":true,"schema":{"type":"boolean"}},{"name":"aggregatorOptions.includedSources","in":"query","description":"comma-separated list of sources to use for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.excludedSources","in":"query","description":"comma-separated list of sources to exclude for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.excludedPools","in":"query","description":"comma-separated list of pools to exclude for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"feeAddress","in":"query","description":"the address of the fee recipient.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"feePcm","in":"query","description":"fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty.\nFrom 0 to 100,000 inclusively. Example: 1 for 0.001%.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int64"}},{"name":"slippage","in":"query","description":"maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will\nrevert) and pool swap during zap (for additional zapping and for refund).\nFrom 0 to 10,000 inclusively. Example: 1 for 0.01%.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int64"}},{"name":"X-Client-Id","in":"header","description":"Client Id","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"X-Request-Id","in":"header","description":"Request Id","required":false,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1GetInRouteResponse"}}}},"400":{"description":"Invalid Argument","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}}}}},"components":{"schemas":{"v1GetInRouteResponse":{"type":"object","properties":{"code":{"title":"grpc error code","type":"integer","format":"int32"},"message":{"title":"grpc error message","type":"string"},"data":{"$ref":"#/components/schemas/v1GetInRouteResponseData"},"requestId":{"title":"request trace id","type":"string"}},"description":"Returns the best route to zap-in to the specified pool position."},"v1GetInRouteResponseData":{"type":"object","properties":{"poolDetails":{"$ref":"#/components/schemas/v1PoolDetails"},"positionDetails":{"$ref":"#/components/schemas/v1PositionDetails"},"zapDetails":{"$ref":"#/components/schemas/v1ZapDetails"},"route":{"title":"the zap route to pass to build API to get call-data","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","format":"byte"},"routerAddress":{"title":"the router address to check approval amount","type":"string"},"gas":{"title":"rough estimate of gas required for the transaction","type":"string"},"gasUsd":{"title":"USD value of estimated gas required","type":"string"}},"description":"Encompasses returned data."},"v1PoolDetails":{"title":"details of the pool","type":"object","properties":{"category":{"type":"string"},"uniswapV3":{"$ref":"#/components/schemas/PoolDetailsUniswapV3"},"uniswapV2":{"$ref":"#/components/schemas/PoolDetailsUniswapV2"},"algebraV1":{"$ref":"#/components/schemas/PoolDetailsAlgebraV1"}}},"PoolDetailsUniswapV3":{"title":"details of the uniswapV3 pool","type":"object","properties":{"tick":{"title":"pool tick before zap","type":"integer","format":"int32"},"newTick":{"title":"pool tick after zap","type":"integer","format":"int32"},"sqrtP":{"title":"pool sqrt price (times 2^96) before zap","type":"string"},"newSqrtP":{"title":"pool sqrt price (times 2^96) after zap","type":"string"}}},"PoolDetailsUniswapV2":{"title":"details of the uniswapV2 pool","type":"object","properties":{"reserve0":{"title":"reserve0 before zap","type":"string"},"newReserve0":{"title":"reserve0 after zap","type":"string"},"reserve1":{"title":"reserve1 before zap","type":"string"},"newReserve1":{"title":"reserve1 after zap","type":"string"}}},"PoolDetailsAlgebraV1":{"title":"details of the algebraV1 pool","type":"object","properties":{"tick":{"title":"pool tick before zap","type":"integer","format":"int32"},"newTick":{"title":"pool tick after zap","type":"integer","format":"int32"},"sqrtP":{"title":"pool sqrt price (times 2^96) before zap","type":"string"},"newSqrtP":{"title":"pool sqrt price (times 2^96) after zap","type":"string"}}},"v1PositionDetails":{"title":"details of the new position state","type":"object","properties":{"removedLiquidity":{"title":"how much position liquidity to be removed","pattern":"\\d+","type":"string"},"removedAmountUsd":{"title":"total USD value of the position to be removed","type":"string"},"addedLiquidity":{"title":"how much position liquidity to be added","pattern":"\\d+","type":"string"},"addedAmountUsd":{"title":"total USD value of the position to be added","type":"string"}}},"v1ZapDetails":{"title":"details of the zap","type":"object","properties":{"initialAmountUsd":{"title":"USD value of the source zap token amount","type":"string"},"actions":{"title":"list of zap actions","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsAction"}},"finalAmountUsd":{"title":"USD value of the final amount including the added position and the left-over amount","type":"string"},"priceImpact":{"title":"price impact after zapping of final amount against initial amount","type":"number","format":"float"}}},"ZapDetailsAction":{"title":"one of the zap actions, specified by the type field","type":"object","properties":{"type":{"$ref":"#/components/schemas/ZapDetailsActionType"},"protocolFee":{"$ref":"#/components/schemas/ZapDetailsFeeAction"},"partnerFee":{"$ref":"#/components/schemas/ZapDetailsFeeAction"},"aggregatorSwap":{"$ref":"#/components/schemas/ZapDetailsSwapAction"},"poolSwap":{"$ref":"#/components/schemas/ZapDetailsSwapAction"},"addLiquidity":{"$ref":"#/components/schemas/ZapDetailsLiquidityAction"},"removeLiquidity":{"$ref":"#/components/schemas/ZapDetailsLiquidityAction"},"refund":{"$ref":"#/components/schemas/ZapDetailsRefundAction"}}},"ZapDetailsActionType":{"title":"type of the zap action","type":"string","description":"- ACTION_TYPE_UNSPECIFIED: Unspecified action\n - ACTION_TYPE_PROTOCOL_FEE: protocol fee\n - ACTION_TYPE_PARTNER_FEE: partner fee\n - ACTION_TYPE_AGGREGATOR_SWAP: aggregator swap\n - ACTION_TYPE_POOL_SWAP: pool swap\n - ACTION_TYPE_ADD_LIQUIDITY: add liquidity\n - ACTION_TYPE_REMOVE_LIQUIDITY: remove liquidity\n - ACTION_TYPE_REFUND: refund","default":"ACTION_TYPE_UNSPECIFIED","enum":["ACTION_TYPE_UNSPECIFIED","ACTION_TYPE_PROTOCOL_FEE","ACTION_TYPE_PARTNER_FEE","ACTION_TYPE_AGGREGATOR_SWAP","ACTION_TYPE_POOL_SWAP","ACTION_TYPE_ADD_LIQUIDITY","ACTION_TYPE_REMOVE_LIQUIDITY","ACTION_TYPE_REFUND"]},"ZapDetailsFeeAction":{"title":"fee collection","type":"object","properties":{"pcm":{"title":"fee per cent mille (0.001%) of the source zap amount","type":"integer","format":"int64"},"tokens":{"title":"token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}}},"ZapDetailsTokenAmount":{"title":"token address and amount in wei and in usd","type":"object","properties":{"address":{"title":"token address","pattern":"^0x[0-9A-Za-z]{40}$","type":"string"},"amount":{"title":"wei amount of the token","type":"string"},"amountUsd":{"title":"USD value of the token","type":"string"}}},"ZapDetailsSwapAction":{"title":"token swap, either with aggregator or with pool","type":"object","properties":{"swaps":{"type":"array","items":{"$ref":"#/components/schemas/SwapActionSwap"}}}},"SwapActionSwap":{"title":"a single swap","type":"object","properties":{"tokenIn":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"},"tokenOut":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}},"ZapDetailsLiquidityAction":{"title":"added or removed liquidity","type":"object","properties":{"tokens":{"title":"added or removed token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}},"fees":{"title":"collected fees","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}},"token0":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"},"token1":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}},"ZapDetailsRefundAction":{"title":"refund left-over tokens to user","type":"object","properties":{"tokens":{"title":"refunded token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}}},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{"type":"object"}}}}}
```

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X GET "https://zap-api.kyberswap.com/polygon/api/v1/in/route?dex=DEX_UNISWAPV3&pool.id=0xb46388f104ff88aac68626a316aaf3a924f32055&position.tickLower=-24800&position.tickUpper=32400&tokensIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&amountsIn=1000000000000000000&slippage=100" \
 -H "accept: application/json"\
 -H "x-client-id: zap-docs"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://zap-api.kyberswap.com/polygon/api/v1/in/route?dex=DEX_UNISWAPV3&pool.id=0xb46388f104ff88aac68626a316aaf3a924f32055&position.tickLower=-24800&position.tickUpper=32400&tokensIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&amountsIn=1000000000000000000&slippage=100', {
  headers: {
    'accept': 'application/json',
    'x-client-id': 'zap-docs'
  }
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-client-id': 'zap-docs',
}

params = {
    'dex': 'DEX_UNISWAPV3',
    'pool.id': '0xb46388f104ff88aac68626a316aaf3a924f32055',
    'position.tickLower': '-24800',
    'position.tickUpper': '32400',
    'tokensIn': '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
    'amountsIn': '1000000000000000000',
    'slippage': '100',
}

response = requests.get('https://zap-api.kyberswap.com/polygon/api/v1/in/route', params=params, headers=headers)
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'

uri = URI('https://zap-api.kyberswap.com/polygon/api/v1/in/route?dex=DEX_UNISWAPV3&pool.id=0xb46388f104ff88aac68626a316aaf3a924f32055&position.tickLower=-24800&position.tickUpper=32400&tokensIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&amountsIn=1000000000000000000&slippage=100')
req = Net::HTTP::Get.new(uri)
req['accept'] = 'application/json'
req['x-client-id'] = 'zap-docs'

req_options = {
  use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(req)
end
```

{% endtab %}
{% endtabs %}

**Build Route**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -X POST "https://zap-api.kyberswap.com/polygon/api/v1/in/route/build" \
 -H "accept: application/json"\
 -H "content-type: application/json"\
 -H "x-client-id: zap-docs" \
 -d '{"sender":"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270","recipient":"0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D","route":"KLUv/WALBWUVAKavgSFAb9qflX03+n9Wj9hEtiy3sD717uBIcklIUtb9UBVFASZwAG8AewCseGGDZz+f91M98txGAZqZqQsXPJhqdXGMHUIosW9O3X9D9ykvz587bZntFA+ybObckq051tD33d6immunvvu1fJ584ZaJB7tzeUH7jBfGkjJLmzw1GHNfFpS6uHNC7SJxoQMzFkbw7EKHR7EubGBGFDwMD76LRM+krFq9qkyNUC9kEi1HIhRHC7BQ8iwgDMREw9E88FRyoQUe3d1X1WmZdd13nzPVJkbpFzKe9ImUFau7UkkdoU7rrkob/cLF8yr1lzvRdntKumohg+d/c1MyvypzJ3ZnVvmqUP/CCZ4MFRR4b3mPgEmai5fykypW/M+uUGc6UqjV+vaERXQuLpywCFTMSWW+a2rki1JyJv301E6EuKEkvAnDloWPaYxxsAqB13BIFJo3IWEHB3k7n1FCrqvSKw5wk4ZUrp6p7OnTanbzoEAo2KPg8SYgEsWHb+4OUMcV4GmAOiwMlcrDQ6WC3tilpdQOpUrWinl/I8SaO19ljaGwCjy58OK5R0HTdAWK0Cu13SgoCBMNCNMGIhgMvlCiiXg8g4PuNRIRjmcBsBUAktd4MIa1iAeTaFy8CLOY4HlIKM1baBwUDqZ/XfvWqSrba5ma77q5X5V6i/o178ZAIBHMcHBY+BoKRIInQCBAAkOIkfEBRAi1htoyA+Fh2bFWvRh8hvz97PowAKx1qdsQ5xjp2pgs22UIOyQAShdlhjfwZzCdB+z1ohnGvFnSTTKxnORd4epZFuIeA+w2wAw7LgAorNLwQsqNf+xgg82V4vgsD37S9QzcQQb7FtadgPK3lKx7U4HBskxWQGuCP0HydKwMJ+YSsBBVIoM2YptDA0F2jZS8pJQuID3loJeJAg==","deadline":1800000000,"source":"zap-docs"}' 
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://zap-api.kyberswap.com/polygon/api/v1/in/route/build', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'content-type': 'application/json',
    'x-client-id': 'zap-docs'
  },
  body: JSON.stringify({
    'sender': '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
    'recipient': '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
    'route': 'KLUv/WALBWUVAKavgSFAb9qflX03+n9Wj9hEtiy3sD717uBIcklIUtb9UBVFASZwAG8AewCseGGDZz+f91M98txGAZqZqQsXPJhqdXGMHUIosW9O3X9D9ykvz587bZntFA+ybObckq051tD33d6immunvvu1fJ584ZaJB7tzeUH7jBfGkjJLmzw1GHNfFpS6uHNC7SJxoQMzFkbw7EKHR7EubGBGFDwMD76LRM+krFq9qkyNUC9kEi1HIhRHC7BQ8iwgDMREw9E88FRyoQUe3d1X1WmZdd13nzPVJkbpFzKe9ImUFau7UkkdoU7rrkob/cLF8yr1lzvRdntKumohg+d/c1MyvypzJ3ZnVvmqUP/CCZ4MFRR4b3mPgEmai5fykypW/M+uUGc6UqjV+vaERXQuLpywCFTMSWW+a2rki1JyJv301E6EuKEkvAnDloWPaYxxsAqB13BIFJo3IWEHB3k7n1FCrqvSKw5wk4ZUrp6p7OnTanbzoEAo2KPg8SYgEsWHb+4OUMcV4GmAOiwMlcrDQ6WC3tilpdQOpUrWinl/I8SaO19ljaGwCjy58OK5R0HTdAWK0Cu13SgoCBMNCNMGIhgMvlCiiXg8g4PuNRIRjmcBsBUAktd4MIa1iAeTaFy8CLOY4HlIKM1baBwUDqZ/XfvWqSrba5ma77q5X5V6i/o178ZAIBHMcHBY+BoKRIInQCBAAkOIkfEBRAi1htoyA+Fh2bFWvRh8hvz97PowAKx1qdsQ5xjp2pgs22UIOyQAShdlhjfwZzCdB+z1ohnGvFnSTTKxnORd4epZFuIeA+w2wAw7LgAorNLwQsqNf+xgg82V4vgsD37S9QzcQQb7FtadgPK3lKx7U4HBskxWQGuCP0HydKwMJ+YSsBBVIoM2YptDA0F2jZS8pJQuID3loJeJAg==',
    'deadline': 1800000000,
    'source': 'zap-docs'
  })
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'content-type': 'application/json',
    'x-client-id': 'zap-docs',
}

json_data = {
    'sender': '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
    'recipient': '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
    'route': 'KLUv/WALBWUVAKavgSFAb9qflX03+n9Wj9hEtiy3sD717uBIcklIUtb9UBVFASZwAG8AewCseGGDZz+f91M98txGAZqZqQsXPJhqdXGMHUIosW9O3X9D9ykvz587bZntFA+ybObckq051tD33d6immunvvu1fJ584ZaJB7tzeUH7jBfGkjJLmzw1GHNfFpS6uHNC7SJxoQMzFkbw7EKHR7EubGBGFDwMD76LRM+krFq9qkyNUC9kEi1HIhRHC7BQ8iwgDMREw9E88FRyoQUe3d1X1WmZdd13nzPVJkbpFzKe9ImUFau7UkkdoU7rrkob/cLF8yr1lzvRdntKumohg+d/c1MyvypzJ3ZnVvmqUP/CCZ4MFRR4b3mPgEmai5fykypW/M+uUGc6UqjV+vaERXQuLpywCFTMSWW+a2rki1JyJv301E6EuKEkvAnDloWPaYxxsAqB13BIFJo3IWEHB3k7n1FCrqvSKw5wk4ZUrp6p7OnTanbzoEAo2KPg8SYgEsWHb+4OUMcV4GmAOiwMlcrDQ6WC3tilpdQOpUrWinl/I8SaO19ljaGwCjy58OK5R0HTdAWK0Cu13SgoCBMNCNMGIhgMvlCiiXg8g4PuNRIRjmcBsBUAktd4MIa1iAeTaFy8CLOY4HlIKM1baBwUDqZ/XfvWqSrba5ma77q5X5V6i/o178ZAIBHMcHBY+BoKRIInQCBAAkOIkfEBRAi1htoyA+Fh2bFWvRh8hvz97PowAKx1qdsQ5xjp2pgs22UIOyQAShdlhjfwZzCdB+z1ohnGvFnSTTKxnORd4epZFuIeA+w2wAw7LgAorNLwQsqNf+xgg82V4vgsD37S9QzcQQb7FtadgPK3lKx7U4HBskxWQGuCP0HydKwMJ+YSsBBVIoM2YptDA0F2jZS8pJQuID3loJeJAg==',
    'deadline': 1800000000,
    'source': 'zap-docs',
}

response = requests.post('https://zap-api.kyberswap.com/polygon/api/v1/in/route/build', headers=headers, json=json_data)
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'

uri = URI('https://zap-api.kyberswap.com/polygon/api/v1/in/route/build')
req = Net::HTTP::Post.new(uri)
req.content_type = 'application/json'
req['accept'] = 'application/json'
req['x-client-id'] = 'zap-docs'

req.body = {
  'sender' => '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
  'recipient' => '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
  'route' => 'KLUv/WALBWUVAKavgSFAb9qflX03+n9Wj9hEtiy3sD717uBIcklIUtb9UBVFASZwAG8AewCseGGDZz+f91M98txGAZqZqQsXPJhqdXGMHUIosW9O3X9D9ykvz587bZntFA+ybObckq051tD33d6immunvvu1fJ584ZaJB7tzeUH7jBfGkjJLmzw1GHNfFpS6uHNC7SJxoQMzFkbw7EKHR7EubGBGFDwMD76LRM+krFq9qkyNUC9kEi1HIhRHC7BQ8iwgDMREw9E88FRyoQUe3d1X1WmZdd13nzPVJkbpFzKe9ImUFau7UkkdoU7rrkob/cLF8yr1lzvRdntKumohg+d/c1MyvypzJ3ZnVvmqUP/CCZ4MFRR4b3mPgEmai5fykypW/M+uUGc6UqjV+vaERXQuLpywCFTMSWW+a2rki1JyJv301E6EuKEkvAnDloWPaYxxsAqB13BIFJo3IWEHB3k7n1FCrqvSKw5wk4ZUrp6p7OnTanbzoEAo2KPg8SYgEsWHb+4OUMcV4GmAOiwMlcrDQ6WC3tilpdQOpUrWinl/I8SaO19ljaGwCjy58OK5R0HTdAWK0Cu13SgoCBMNCNMGIhgMvlCiiXg8g4PuNRIRjmcBsBUAktd4MIa1iAeTaFy8CLOY4HlIKM1baBwUDqZ/XfvWqSrba5ma77q5X5V6i/o178ZAIBHMcHBY+BoKRIInQCBAAkOIkfEBRAi1htoyA+Fh2bFWvRh8hvz97PowAKx1qdsQ5xjp2pgs22UIOyQAShdlhjfwZzCdB+z1ohnGvFnSTTKxnORd4epZFuIeA+w2wAw7LgAorNLwQsqNf+xgg82V4vgsD37S9QzcQQb7FtadgPK3lKx7U4HBskxWQGuCP0HydKwMJ+YSsBBVIoM2YptDA0F2jZS8pJQuID3loJeJAg==',
  'deadline' => 1800000000,
  'source' => 'zap-docs'
}.to_json

req_options = {
  use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(req)
end
```

{% endtab %}
{% endtabs %}

#### Zap Migrate

## GET /api/v1/migrate/route

> Get the best zap-migrate route.

```json
{"openapi":"3.0.1","info":{"title":"Zap Service","version":"1.2.0"},"tags":[{"name":"Service"}],"servers":[{"url":"https://zap-api.kyberswap.com/{chain}","description":"production","variables":{"chain":{"enum":["arbitrum","avalanche","base","blast","bsc","ethereum","linea","optimism","polygon","polygon-zkevm","scroll","zksync"],"default":"arbitrum"}}}],"paths":{"/api/v1/migrate/route":{"get":{"tags":["Service"],"summary":"Get the best zap-migrate route.","operationId":"Service_GetMigrateRoute","parameters":[{"name":"dexFrom","in":"query","description":"Refer to https://docs.kyberswap.com/kyberswap-solutions/kyberswap-zap-as-a-service/zaps-supported-chains-dexes for list of supported dexes for each chain","required":true,"style":"form","explode":true,"schema":{"type":"string","enum":["DEX_UNISWAPV3"]}},{"name":"dexTo","in":"query","description":"Refer to https://docs.kyberswap.com/kyberswap-solutions/kyberswap-zap-as-a-service/zaps-supported-chains-dexes for list of supported dexes for each chain","required":true,"style":"form","explode":true,"schema":{"type":"string","enum":["DEX_UNISWAPV3"]}},{"name":"poolFrom.id","in":"query","description":"id of the pool to zap into.","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"poolTo.id","in":"query","description":"id of the pool to zap into.","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"positionFrom.id","in":"query","description":"id of the position to withdraw from","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"positionTo.id","in":"query","description":"id of the position to add liquidity to; omit to create a new uniswapV3 position. for uniswapV2 this is user address","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"positionTo.tickLower","in":"query","description":"min tick of the position, required if creating a new uniswapV3 position.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int32"}},{"name":"positionTo.tickUpper","in":"query","description":"max tick of the position, required if creating a new uniswapV3 position.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int32"}},{"name":"liquidityOut","in":"query","description":"liquidity amount to withdraw, or empty or 0 to withdraw all","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.disable","in":"query","description":"whether to disable swapping with the aggregator","required":false,"style":"form","explode":true,"schema":{"type":"boolean"}},{"name":"aggregatorOptions.includedSources","in":"query","description":"comma-separated list of sources to use for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.excludedSources","in":"query","description":"comma-separated list of sources to exclude for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.excludedPools","in":"query","description":"comma-separated list of pools to exclude for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"feeAddress","in":"query","description":"options for getting aggregator routes\nthe address of the fee recipient.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"feePcm","in":"query","description":"fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty.\nFrom 0 to 100,000 inclusively. Example: 1 for 0.001%.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int64"}},{"name":"slippage","in":"query","description":"maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will\nrevert) and pool swap during zap (for additional zapping and for refund).\nFrom 0 to 10,000 inclusively. Example: 1 for 0.01%.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int64"}},{"name":"X-Client-Id","in":"header","description":"Client Id","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"X-Request-Id","in":"header","description":"Request Id","required":false,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1GetMigrateRouteResponse"}}}},"400":{"description":"Invalid Argument","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}}}}},"components":{"schemas":{"v1GetMigrateRouteResponse":{"type":"object","properties":{"code":{"title":"grpc error code","type":"integer","format":"int32"},"message":{"title":"grpc error message","type":"string"},"data":{"$ref":"#/components/schemas/v1GetMigrateRouteResponseData"},"requestId":{"title":"request trace id","type":"string"}},"description":"Returns the best route to zap-migrate from an existing position to the specified pool position."},"v1GetMigrateRouteResponseData":{"type":"object","properties":{"poolDetails":{"$ref":"#/components/schemas/v1PoolDetails"},"positionDetails":{"$ref":"#/components/schemas/v1PositionDetails"},"zapDetails":{"$ref":"#/components/schemas/v1ZapDetails"},"route":{"title":"the zap route to pass to build API to get call-data","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","format":"byte"},"routerAddress":{"title":"the router address to check approval amount","type":"string"},"gas":{"title":"rough estimate of gas required for the transaction","type":"string"},"gasUsd":{"title":"USD value of estimated gas required","type":"string"}},"description":"Encompasses returned data."},"v1PoolDetails":{"title":"details of the pool","type":"object","properties":{"category":{"type":"string"},"uniswapV3":{"$ref":"#/components/schemas/PoolDetailsUniswapV3"},"uniswapV2":{"$ref":"#/components/schemas/PoolDetailsUniswapV2"},"algebraV1":{"$ref":"#/components/schemas/PoolDetailsAlgebraV1"}}},"PoolDetailsUniswapV3":{"title":"details of the uniswapV3 pool","type":"object","properties":{"tick":{"title":"pool tick before zap","type":"integer","format":"int32"},"newTick":{"title":"pool tick after zap","type":"integer","format":"int32"},"sqrtP":{"title":"pool sqrt price (times 2^96) before zap","type":"string"},"newSqrtP":{"title":"pool sqrt price (times 2^96) after zap","type":"string"}}},"PoolDetailsUniswapV2":{"title":"details of the uniswapV2 pool","type":"object","properties":{"reserve0":{"title":"reserve0 before zap","type":"string"},"newReserve0":{"title":"reserve0 after zap","type":"string"},"reserve1":{"title":"reserve1 before zap","type":"string"},"newReserve1":{"title":"reserve1 after zap","type":"string"}}},"PoolDetailsAlgebraV1":{"title":"details of the algebraV1 pool","type":"object","properties":{"tick":{"title":"pool tick before zap","type":"integer","format":"int32"},"newTick":{"title":"pool tick after zap","type":"integer","format":"int32"},"sqrtP":{"title":"pool sqrt price (times 2^96) before zap","type":"string"},"newSqrtP":{"title":"pool sqrt price (times 2^96) after zap","type":"string"}}},"v1PositionDetails":{"title":"details of the new position state","type":"object","properties":{"removedLiquidity":{"title":"how much position liquidity to be removed","pattern":"\\d+","type":"string"},"removedAmountUsd":{"title":"total USD value of the position to be removed","type":"string"},"addedLiquidity":{"title":"how much position liquidity to be added","pattern":"\\d+","type":"string"},"addedAmountUsd":{"title":"total USD value of the position to be added","type":"string"}}},"v1ZapDetails":{"title":"details of the zap","type":"object","properties":{"initialAmountUsd":{"title":"USD value of the source zap token amount","type":"string"},"actions":{"title":"list of zap actions","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsAction"}},"finalAmountUsd":{"title":"USD value of the final amount including the added position and the left-over amount","type":"string"},"priceImpact":{"title":"price impact after zapping of final amount against initial amount","type":"number","format":"float"}}},"ZapDetailsAction":{"title":"one of the zap actions, specified by the type field","type":"object","properties":{"type":{"$ref":"#/components/schemas/ZapDetailsActionType"},"protocolFee":{"$ref":"#/components/schemas/ZapDetailsFeeAction"},"partnerFee":{"$ref":"#/components/schemas/ZapDetailsFeeAction"},"aggregatorSwap":{"$ref":"#/components/schemas/ZapDetailsSwapAction"},"poolSwap":{"$ref":"#/components/schemas/ZapDetailsSwapAction"},"addLiquidity":{"$ref":"#/components/schemas/ZapDetailsLiquidityAction"},"removeLiquidity":{"$ref":"#/components/schemas/ZapDetailsLiquidityAction"},"refund":{"$ref":"#/components/schemas/ZapDetailsRefundAction"}}},"ZapDetailsActionType":{"title":"type of the zap action","type":"string","description":"- ACTION_TYPE_UNSPECIFIED: Unspecified action\n - ACTION_TYPE_PROTOCOL_FEE: protocol fee\n - ACTION_TYPE_PARTNER_FEE: partner fee\n - ACTION_TYPE_AGGREGATOR_SWAP: aggregator swap\n - ACTION_TYPE_POOL_SWAP: pool swap\n - ACTION_TYPE_ADD_LIQUIDITY: add liquidity\n - ACTION_TYPE_REMOVE_LIQUIDITY: remove liquidity\n - ACTION_TYPE_REFUND: refund","default":"ACTION_TYPE_UNSPECIFIED","enum":["ACTION_TYPE_UNSPECIFIED","ACTION_TYPE_PROTOCOL_FEE","ACTION_TYPE_PARTNER_FEE","ACTION_TYPE_AGGREGATOR_SWAP","ACTION_TYPE_POOL_SWAP","ACTION_TYPE_ADD_LIQUIDITY","ACTION_TYPE_REMOVE_LIQUIDITY","ACTION_TYPE_REFUND"]},"ZapDetailsFeeAction":{"title":"fee collection","type":"object","properties":{"pcm":{"title":"fee per cent mille (0.001%) of the source zap amount","type":"integer","format":"int64"},"tokens":{"title":"token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}}},"ZapDetailsTokenAmount":{"title":"token address and amount in wei and in usd","type":"object","properties":{"address":{"title":"token address","pattern":"^0x[0-9A-Za-z]{40}$","type":"string"},"amount":{"title":"wei amount of the token","type":"string"},"amountUsd":{"title":"USD value of the token","type":"string"}}},"ZapDetailsSwapAction":{"title":"token swap, either with aggregator or with pool","type":"object","properties":{"swaps":{"type":"array","items":{"$ref":"#/components/schemas/SwapActionSwap"}}}},"SwapActionSwap":{"title":"a single swap","type":"object","properties":{"tokenIn":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"},"tokenOut":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}},"ZapDetailsLiquidityAction":{"title":"added or removed liquidity","type":"object","properties":{"tokens":{"title":"added or removed token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}},"fees":{"title":"collected fees","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}},"token0":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"},"token1":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}},"ZapDetailsRefundAction":{"title":"refund left-over tokens to user","type":"object","properties":{"tokens":{"title":"refunded token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}}},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{"type":"object"}}}}}
```

#### Zap Out

## GET /api/v1/out/route

> Get the best zap-out route.

```json
{"openapi":"3.0.1","info":{"title":"Zap Service","version":"1.2.0"},"tags":[{"name":"Service"}],"servers":[{"url":"https://zap-api.kyberswap.com/{chain}","description":"production","variables":{"chain":{"enum":["arbitrum","avalanche","base","blast","bsc","ethereum","linea","optimism","polygon","polygon-zkevm","scroll","zksync"],"default":"arbitrum"}}}],"paths":{"/api/v1/out/route":{"get":{"tags":["Service"],"summary":"Get the best zap-out route.","operationId":"Service_GetOutRoute","parameters":[{"name":"dexFrom","in":"query","description":"Refer to https://docs.kyberswap.com/kyberswap-solutions/kyberswap-zap-as-a-service/zaps-supported-chains-dexes for list of supported dexes for each chain","required":true,"style":"form","explode":true,"schema":{"type":"string","enum":["DEX_UNISWAPV3"]}},{"name":"poolFrom.id","in":"query","description":"id of the pool to withdraw from.","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"positionFrom.id","in":"query","description":"id of the position to withdraw from","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"liquidityOut","in":"query","description":"liquidity amount to withdraw, or empty or 0 to withdraw all","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"tokenOut","in":"query","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.disable","in":"query","description":"whether to disable swapping with the aggregator","required":false,"style":"form","explode":true,"schema":{"type":"boolean"}},{"name":"aggregatorOptions.includedSources","in":"query","description":"comma-separated list of sources to use for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.excludedSources","in":"query","description":"comma-separated list of sources to exclude for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"aggregatorOptions.excludedPools","in":"query","description":"comma-separated list of pools to exclude for aggregator","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"feeAddress","in":"query","description":"fee recipient","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"feePcm","in":"query","description":"fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty.\nFrom 0 to 100,000 inclusively. Example: 1 for 0.001%.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int64"}},{"name":"slippage","in":"query","description":"maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will\nrevert) and pool swap during zap (for additional zapping and for refund).\nFrom 0 to 10,000 inclusively. Example: 1 for 0.01%.","required":false,"style":"form","explode":true,"schema":{"type":"integer","format":"int64"}},{"name":"X-Client-Id","in":"header","description":"Client Id","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"X-Request-Id","in":"header","description":"Request Id","required":false,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1GetOutRouteResponse"}}}},"400":{"description":"Invalid Argument","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}}}}},"components":{"schemas":{"v1GetOutRouteResponse":{"type":"object","properties":{"code":{"title":"grpc error code","type":"integer","format":"int32"},"message":{"title":"grpc error message","type":"string"},"data":{"$ref":"#/components/schemas/v1GetOutRouteResponseData"},"requestId":{"title":"request trace id","type":"string"}},"description":"Returns the best route to zap-out from an existing position to the specified pool position."},"v1GetOutRouteResponseData":{"type":"object","properties":{"zapDetails":{"$ref":"#/components/schemas/v1ZapDetails"},"route":{"title":"the zap route to pass to build API to get call-data","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","format":"byte"},"routerAddress":{"title":"the router address to check approval amount","type":"string"},"gas":{"title":"rough estimate of gas required for the transaction","type":"string"},"gasUsd":{"title":"USD value of estimated gas required","type":"string"}},"description":"Encompasses returned data."},"v1ZapDetails":{"title":"details of the zap","type":"object","properties":{"initialAmountUsd":{"title":"USD value of the source zap token amount","type":"string"},"actions":{"title":"list of zap actions","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsAction"}},"finalAmountUsd":{"title":"USD value of the final amount including the added position and the left-over amount","type":"string"},"priceImpact":{"title":"price impact after zapping of final amount against initial amount","type":"number","format":"float"}}},"ZapDetailsAction":{"title":"one of the zap actions, specified by the type field","type":"object","properties":{"type":{"$ref":"#/components/schemas/ZapDetailsActionType"},"protocolFee":{"$ref":"#/components/schemas/ZapDetailsFeeAction"},"partnerFee":{"$ref":"#/components/schemas/ZapDetailsFeeAction"},"aggregatorSwap":{"$ref":"#/components/schemas/ZapDetailsSwapAction"},"poolSwap":{"$ref":"#/components/schemas/ZapDetailsSwapAction"},"addLiquidity":{"$ref":"#/components/schemas/ZapDetailsLiquidityAction"},"removeLiquidity":{"$ref":"#/components/schemas/ZapDetailsLiquidityAction"},"refund":{"$ref":"#/components/schemas/ZapDetailsRefundAction"}}},"ZapDetailsActionType":{"title":"type of the zap action","type":"string","description":"- ACTION_TYPE_UNSPECIFIED: Unspecified action\n - ACTION_TYPE_PROTOCOL_FEE: protocol fee\n - ACTION_TYPE_PARTNER_FEE: partner fee\n - ACTION_TYPE_AGGREGATOR_SWAP: aggregator swap\n - ACTION_TYPE_POOL_SWAP: pool swap\n - ACTION_TYPE_ADD_LIQUIDITY: add liquidity\n - ACTION_TYPE_REMOVE_LIQUIDITY: remove liquidity\n - ACTION_TYPE_REFUND: refund","default":"ACTION_TYPE_UNSPECIFIED","enum":["ACTION_TYPE_UNSPECIFIED","ACTION_TYPE_PROTOCOL_FEE","ACTION_TYPE_PARTNER_FEE","ACTION_TYPE_AGGREGATOR_SWAP","ACTION_TYPE_POOL_SWAP","ACTION_TYPE_ADD_LIQUIDITY","ACTION_TYPE_REMOVE_LIQUIDITY","ACTION_TYPE_REFUND"]},"ZapDetailsFeeAction":{"title":"fee collection","type":"object","properties":{"pcm":{"title":"fee per cent mille (0.001%) of the source zap amount","type":"integer","format":"int64"},"tokens":{"title":"token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}}},"ZapDetailsTokenAmount":{"title":"token address and amount in wei and in usd","type":"object","properties":{"address":{"title":"token address","pattern":"^0x[0-9A-Za-z]{40}$","type":"string"},"amount":{"title":"wei amount of the token","type":"string"},"amountUsd":{"title":"USD value of the token","type":"string"}}},"ZapDetailsSwapAction":{"title":"token swap, either with aggregator or with pool","type":"object","properties":{"swaps":{"type":"array","items":{"$ref":"#/components/schemas/SwapActionSwap"}}}},"SwapActionSwap":{"title":"a single swap","type":"object","properties":{"tokenIn":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"},"tokenOut":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}},"ZapDetailsLiquidityAction":{"title":"added or removed liquidity","type":"object","properties":{"tokens":{"title":"added or removed token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}},"fees":{"title":"collected fees","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}},"token0":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"},"token1":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}},"ZapDetailsRefundAction":{"title":"refund left-over tokens to user","type":"object","properties":{"tokens":{"title":"refunded token amounts","type":"array","items":{"$ref":"#/components/schemas/ZapDetailsTokenAmount"}}}},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{"type":"object"}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kyberswap.com/developer-guide/zap-as-a-service-zaas-api/api-reference/zaas-http-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
