---
title: "Add a new origin to an origin group"
method: POST
path: "/loadbalancer/{loadBalancerId}/origingroup/{originGroupId}/origin"
tags: ["Load Balancer"]
---

# Add a new origin to an origin group

`POST /loadbalancer/{loadBalancerId}/origingroup/{originGroupId}/origin`

## Request

- Base URL: `https://api.bunny.net`
- URL: `https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{originGroupId}/origin`
- Auth: one of:
  - API key in header `AccessKey`
  - API key in header `Authorization`

## Path parameters

- `loadBalancerId` integer, required
- `originGroupId` integer, required

## Request body

- LoadBalancerOriginCreateModel
  - `Name` string, nullable: The name of the origin
  - `Weight` integer, nullable: The weight of the origin used for weighted load balancing
  - `Enabled` boolean, nullable: Whether traffic should route to this origin
  - `OriginType` 0 | 1 | 2 | 3: 0 = Standard 1 = Storage Zone 2 = Edge Script 3 = Magic Container
  - `EdgeScriptId` integer, nullable: The ID of the Edge Script to use as the origin - required when using the EdgeScript origin type
  - `StorageZoneId` integer, nullable: The ID of the Storage Zone to use as the origin - required when using the Storage origin type
  - `StandardOrigin` StandardOriginModel
    - `OriginUrl` string, nullable: The URL of the origin server
    - `HostHeader` string, nullable: The host header to send to the origin server
    - `VerifySsl` boolean, nullable: Whether to verify the SSL certificate of the origin server
  - `MagicContainersOrigin` MagicContainersOriginModel
    - `AppId` string, nullable: The ID of the Magic Containers app
    - `EndPointId` string, nullable: 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

## Response `200`

The newly created origin

- LoadBalancerOriginModel
  - `Id` integer: The unique ID of the origin
  - `Name` string, nullable: The name of the origin
  - `Weight` integer: The weight of the origin used for weighted load balancing
  - `Enabled` boolean: Whether traffic should route to this origin
  - `HealthStatus` 0 | 1: 0 = Healthy 1 = Degraded
  - `OriginType` 0 | 1 | 2 | 3: 0 = Standard 1 = Storage Zone 2 = Edge Script 3 = Magic Container
  - `EdgeScriptId` integer, nullable: The ID of the Edge Script when using this origin type
  - `StorageZoneId` integer, nullable: The ID of the Storage Zone when using this origin type
  - `StandardOrigin` StandardOriginModel
    - `OriginUrl` string, nullable: The URL of the origin server
    - `HostHeader` string, nullable: The host header to send to the origin server
    - `VerifySsl` boolean, nullable: Whether to verify the SSL certificate of the origin server
  - `MagicContainersOrigin` MagicContainersOriginModel
    - `AppId` string, nullable: The ID of the Magic Containers app
    - `EndPointId` string, nullable: 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

## Other responses

- `400`: The request was invalid
- `401`: The request authorization failed
- `404`: The Load Balancer profile or origin group was not found
- `500`: Internal Server Error

## Changes

- **2026-11-12** `2b06f94dbfbf`: 2 info
  - the security scope `ScopedApiKey` was added to the endpoint's security scheme `AccessKey`
  - the security scope `ScopedApiKey` was added to the endpoint's security scheme `bearer`
- **2026-10-27** `2096a6606d8d`: 2 info
  - added the new optional request property `Name`
  - added the optional property `Name` to the response with the `200` status
- **2026-08-07** `205129a7ebd5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bunny/apis/bunny-net-api/changes/loadbalancer/:loadBalancerId/origingroup/:originGroupId/origin/post.md)

---

[API](https://skmtc.dev/bunny/apis/bunny-net-api.md) - [All operations](https://skmtc.dev/bunny/apis/bunny-net-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/bunny-net-api/revisions/2b06f94dbfbf?raw)
