> ## Documentation Index
> Fetch the complete documentation index at: https://developers.soax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get connection strings

> Build ready-to-use proxy connection strings for a package, with targeting and session rules encoded for you. The returned credentials are used against the proxy gateway (`proxy.soax.com:1337`) — not against this API.

Location parameters are validated against what the package can actually target: an unavailable country, region, city, ISP, ASN, or ZIP returns 400. `region`, `city`, `isp`, `asn`, and `zip` all require `country` to be set.

Rotation and error handling: `rotate-time` and `rotate-requests` are mutually exclusive; `on-error=retry` requires `retries`, and `retries` is only valid with `on-error=retry`; `bind=node` is incompatible with `prefer=lookalike` and `on-error=replace`. When any rotation/error/bind rule is used (or `count` > 1) and no `session` is given, a session ID is generated automatically; with `count` > 1 the session IDs are numbered so each connection string gets its own IP.

For packages using IP allowlist authentication, rules are encoded in the hostname (HTTPS only), `username` is empty, and `password` is `null`.

Requires the `proxy:packages:read` scope.



## OpenAPI

````yaml api/openapi.json GET /v1/proxy/packages/{package_id}/connection-string
openapi: 3.1.0
info:
  title: SOAX API
  version: v1
  description: >-
    Programmatic access to your SOAX account: manage proxy packages, generate
    connection strings, browse available locations, pull usage analytics, and
    manage API keys. All endpoints are served over HTTPS and return JSON.
servers:
  - url: https://api.platform.soax.com
security:
  - bearerAuth: []
tags:
  - name: API Keys
    description: >-
      Self-service management of the API keys used to authenticate with this
      API.
  - name: Packages
    description: >-
      Read proxy packages, build proxy connection strings, and rotate package
      passwords.
  - name: Locations
    description: >-
      Location reference data: tiers, countries, regions, cities, ISPs, ASNs,
      and ZIP codes.
  - name: Account
    description: Read-only account, credit, and subscription information.
  - name: Analytics
    description: Usage analytics for your proxy packages.
paths:
  /v1/proxy/packages/{package_id}/connection-string:
    get:
      tags:
        - Packages
      summary: Get proxy connection strings
      description: >-
        Build ready-to-use proxy connection strings for a package, with
        targeting and session rules encoded for you. The returned credentials
        are used against the proxy gateway (`proxy.soax.com:1337`) — not against
        this API.


        Location parameters are validated against what the package can actually
        target: an unavailable country, region, city, ISP, ASN, or ZIP returns
        400. `region`, `city`, `isp`, `asn`, and `zip` all require `country` to
        be set.


        Rotation and error handling: `rotate-time` and `rotate-requests` are
        mutually exclusive; `on-error=retry` requires `retries`, and `retries`
        is only valid with `on-error=retry`; `bind=node` is incompatible with
        `prefer=lookalike` and `on-error=replace`. When any rotation/error/bind
        rule is used (or `count` > 1) and no `session` is given, a session ID is
        generated automatically; with `count` > 1 the session IDs are numbered
        so each connection string gets its own IP.


        For packages using IP allowlist authentication, rules are encoded in the
        hostname (HTTPS only), `username` is empty, and `password` is `null`.


        Requires the `proxy:packages:read` scope.
      operationId: >-
        get_package_connection_string_v1_proxy_packages__package_id__connection_string_get
      parameters:
        - name: package_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            description: The ID of the proxy package (UUID format)
            title: Package Id
          description: The ID of the proxy package (UUID format)
        - name: protocol
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - https
                  - http
                  - socks5
              - type: 'null'
            title: Protocol
            description: >-
              Protocol to build the string for. Must be enabled on the package;
              IP-auth packages support `https` only. If omitted, the `uri` is
              returned without a scheme prefix.
          description: >-
            Protocol to build the string for. Must be enabled on the package;
            IP-auth packages support `https` only. If omitted, the `uri` is
            returned without a scheme prefix.
        - name: count
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Count
            description: >-
              Number of connection strings to return (1–1000). Each gets a
              numbered session ID so it maps to a distinct IP.
            maximum: 1000
          description: >-
            Number of connection strings to return (1–1000). Each gets a
            numbered session ID so it maps to a distinct IP.
        - name: network
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - residential
                  - mobile
                  - any
              - type: 'null'
            title: Network
            description: Restrict to a network type.
          description: Restrict to a network type.
        - name: country
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Country
            description: >-
              Two-letter ISO country code to target (e.g. `us`). Required when
              `region`, `city`, `isp`, `asn`, or `zip` is set.
          description: >-
            Two-letter ISO country code to target (e.g. `us`). Required when
            `region`, `city`, `isp`, `asn`, or `zip` is set.
        - name: region
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Region
            description: >-
              Region to target. Use codes from the package regions endpoint.
              Requires `country`.
          description: >-
            Region to target. Use codes from the package regions endpoint.
            Requires `country`.
        - name: city
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: City
            description: >-
              City to target. Use codes from the package cities endpoint.
              Requires `country`.
          description: >-
            City to target. Use codes from the package cities endpoint. Requires
            `country`.
        - name: isp
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Isp
            description: >-
              ISP to target. Use codes from the package ISPs endpoint. Requires
              `country`.
          description: >-
            ISP to target. Use codes from the package ISPs endpoint. Requires
            `country`.
        - name: asn
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Asn
            description: >-
              ASN to target (e.g. `AS7922`). Requires `country` and the ASN
              targeting feature on your plan.
          description: >-
            ASN to target (e.g. `AS7922`). Requires `country` and the ASN
            targeting feature on your plan.
        - name: zip
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Zip
            description: >-
              ZIP/postal code to target. Requires `country` and the ZIP
              targeting feature on your plan.
          description: >-
            ZIP/postal code to target. Requires `country` and the ZIP targeting
            feature on your plan.
        - name: prefer
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - lookalike
              - type: 'null'
            title: Prefer
            description: >-
              Routing preference. `lookalike` prefers replacement nodes with
              similar characteristics (same region/ISP) when a node is rotated
              or replaced.
          description: >-
            Routing preference. `lookalike` prefers replacement nodes with
            similar characteristics (same region/ISP) when a node is rotated or
            replaced.
        - name: rotate-time
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Rotate-Time
            description: >-
              Rotate to a new IP after this many seconds. Mutually exclusive
              with `rotate-requests`.
          description: >-
            Rotate to a new IP after this many seconds. Mutually exclusive with
            `rotate-requests`.
        - name: rotate-requests
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Rotate-Requests
            description: >-
              Rotate to a new IP after this many requests. Mutually exclusive
              with `rotate-time`.
          description: >-
            Rotate to a new IP after this many requests. Mutually exclusive with
            `rotate-time`.
        - name: on-error
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - replace
                  - fail
                  - retry
              - type: 'null'
            title: On-Error
            description: >-
              What to do when the current node fails: `replace` picks a new node
              (default behavior), `retry` retries the same node (`retries`
              required), `fail` returns the error to your client.
          description: >-
            What to do when the current node fails: `replace` picks a new node
            (default behavior), `retry` retries the same node (`retries`
            required), `fail` returns the error to your client.
        - name: retries
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Retries
            description: >-
              Number of retry attempts on the same node before replacement. Only
              valid with `on-error=retry`.
          description: >-
            Number of retry attempts on the same node before replacement. Only
            valid with `on-error=retry`.
        - name: session
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                pattern: ^[a-z0-9]{1,16}$
              - type: 'null'
            title: Session
            description: >-
              Custom session ID: lowercase letters and digits, up to 16
              characters. Requests sharing a session ID keep the same IP. If
              omitted, a session ID is generated automatically when rotation,
              error handling, `bind`, or `count` > 1 requires one.
          description: >-
            Custom session ID: lowercase letters and digits, up to 16
            characters. Requests sharing a session ID keep the same IP. If
            omitted, a session ID is generated automatically when rotation,
            error handling, `bind`, or `count` > 1 requires one.
        - name: bind
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - node
              - type: 'null'
            title: Bind
            description: >-
              `node` locks the session to a single node: if the node fails,
              requests fail instead of being moved to a new IP. Incompatible
              with `prefer=lookalike` and `on-error=replace`.
          description: >-
            `node` locks the session to a single node: if the node fails,
            requests fail instead of being moved to a new IP. Incompatible with
            `prefer=lookalike` and `on-error=replace`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProxyConnectionStringResponse'
                title: >-
                  Response Get Package Connection String V1 Proxy Packages 
                  Package Id  Connection String Get
              example:
                - uri: >-
                    http://country-us-session-k3j9d8f2:aB3dE5fG7h@proxy.soax.com:1337
                  username: country-us-session-k3j9d8f2
                  password: aB3dE5fG7h
                  host: proxy.soax.com
                  port: 1337
        '400':
          description: >-
            A parameter value or combination is invalid. Service-level
            validation errors use the `error` key; endpoint-level checks use
            `detail`. Read `detail ?? error`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  error:
                    type: string
              example:
                error: >-
                  Cannot specify both 'rotate-time' and 'rotate-requests'
                  simultaneously.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenScope'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    ProxyConnectionStringResponse:
      properties:
        uri:
          type: string
          title: Uri
        username:
          type: string
          title: Username
        password:
          anyOf:
            - type: string
            - type: 'null'
          title: Password
        host:
          type: string
          title: Host
        port:
          type: integer
          title: Port
      type: object
      required:
        - uri
        - username
        - host
        - port
      title: ProxyConnectionStringResponse
      description: Response model for a single proxy connection string in v1 API.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
          example:
            detail: Invalid API key
    ForbiddenScope:
      description: The API key does not carry the scope this endpoint requires.
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
          example:
            detail: 'Missing required scope: proxy:packages:read'
    NotFound:
      description: >-
        The resource does not exist, belongs to another organization, or is
        outside the API key's package restriction.
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
          example:
            detail: Package not found
    RateLimited:
      description: >-
        Rate limit exceeded (5 requests/second per API key, 500 requests/minute
        per IP). The response includes `Retry-After` (seconds),
        `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` (Unix
        time) headers — wait `Retry-After` seconds and retry.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
          example:
            error: 'Rate limit exceeded: 5 per 1 second'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key secret (starts with `s_live_`). Create keys in the dashboard
        under **Settings → API keys**, or via `POST /v1/api-keys/`. Send it as
        `Authorization: Bearer <secret>`.

````