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

# Create load balancer listener



## OpenAPI

````yaml /api-reference/services_docs_mintlify/cloud_api.yaml post /cloud/v1/lblisteners/{project_id}/{region_id}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Cloud API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: 5ef57c94b74e
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Bare Metal
  - name: Container as a Service
  - name: Cost Reports
  - name: DDoS Protection
  - name: Everywhere Inference
  - name: Everywhere Inference Apps
  - name: File Shares
  - name: Floating IPs
  - name: Function as a Service
  - name: GPU Bare Metal
  - name: GPU Virtual
  - name: IP Ranges
  - name: Images
  - name: Instances
  - name: Load Balancers
  - name: Logging
  - name: Managed Kubernetes
  - name: Managed PostgreSQL
  - name: Networks
  - name: Placement Groups
  - name: Ports
  - name: Projects
  - name: Quotas
  - name: Regions
  - name: Registry
  - name: Reservations
  - name: Reserved IPs
  - name: Routers
  - name: SSH Keys
  - name: Secrets
  - name: Security Groups
  - name: Snapshot Schedules
  - name: Snapshots
  - name: Tasks
  - name: User Actions
  - name: User Role Assignments
  - name: Volumes
paths:
  /cloud/v1/lblisteners/{project_id}/{region_id}:
    post:
      tags:
        - Load Balancers
      summary: Create load balancer listener
      operationId: LoadBalancerListenerViewSet.post
      parameters:
        - in: path
          name: project_id
          required: true
          description: Project ID
          schema:
            description: Project ID
            example: 1
            examples:
              - 1
            title: Project Id
            type: integer
        - in: path
          name: region_id
          required: true
          description: Region ID
          schema:
            description: Region ID
            example: 1
            examples:
              - 1
            exclusiveMinimum: 0
            title: Region Id
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLbListenerSerializer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskIDsSerializer'
components:
  schemas:
    CreateLbListenerSerializer:
      properties:
        allowed_cidrs:
          anyOf:
            - items:
                format: ipvanynetwork
                type: string
              maxItems: 100
              type: array
            - type: 'null'
          description: >-
            Network CIDRs from which service will be accessible.
            Order-insensitive.
          examples:
            - - 10.0.0.0/8
          title: Allowed Cidrs
        connection_limit:
          default: 100000
          description: >-
            Limit of the simultaneous connections. If -1 is provided, it is
            translated to the default value 100000.
          example: 100000
          examples:
            - 100000
          maximum: 1000000
          minimum: -1
          title: Connection Limit
          type: integer
        default_pool_id:
          description: ID of already existent Load Balancer Pool to attach listener to.
          example: 00000000-0000-4000-8000-000000000000
          examples:
            - 00000000-0000-4000-8000-000000000000
          format: uuid4
          title: Default Pool Id
          type: string
        insert_x_forwarded:
          description: >-
            Add headers X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto to
            requests. Only used with HTTP or `TERMINATED_HTTPS` protocols.
          example: false
          examples:
            - false
          title: Insert X Forwarded
          type: boolean
        load_balancer_id:
          description: ID of already existent Load Balancer.
          example: 30f4f55b-4a7c-48e0-9954-5cddfee216e7
          examples:
            - 30f4f55b-4a7c-48e0-9954-5cddfee216e7
          format: uuid4
          title: Load Balancer Id
          type: string
        name:
          description: Load balancer listener name
          example: my_listener
          examples:
            - my_listener
          pattern: ^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$
          title: Name
          type: string
        protocol:
          $ref: '#/components/schemas/LbListenerProtocolEnum'
          description: Load balancer listener protocol
          examples:
            - HTTP
        protocol_port:
          description: Protocol port
          example: 80
          examples:
            - 80
          maximum: 65535
          minimum: 1
          title: Protocol Port
          type: integer
        secret_id:
          anyOf:
            - const: ''
              type: string
            - format: uuid4
              type: string
          description: >-
            ID of the secret where PKCS12 file is stored for `TERMINATED_HTTPS`
            or PROMETHEUS listener
          examples:
            - f2e734d0-fa2b-42c2-ad33-4c6db5101e00
          title: Secret Id
        sni_secret_id:
          description: >-
            List of secrets IDs containing PKCS12 format certificate/key bundles
            for `TERMINATED_HTTPS` or PROMETHEUS listeners
          example:
            - f2e734d0-fa2b-42c2-ad33-4c6db5101e00
            - eb121225-7ded-4ff3-ae1f-599e145dd7cb
          examples:
            - - f2e734d0-fa2b-42c2-ad33-4c6db5101e00
              - eb121225-7ded-4ff3-ae1f-599e145dd7cb
          items:
            format: uuid4
            type: string
          title: Sni Secret Id
          type: array
        timeout_client_data:
          anyOf:
            - maximum: 86400000
              minimum: 0
              type: integer
            - type: 'null'
          description: Frontend client inactivity timeout in milliseconds
          examples:
            - 50000
          title: Timeout Client Data
        timeout_member_connect:
          anyOf:
            - maximum: 86400000
              minimum: 0
              type: integer
            - type: 'null'
          deprecated: true
          description: >-
            Backend member connection timeout in milliseconds. We are
            recommending to use `pool.timeout_member_connect` instead.
          examples:
            - 50000
          title: Timeout Member Connect
        timeout_member_data:
          anyOf:
            - maximum: 86400000
              minimum: 0
              type: integer
            - type: 'null'
          deprecated: true
          description: >-
            Backend member inactivity timeout in milliseconds. We are
            recommending to use `pool.timeout_member_data` instead.
          examples:
            - null
          title: Timeout Member Data
        user_list:
          description: Load balancer listener list of username and encrypted password items
          example:
            - encrypted_password: $5$isRr.HJ1IrQP38.m$oViu3DJOpUG2ZsjCBtbITV3mqpxxbZfyWJojLPNSPO5
              username: admin
          examples:
            - - encrypted_password: >-
                  $5$isRr.HJ1IrQP38.m$oViu3DJOpUG2ZsjCBtbITV3mqpxxbZfyWJojLPNSPO5
                username: admin
          items:
            $ref: '#/components/schemas/UserListItem'
          maxItems: 3
          title: User List
          type: array
      required:
        - name
        - protocol
        - protocol_port
        - load_balancer_id
      title: CreateLbListenerSerializer
      type: object
    TaskIDsSerializer:
      properties:
        tasks:
          description: >-
            List of task IDs representing asynchronous operations. Use these IDs
            to monitor operation progress:

            - `GET /v1/tasks/{task_id}` - Check individual task status and
            details

            Poll task status until completion (`FINISHED`/`ERROR`) before
            proceeding with dependent operations.
          example:
            - d478ae29-dedc-4869-82f0-96104425f565
          examples:
            - - d478ae29-dedc-4869-82f0-96104425f565
          items:
            type: string
          title: Tasks
          type: array
      required:
        - tasks
      title: TaskIDsSerializer
      type: object
    LbListenerProtocolEnum:
      enum:
        - HTTP
        - HTTPS
        - PROMETHEUS
        - TCP
        - TERMINATED_HTTPS
        - UDP
      title: LbListenerProtocolEnum
      type: string
    UserListItem:
      properties:
        encrypted_password:
          description: Encrypted password to auth via Basic Authentication
          example: $5$isRr.HJ1IrQP38.m$oViu3DJOpUG2ZsjCBtbITV3mqpxxbZfyWJojLPNSPO5
          examples:
            - $5$isRr.HJ1IrQP38.m$oViu3DJOpUG2ZsjCBtbITV3mqpxxbZfyWJojLPNSPO5
          maxLength: 128
          title: Encrypted Password
          type: string
        username:
          description: Username to auth via Basic Authentication
          example: admin
          examples:
            - admin
          maxLength: 32
          pattern: ^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,30}[a-zA-Z0-9._]$
          title: Username
          type: string
      required:
        - username
        - encrypted_password
      title: UserListItem
      type: object
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````