> ## 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.
# Add a new origin to an origin group
## OpenAPI
````yaml https://core-api-public-docs.b-cdn.net/docs/v3/public.json post /loadbalancer/{loadBalancerId}/origingroup/{originGroupId}/origin
openapi: 3.0.0
info:
title: bunny.net API
description: >-
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 storage API documentation
Third party API clients:
We currently do not maintain an official API library, but you can use one of the third party ones provided here:
https://github.com/codewithmark/bunnycdn (bunny.net PHP library, thanks to Code With Mark)
Note that third party clients are not maintained or developed by bunny.net so we unfortunately cannot offer support for them.
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: Pricing
- name: Load Balancer
- name: DNS Zone
- name: DNSSEC
- name: Billing
- name: API Keys
- name: Affiliate
- name: Countries
- name: Purge
- name: Region
paths:
/loadbalancer/{loadBalancerId}/origingroup/{originGroupId}/origin:
post:
tags:
- Load Balancer
summary: Add a new origin to an origin group
operationId: LoadBalancerOriginEndpoint_AddOrigin
parameters:
- name: loadBalancerId
in: path
required: true
schema:
type: integer
format: int64
x-position: 1
- name: originGroupId
in: path
required: true
schema:
type: integer
format: int64
x-position: 2
requestBody:
x-name: model
description: The model for the new origin
content:
application/json:
schema:
$ref: '#/components/schemas/LoadBalancerOriginCreateModel'
required: true
x-position: 3
responses:
'200':
description: The newly created origin
content:
application/json:
schema:
$ref: '#/components/schemas/LoadBalancerOriginModel'
'400':
description: The request was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorData'
'401':
description: The request authorization failed
'404':
description: The Load Balancer profile or origin group was not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorData'
'500':
description: Internal Server Error
security:
- AccessKey:
- User
- UserApi
- SubuserAPIPullZones
- SubuserPullZones
- SubuserManage
- SubuserAPIManage
- ScopedApiKey
- bearer:
- User
- UserApi
- SubuserAPIPullZones
- SubuserPullZones
- SubuserManage
- SubuserAPIManage
- ScopedApiKey
components:
schemas:
LoadBalancerOriginCreateModel:
type: object
additionalProperties: false
properties:
Name:
type: string
description: The name of the origin
nullable: true
Weight:
type: integer
description: The weight of the origin used for weighted load balancing
format: byte
nullable: true
Enabled:
type: boolean
description: Whether traffic should route to this origin
nullable: true
OriginType:
description: >-
The type of origin to connect to. Magic Container origins must be
CDN endpoints; Anycast endpoints are not supported, use a Standard
origin for those
0 = Standard
1 = Storage Zone
2 = Edge Script
3 = Magic Container
nullable: true
oneOf:
- $ref: '#/components/schemas/OriginType'
EdgeScriptId:
type: integer
description: >-
The ID of the Edge Script to use as the origin - required when using
the EdgeScript origin type
format: int64
nullable: true
StorageZoneId:
type: integer
description: >-
The ID of the Storage Zone to use as the origin - required when
using the Storage origin type
format: int64
nullable: true
StandardOrigin:
description: >-
Standard origin settings - required when using the Standard origin
type
nullable: true
oneOf:
- $ref: '#/components/schemas/StandardOriginModel'
MagicContainersOrigin:
description: >-
Magic Containers origin settings - required when using the Magic
Containers origin type
nullable: true
oneOf:
- $ref: '#/components/schemas/MagicContainersOriginModel'
LoadBalancerOriginModel:
type: object
additionalProperties: false
properties:
Id:
type: integer
description: The unique ID of the origin
format: int64
Name:
type: string
description: The name of the origin
nullable: true
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
0 = Healthy
1 = Degraded
oneOf:
- $ref: '#/components/schemas/HealthStatus'
OriginType:
description: >-
The type of origin to connect to. Magic Container origins must be
CDN endpoints; Anycast endpoints are not supported, use a Standard
origin for those
0 = Standard
1 = Storage Zone
2 = Edge Script
3 = Magic Container
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'
ApiErrorData:
type: object
additionalProperties: false
properties:
ErrorKey:
type: string
nullable: true
Field:
type: string
nullable: true
Message:
type: string
nullable: true
OriginType:
type: integer
description: |-
0 = Standard
1 = Storage Zone
2 = Edge Script
3 = Magic Container
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
HealthStatus:
type: integer
description: |-
0 = Healthy
1 = Degraded
x-enumNames:
- Healthy
- Degraded
enum:
- 0
- 1
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
````
This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.