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

# Create a new session

> Creates a new session in the specified zone with the requested connection type



## OpenAPI

````yaml swagger.json post /sessions
openapi: 3.0.1
info:
  title: VPN-as-a-Service API
  description: API for managing VPN zones and sessions
  version: '1.0'
servers:
  - url: https://api.pingnetwork.io/customer/v2
security:
  - ApiKeyAuth: []
paths:
  /sessions:
    post:
      tags:
        - Sessions
      summary: Create a new session
      description: >-
        Creates a new session in the specified zone with the requested
        connection type
      requestBody:
        description: Session creation request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sessions.CreateSessionRequest'
        required: true
      responses:
        '201':
          description: Session created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sessions.SessionResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '404':
          description: Zone not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
components:
  schemas:
    sessions.CreateSessionRequest:
      required:
        - client_id
        - connection_type
        - zone
      type: object
      properties:
        client_id:
          type: string
          description: Client identifier
        connection_type:
          $ref: '#/components/schemas/connection.Type'
        zone:
          type: string
          description: Zone code (matching the 'code' field from the /zones endpoint)
        reusable:
          type: boolean
          description: Whether the session can be reused for multiple connections
    sessions.SessionResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique session identifier
        connection_type:
          $ref: '#/components/schemas/connection.Type'
        zone:
          type: string
        configuration:
          type: object
          properties: {}
          description: Connection configuration details
        configuration_link:
          type: string
          description: VLESS configuration link
        reusable:
          type: boolean
          description: Whether the session can be reused for multiple connections
        created_at:
          type: string
          format: date-time
    errors.ErrorResponse:
      required:
        - error
      type: object
      properties:
        error:
          required:
            - code
            - message
          type: object
          properties:
            code:
              type: string
              description: Unique error code identifier
            message:
              type: string
              description: Human-readable error message
            details:
              type: object
              properties: {}
              description: Additional error context
    connection.Type:
      type: string
      enum:
        - vless
      x-enum-varnames:
        - VLESS
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header

````