> ## 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.

# Update an existing origin



## OpenAPI

````yaml https://core-api-public-docs.b-cdn.net/docs/v3/public.json post /loadbalancer/{loadBalancerId}/origingroup/{originGroupId}/origin/{originId}
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/{loadBalancerId}/origingroup/{originGroupId}/origin/{originId}:
    post:
      tags:
        - Load Balancer
      summary: Update an existing origin
      operationId: LoadBalancerOriginEndpoint_UpdateOrigin
      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
        - name: originId
          in: path
          required: true
          schema:
            type: integer
            format: int64
          x-position: 3
      requestBody:
        x-name: model
        description: The model for the origin update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadBalancerOriginCreateModel'
        required: true
        x-position: 4
      responses:
        '200':
          description: The updated 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, origin group, or origin was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorData'
        '500':
          description: Internal Server Error
      security:
        - AccessKey:
            - User
            - UserApi
            - SubuserAPIPullZones
            - SubuserPullZones
            - SubuserManage
            - SubuserAPIManage
        - bearer:
            - User
            - UserApi
            - SubuserAPIPullZones
            - SubuserPullZones
            - SubuserManage
            - SubuserAPIManage
components:
  schemas:
    LoadBalancerOriginCreateModel:
      type: object
      additionalProperties: false
      properties:
        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
          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
        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'
    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
        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
    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

````