Skip to main content

Session API

The Session API is the core NexaLayer surface. Send Idempotency-Key on write operations.

Create a session

For dynamic sessions, quantity means GB and can be fractional. For static sessions, quantity means IP count and must be an integer. Always read the current price from /public/products or /products immediately before purchase. Confirm product_no against GET https://api.nexalayer.net/v1/public/products. Examples use dynamic_2, which was in the live catalog on 2026-11-29; inventory can change. If the supplier price changed since that read, create returns HTTP 409 PRICE_MISMATCH. No order is placed. Read prices again and retry with the new quote and a new Idempotency-Key. POST /sessions does not accept include_credentials; the accepted response is status=creating and does not include proxy credentials. A static session may include:

Get a session

include_credentials is a query parameter and defaults to false. When the session is active, host, port, and protocol are returned either way. proxy.username, proxy.password, and proxy.full_url are omitted unless include_credentials=true. The JSON body is not used for this flag. Request credentials only in the process that will connect, and do not log them.

Rotate a dynamic session

Rotate reads include_credentials from the query string, not the JSON body. The default is false, which omits proxy.username, proxy.password, and proxy.full_url from the rotated session. Supported reasons:

Renew a static session

Renew does not accept include_credentials. When the renewed session is active, the response includes proxy credentials.

Terminate a session

Every automation workflow should terminate sessions it no longer needs. Early termination releases the underlying resource; session management is free for now, and static resources are not automatically refunded by default.