---
title: "Build the proxy username, URL and code snippets for one connection"
method: POST
path: "/v1/traffic/build-url"
tags: ["traffic"]
---

# Build the proxy username, URL and code snippets for one connection

`POST /v1/traffic/build-url`

## Request

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

Pool, country, rotation and session are encoded in the username; the server validates them (an ISO 3166-1 alpha-2 country or `any`, the mobile pool only in its mobile countries, session names `[a-z0-9_]`). `rotation: sticky` keeps the same device for the session, and the carrier may still change its IP; without a `session` a stable name is derived for the account. `url` and `snippets` contain the real password and are only served to the owning organisation; `url_masked` is safe to show.

## Request body

- object
  - `pool` 'mobile' | 'residential' | 'best', required
  - `country` string, required
  - `rotation` 'auto5' | 'auto10' | 'auto20' | 'auto60' | 'ondemand' | 'sticky', required
  - `session` string
  - `protocol` 'http' | 'socks5'

## Response `200`

Default Response

- object
  - `host` string, required
  - `port` integer, required
  - `protocol` 'http' | 'socks5', required
  - `username` string, required
  - `session` string, nullable, required
  - `url` string, required
  - `url_masked` string, required
  - `snippets` object, required
    - `curl` string, required
    - `python` string, required
    - `node` string, required
    - `playwright` string, required

## Other responses

- `400`: Default Response
- `401`: Default Response
- `409`: 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)
