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

# Create a new Load Balancer profile



## OpenAPI

````yaml https://core-api-public-docs.b-cdn.net/docs/v3/public.json post /loadbalancer
openapi: 3.0.0
info:
  title: bunny.net API
  description: >-
    <img src='https://bunny.net/v2/images/bunnynet-logo-dark.svg' style='width:
    200px;' alt='bunny.net Logo'>
                   Learn how to use the [bunny.net](https://bunny.net "bunny.net - The content delivery platform that truly hops.") API. Everything that can be done with the control panel can also be achieved with our API documented on this page. To learn how to use the storage API, have a look at our <a href='https://bunnycdnstorage.docs.apiary.io/#'>storage API documentation</a>
                   <h2>Third party API clients:</h2> 
                   <br/>
                   We currently do not maintain an official API library, but you can use one of the third party ones provided here:<br/><br/>
                   <a rel='nofollow' href='https://github.com/codewithmark/bunnycdn'>https://github.com/codewithmark/bunnycdn</a> (bunny.net PHP library, thanks to <a rel="nofollow" href='https://codewithmark.com'>Code With Mark</a>)
                   <br/><br/>
                   <i style='font-size: 11px;'><b>Note that third party clients are not maintained or developed by bunny.net so we unfortunately cannot offer support for them.</b></i>
  termsOfService: https://bunny.net/tos
  contact:
    name: bunny.net
    url: https://docs.bunny.net
    email: support@bunny.net
  version: 1.0.0
servers:
  - url: https://api.bunny.net
    description: bunny.net API Server
security:
  - AccessKey: []
tags:
  - name: Stream Video Library
  - name: User
  - name: AuditLog
  - name: Storage Zone
  - name: Statistics
  - name: Search
  - name: Pull Zone
  - name: Load Balancer
  - name: DNS Zone
  - name: DNSSEC
  - name: Billing
  - name: API Keys
  - name: Affiliate
  - name: Countries
  - name: Purge
  - name: Region
paths:
  /loadbalancer:
    post:
      tags:
        - Load Balancer
      summary: Create a new Load Balancer profile
      operationId: LoadBalancerProfileEndpoint_CreateLoadBalancerProfile
      requestBody:
        x-name: model
        description: The model for the new Load Balancer profile
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadBalancerSettingsModel'
        required: true
        x-position: 1
      responses:
        '200':
          description: The newly created Load Balancer profile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoadBalancerProfileModel'
        '400':
          description: The request was invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorData'
        '401':
          description: The request authorization failed
        '500':
          description: Internal Server Error
      security:
        - AccessKey:
            - User
            - UserApi
            - SubuserAPIPullZones
            - SubuserPullZones
            - SubuserManage
            - SubuserAPIManage
        - bearer:
            - User
            - UserApi
            - SubuserAPIPullZones
            - SubuserPullZones
            - SubuserManage
            - SubuserAPIManage
components:
  schemas:
    LoadBalancerSettingsModel:
      type: object
      additionalProperties: false
      properties:
        Name:
          type: string
          description: The name of the Load Balancer profile
          nullable: true
        StickySessionType:
          description: The sticky session type to use for persisting client to an origin
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/LoadBalancerStickySessionType'
        OriginGroupLoadBalancingMethod:
          description: The load balancing method used for selecting origin groups
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/OriginGroupLoadBalancingMethod'
    LoadBalancerProfileModel:
      type: object
      additionalProperties: false
      properties:
        LoadBalancerId:
          type: integer
          description: The unique ID of the Load Balancer
          format: int64
        Name:
          type: string
          description: The name of the Load Balancer profile
          nullable: true
        OriginGroupLoadBalancingMethod:
          description: The load balancing method used for selecting origin groups
          oneOf:
            - $ref: '#/components/schemas/OriginGroupLoadBalancingMethod'
        StickySessionType:
          description: The sticky session type used for persisting client sessions
          oneOf:
            - $ref: '#/components/schemas/LoadBalancerStickySessionType'
        OriginGroups:
          type: array
          description: The list of origin groups associated with the Load Balancer profile
          nullable: true
          items:
            $ref: '#/components/schemas/LoadBalancerOriginGroupModel'
    ApiErrorData:
      type: object
      additionalProperties: false
      properties:
        ErrorKey:
          type: string
          nullable: true
        Field:
          type: string
          nullable: true
        Message:
          type: string
          nullable: true
    LoadBalancerStickySessionType:
      type: integer
      description: |-
        0 = Off
        1 = Cookie
      x-enumNames:
        - 'Off'
        - Cookie
      enum:
        - 0
        - 1
    OriginGroupLoadBalancingMethod:
      type: integer
      description: |-
        0 = WeightedRandom
        1 = RoundRobin
        2 = GeoLocation
        3 = LowestAverageLatency
      x-enumNames:
        - WeightedRandom
        - RoundRobin
        - GeoLocation
        - LowestAverageLatency
      enum:
        - 0
        - 1
        - 2
        - 3
    LoadBalancerOriginGroupModel:
      type: object
      additionalProperties: false
      properties:
        Id:
          type: integer
          description: The unique ID of the origin group
          format: int64
        Name:
          type: string
          description: The name of the origin group
          nullable: true
        Enabled:
          type: boolean
          description: Set to true if the origin group is enabled
        Latitude:
          type: number
          description: The latitude of the origin group location
          format: double
        Longitude:
          type: number
          description: The longitude of the origin group location
          format: double
        Weight:
          type: integer
          description: The weight of the origin group used for weighted load balancing
          format: byte
        Priority:
          type: integer
          description: The priority of the origin group used for failover load balancing
          format: byte
        OriginLoadBalancingMethod:
          description: >-
            The load balancing method used for selecting origins within the
            group
          oneOf:
            - $ref: '#/components/schemas/OriginLoadBalancingMethod'
        Origins:
          type: array
          description: The list of origins associated with the origin group
          nullable: true
          items:
            $ref: '#/components/schemas/LoadBalancerOriginModel'
        HealthCheckSettings:
          description: Health settings for the origin group
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/HealthCheckSettings'
    OriginLoadBalancingMethod:
      type: integer
      description: |-
        0 = RoundRobin
        1 = WeightedRandom
        2 = LeastConnections
        3 = Latency
      x-enumNames:
        - RoundRobin
        - WeightedRandom
        - LeastConnections
        - Latency
      enum:
        - 0
        - 1
        - 2
        - 3
    LoadBalancerOriginModel:
      type: object
      additionalProperties: false
      properties:
        Id:
          type: integer
          description: The unique ID of the origin
          format: int64
        Weight:
          type: integer
          description: The weight of the origin used for weighted load balancing
          format: int32
        Enabled:
          type: boolean
          description: Whether traffic should route to this origin
        HealthStatus:
          description: Current health status of the origin
          oneOf:
            - $ref: '#/components/schemas/HealthStatus'
        OriginType:
          description: The type of origin to connect to
          oneOf:
            - $ref: '#/components/schemas/OriginType'
        EdgeScriptId:
          type: integer
          description: The ID of the Edge Script when using this origin type
          format: int64
          nullable: true
        StorageZoneId:
          type: integer
          description: The ID of the Storage Zone when using this origin type
          format: int64
          nullable: true
        StandardOrigin:
          description: Standard Origin settings - Required with Standard origin type
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/StandardOriginModel'
        MagicContainersOrigin:
          description: >-
            Magic Containers Origin settings - Required with Magic Containers
            origin type
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/MagicContainersOriginModel'
    HealthCheckSettings:
      type: object
      additionalProperties: false
      properties:
        Enabled:
          type: boolean
          description: Whether health checking is enabled for this origin group
          nullable: true
        Path:
          type: string
          description: The path used for health check requests
          nullable: true
    HealthStatus:
      type: integer
      description: |-
        0 = Healthy
        1 = Degraded
      x-enumNames:
        - Healthy
        - Degraded
      enum:
        - 0
        - 1
    OriginType:
      type: integer
      description: |-
        0 = Standard
        1 = Storage
        2 = EdgeScript
        3 = MagicContainer
      x-enumNames:
        - Standard
        - Storage
        - EdgeScript
        - MagicContainer
      enum:
        - 0
        - 1
        - 2
        - 3
    StandardOriginModel:
      type: object
      additionalProperties: false
      properties:
        OriginUrl:
          type: string
          description: The URL of the origin server
          nullable: true
        HostHeader:
          type: string
          description: The host header to send to the origin server
          nullable: true
        VerifySsl:
          type: boolean
          description: Whether to verify the SSL certificate of the origin server
          nullable: true
    MagicContainersOriginModel:
      type: object
      additionalProperties: false
      properties:
        AppId:
          type: string
          description: The ID of the Magic Containers app
          nullable: true
        EndPointId:
          type: string
          description: >-
            The ID of the Magic Containers CDN endpoint. Anycast endpoints are
            not supported, add those as a Standard origin using their IP address
            and port
          nullable: true
  securitySchemes:
    AccessKey:
      type: apiKey
      description: API Access Key authorization header
      name: AccessKey
      in: header
    bearer:
      type: apiKey
      description: Bearer token authorization header
      name: Authorization
      in: header

````