---
title: "Create origin group"
method: POST
path: "/cdn/origin_groups"
tags: ["Origins"]
---

# Create origin group

`POST /cdn/origin_groups`

Create an origin group with one or more origin sources.

## Request body

- union
  - object — Create an origin group with host origins, or mixed host and S3 origins.
    - `name` string, required — Origin group name.
    - `use_next` boolean — Defines whether to use the next origin from the origin group if origin responds with the cases specified in `proxy_next_upstream`. If you enable it, you must specify cases in `proxy_next_upstream`. Possible values: - **true** - Option is enabled. - **false** - Option is disabled.
    - `proxy_next_upstream` string[] — Defines cases when the request should be passed on to the next origin. Possible values: - **error** - an error occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **timeout** - a timeout has occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **`invalid_header`** - a origin returned an empty or invalid response - **`http_403`** - a origin returned a response with the code 403 - **`http_404`** - a origin returned a response with the code 404 - **`http_429`** - a origin returned a response with the code 429 - **`http_500`** - a origin returned a response with the code 500 - **`http_502`** - a origin returned a response with the code 502 - **`http_503`** - a origin returned a response with the code 503 - **`http_504`** - a origin returned a response with the code 504
    - `auth_type` string — **Deprecated.** No longer necessary. Defaults to `none`. Origin authentication type. Possible values: - **none** - Used for public origins. - **awsSignatureV4** - Used for S3 storage.
    - `sources` ChangeSource[], required
      - union
        - ChangeHostSource
          - `source` string, required — IP address or domain name of the origin and the port, if custom port is used.
          - `backup` boolean — Defines whether the origin is a backup, meaning that it will not be used until one of active origins become unavailable. Possible values: - **true** - Origin is a backup. - **false** - Origin is not a backup.
          - `enabled` boolean — Enables or disables an origin source in the origin group. Possible values: - **true** - Origin is enabled and the CDN uses it to pull content. - **false** - Origin is disabled and the CDN does not use it to pull content. Origin group must contain at least one enabled origin.
          - `tag` string — Tag for the origin source.
          - `host_header_override` string, nullable — Per-origin Host header override. When set, the CDN sends this value as the Host header when requesting content from this origin instead of the default.
        - ChangeS3Source
          - `origin_type` 'host' | 's3' | 'fastedge' — Origin type. Present in responses for S3 and FastEdge sources. Possible values: - **host** - A source server or endpoint from which content is fetched. - **s3** - S3 storage with either AWS v4 authentication or public access. - **fastedge** - A FastEdge application served directly from the local FastEdge runtime on the edge node, identified by `app_id`.
          - `config` S3Config, required — S3 storage configuration. Required when `origin_type` is `s3`.
            - `s3_type` 'amazon' | 'other', required — Storage type compatible with S3. Possible values: - **amazon** - AWS S3 storage. - **other** - Other (not AWS) S3 compatible storage.
            - `s3_bucket_name` string, required — S3 bucket name.
            - `s3_region` string, nullable — S3 storage region. The parameter is required if `s3_type` is `amazon`.
            - `s3_storage_hostname` string, nullable — S3 storage hostname. The parameter is required if `s3_type` is `other`.
            - `s3_access_key_id` string, required — Access key ID for the S3 account. Masked as `SECRET_VALUE` in responses. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore. - From 4 to 255 characters.
            - `s3_secret_access_key` string, required — Secret access key for the S3 account. Masked as `SECRET_VALUE` in responses. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and underscores. - From 16 to 255 characters.
            - `s3_auth_type` string — S3 authentication type.
          - `backup` boolean — Defines whether the origin is a backup, meaning that it will not be used until one of active origins become unavailable. Possible values: - **true** - Origin is a backup. - **false** - Origin is not a backup.
          - `enabled` boolean — Enables or disables an origin source in the origin group. Possible values: - **true** - Origin is enabled and the CDN uses it to pull content. - **false** - Origin is disabled and the CDN does not use it to pull content. Origin group must contain at least one enabled origin.
          - `tag` string — Tag for the origin source.
          - `host_header_override` string, nullable — Per-origin Host header override. When set, the CDN sends this value as the Host header when requesting content from this origin instead of the default.
        - ChangeFastedgeSource
          - `origin_type` 'host' | 's3' | 'fastedge', required — Origin type. Present in responses for S3 and FastEdge sources. Possible values: - **host** - A source server or endpoint from which content is fetched. - **s3** - S3 storage with either AWS v4 authentication or public access. - **fastedge** - A FastEdge application served directly from the local FastEdge runtime on the edge node, identified by `app_id`.
          - `config` FastedgeConfig, required — FastEdge application configuration. Required when `origin_type` is `fastedge`.
            - `app_id` string, required — ID of the FastEdge application served as origin (string, matching the existing fastedge option's convention). The CDN dispatches requests to the local FastEdge runtime on the edge node using this identifier. The application must belong to the requesting client, be enabled, and have `wasi-http` API type.
          - `backup` boolean — Defines whether the origin is a backup, meaning that it will not be used until one of active origins become unavailable. Possible values: - **true** - Origin is a backup. - **false** - Origin is not a backup.
          - `enabled` boolean — Enables or disables an origin source in the origin group. Possible values: - **true** - Origin is enabled and the CDN uses it to pull content. - **false** - Origin is disabled and the CDN does not use it to pull content. Origin group must contain at least one enabled origin.
          - `tag` string — Tag for the origin source.
          - `host_header_override` string, nullable — Per-origin Host header override. When set, the CDN sends this value as the Host header when requesting content from this origin instead of the default.
  - object — **Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.
    - `name` string, required — Origin group name.
    - `use_next` boolean — Defines whether to use the next origin from the origin group if origin responds with the cases specified in `proxy_next_upstream`. If you enable it, you must specify cases in `proxy_next_upstream`. Possible values: - **true** - Option is enabled. - **false** - Option is disabled.
    - `proxy_next_upstream` string[] — Defines cases when the request should be passed on to the next origin. Possible values: - **error** - an error occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **timeout** - a timeout has occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **`invalid_header`** - a origin returned an empty or invalid response - **`http_403`** - a origin returned a response with the code 403 - **`http_404`** - a origin returned a response with the code 404 - **`http_429`** - a origin returned a response with the code 429 - **`http_500`** - a origin returned a response with the code 500 - **`http_502`** - a origin returned a response with the code 502 - **`http_503`** - a origin returned a response with the code 503 - **`http_504`** - a origin returned a response with the code 504
    - `auth_type` string, required — **Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead. Authentication type. **awsSignatureV4** value is used for S3 storage.
    - `auth` Auth, required — **Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead. Credentials to access the private bucket.
      - `s3_type` string, required — Storage type compatible with S3. Possible values: - **amazon** – AWS S3 storage. - **other** – Other (not AWS) S3 compatible storage.
      - `s3_access_key_id` string, required — Access key ID for the S3 account. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore. - From 3 to 512 characters.
      - `s3_secret_access_key` string, required — Secret access key for the S3 account. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and underscores. - If "s3_type": amazon, length should be 40 characters. - If "s3_type": other, length should be from 16 to 255 characters.
      - `s3_bucket_name` string, required — S3 bucket name.
      - `s3_storage_hostname` string — S3 storage hostname. The parameter is required, if "s3_type": other.
      - `s3_region` string — S3 storage region. The parameter is required, if "s3_type": amazon.

## Response `201`

Successful.

- union
  - object — Origin group with host origins, or mixed host and S3 origins using inline `origin_type` and `config` in sources.
    - `id` integer, required — Origin group ID.
    - `name` string, required — Origin group name.
    - `use_next` boolean — Defines whether to use the next origin from the origin group if origin responds with the cases specified in `proxy_next_upstream`. If you enable it, you must specify cases in `proxy_next_upstream`. Possible values: - **true** - Option is enabled. - **false** - Option is disabled.
    - `proxy_next_upstream` string[] — Defines cases when the request should be passed on to the next origin. Possible values: - **error** - an error occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **timeout** - a timeout has occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **`invalid_header`** - a origin returned an empty or invalid response - **`http_403`** - a origin returned a response with the code 403 - **`http_404`** - a origin returned a response with the code 404 - **`http_429`** - a origin returned a response with the code 429 - **`http_500`** - a origin returned a response with the code 500 - **`http_502`** - a origin returned a response with the code 502 - **`http_503`** - a origin returned a response with the code 503 - **`http_504`** - a origin returned a response with the code 504
    - `auth_type` string — **Deprecated.** No longer necessary. Defaults to `none`. Origin authentication type. Possible values: - **none** - Used for public origins. - **awsSignatureV4** - Used for S3 storage.
    - `sources` SourceResponse[], required — List of origin sources in the origin group. Each entry can be a host origin or an S3 origin. Host origins have a `source` field with the hostname or IP. S3 origins have `origin_type: s3` and a `config` object with S3 credentials. Both types can be mixed in the same origin group.
      - union
        - HostSourceResponse — A host origin source.
          - `source` string, required — IP address or domain name of the origin and the port, if custom port is used.
          - `backup` boolean — Defines whether the origin is a backup, meaning that it will not be used until one of active origins become unavailable. Possible values: - **true** - Origin is a backup. - **false** - Origin is not a backup.
          - `enabled` boolean — Enables or disables an origin source in the origin group. Possible values: - **true** - Origin is enabled and the CDN uses it to pull content. - **false** - Origin is disabled and the CDN does not use it to pull content. Origin group must contain at least one enabled origin.
          - `tag` string — Tag for the origin source.
          - `host_header_override` string, nullable — Per-origin Host header override. When set, the CDN sends this value as the Host header when requesting content from this origin instead of the default.
        - S3SourceResponse — An S3 origin source.
          - `origin_type` 'host' | 's3' | 'fastedge', required — Origin type. Present in responses for S3 and FastEdge sources. Possible values: - **host** - A source server or endpoint from which content is fetched. - **s3** - S3 storage with either AWS v4 authentication or public access. - **fastedge** - A FastEdge application served directly from the local FastEdge runtime on the edge node, identified by `app_id`.
          - `config` S3Config, required — S3 storage configuration. Required when `origin_type` is `s3`.
            - `s3_type` 'amazon' | 'other', required — Storage type compatible with S3. Possible values: - **amazon** - AWS S3 storage. - **other** - Other (not AWS) S3 compatible storage.
            - `s3_bucket_name` string, required — S3 bucket name.
            - `s3_region` string, nullable — S3 storage region. The parameter is required if `s3_type` is `amazon`.
            - `s3_storage_hostname` string, nullable — S3 storage hostname. The parameter is required if `s3_type` is `other`.
            - `s3_access_key_id` string, required — Access key ID for the S3 account. Masked as `SECRET_VALUE` in responses. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore. - From 4 to 255 characters.
            - `s3_secret_access_key` string, required — Secret access key for the S3 account. Masked as `SECRET_VALUE` in responses. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and underscores. - From 16 to 255 characters.
            - `s3_auth_type` string — S3 authentication type.
          - `backup` boolean — Defines whether the origin is a backup, meaning that it will not be used until one of active origins become unavailable. Possible values: - **true** - Origin is a backup. - **false** - Origin is not a backup.
          - `enabled` boolean — Enables or disables an origin source in the origin group. Possible values: - **true** - Origin is enabled and the CDN uses it to pull content. - **false** - Origin is disabled and the CDN does not use it to pull content. Origin group must contain at least one enabled origin.
          - `tag` string — Tag for the origin source.
          - `host_header_override` string, nullable — Per-origin Host header override. When set, the CDN sends this value as the Host header when requesting content from this origin instead of the default.
        - FastedgeSourceResponse — A FastEdge application origin source.
          - `origin_type` 'host' | 's3' | 'fastedge', required — Origin type. Present in responses for S3 and FastEdge sources. Possible values: - **host** - A source server or endpoint from which content is fetched. - **s3** - S3 storage with either AWS v4 authentication or public access. - **fastedge** - A FastEdge application served directly from the local FastEdge runtime on the edge node, identified by `app_id`.
          - `config` FastedgeConfig, required — FastEdge application configuration. Required when `origin_type` is `fastedge`.
            - `app_id` string, required — ID of the FastEdge application served as origin (string, matching the existing fastedge option's convention). The CDN dispatches requests to the local FastEdge runtime on the edge node using this identifier. The application must belong to the requesting client, be enabled, and have `wasi-http` API type.
          - `backup` boolean — Defines whether the origin is a backup, meaning that it will not be used until one of active origins become unavailable. Possible values: - **true** - Origin is a backup. - **false** - Origin is not a backup.
          - `enabled` boolean — Enables or disables an origin source in the origin group. Possible values: - **true** - Origin is enabled and the CDN uses it to pull content. - **false** - Origin is disabled and the CDN does not use it to pull content. Origin group must contain at least one enabled origin.
          - `tag` string — Tag for the origin source.
          - `host_header_override` string, nullable — Per-origin Host header override. When set, the CDN sends this value as the Host header when requesting content from this origin instead of the default.
    - `path` string — **Deprecated.** No longer necessary. Omit this field and the default origin path behavior will be used. Origin path prefix.
    - `has_related_resources` boolean — Defines whether the origin group has related CDN resources. Possible values: - **true** - Origin group has related CDN resources. - **false** - Origin group does not have related CDN resources.
  - object — **Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.
    - `id` integer, required — Origin group ID.
    - `name` string, required — Origin group name.
    - `use_next` boolean — Defines whether to use the next origin from the origin group if origin responds with the cases specified in `proxy_next_upstream`. If you enable it, you must specify cases in `proxy_next_upstream`. Possible values: - **true** - Option is enabled. - **false** - Option is disabled.
    - `proxy_next_upstream` string[] — Defines cases when the request should be passed on to the next origin. Possible values: - **error** - an error occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **timeout** - a timeout has occurred while establishing a connection with the origin, passing a request to it, or reading the response header - **`invalid_header`** - a origin returned an empty or invalid response - **`http_403`** - a origin returned a response with the code 403 - **`http_404`** - a origin returned a response with the code 404 - **`http_429`** - a origin returned a response with the code 429 - **`http_500`** - a origin returned a response with the code 500 - **`http_502`** - a origin returned a response with the code 502 - **`http_503`** - a origin returned a response with the code 503 - **`http_504`** - a origin returned a response with the code 504
    - `auth_type` string, required — **Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead. Authentication type. **awsSignatureV4** value is used for S3 storage.
    - `auth` Auth, required — **Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead. Credentials to access the private bucket.
      - `s3_type` string, required — Storage type compatible with S3. Possible values: - **amazon** – AWS S3 storage. - **other** – Other (not AWS) S3 compatible storage.
      - `s3_access_key_id` string, required — Access key ID for the S3 account. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore. - From 3 to 512 characters.
      - `s3_secret_access_key` string, required — Secret access key for the S3 account. Restrictions: - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and underscores. - If "s3_type": amazon, length should be 40 characters. - If "s3_type": other, length should be from 16 to 255 characters.
      - `s3_bucket_name` string, required — S3 bucket name.
      - `s3_storage_hostname` string — S3 storage hostname. The parameter is required, if "s3_type": other.
      - `s3_region` string — S3 storage region. The parameter is required, if "s3_type": amazon.
    - `path` string — **Deprecated.** No longer necessary. Omit this field and the default origin path behavior will be used. Origin path prefix.
    - `has_related_resources` boolean — Defines whether the origin group has related CDN resources. Possible values: - **true** - Origin group has related CDN resources. - **false** - Origin group does not have related CDN resources.

## Other responses

- `400` — Failed to create the origin group.
- `403` — Forbidden to create the origin group.

---

[API](https://skmtc.dev/g-core/apis/gcore-openapi.md) · [All operations](https://skmtc.dev/g-core/apis/gcore-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/g-core/gcore-openapi/revisions/09e652815095/schema)
