---
title: "Test a connection through the gateway (6 per minute)"
method: POST
path: "/v1/traffic/test"
tags: ["traffic"]
---

# Test a connection through the gateway (6 per minute)

`POST /v1/traffic/test`

## Request

- Base URL: `https://api.portproof.org`
- URL: `https://api.portproof.org/v1/traffic/test`
- Auth: one of:
  - API key in cookie `pp_session`
  - HTTP bearer

The server sends one request through the gateway to its own echo endpoint (10 s timeout) and reports whether it connected, the exit address it saw and the latency. `exit_country` is a country observed for that exit address, never the requested one: when none was observed it is null and `country_verified` is false, so look the exit address up yourself before relying on the country. `ok: false` carries the gateway `error_code` (for example `E_NO_STOCK_COUNTRY`, `E_CAP_EXCEEDED`, `timeout`). The test uses a few kilobytes of the balance. In development with the mock upstream the result is simulated (`simulated: true`).

## Request body

- object
  - `pool` 'mobile' | 'residential' | 'best'
  - `country` string
  - `rotation` 'auto5' | 'auto10' | 'auto20' | 'auto60' | 'ondemand' | 'sticky'

## Response `200`

Default Response

- object
  - `ok` boolean, required
  - `exit_country` string, nullable, required
  - `country_verified` boolean, required
  - `exit_ip` string, nullable, required
  - `latency_ms` integer, nullable, required
  - `error_code` string
  - `simulated` boolean

## Other responses

- `400`: Default Response
- `401`: Default Response
- `409`: Default Response
- `429`: Default Response

---

[API](https://skmtc.dev/portproof/apis/portproof-api.md) · [All operations](https://skmtc.dev/portproof/apis/portproof-api/llms.txt) · [OpenAPI document](https://skmtc.dev/portproof/apis/portproof-api/revisions/4143916c0fac?raw)
