---
title: "Create a Generic upstream config for this repository."
method: POST
path: "/repos/{owner}/{identifier}/upstream/generic/"
tags: ["repos"]
---

# Create a Generic upstream config for this repository.

`POST /repos/{owner}/{identifier}/upstream/generic/`

Create a Generic upstream config for this repository.

## Request body

- GenericUpstreamRequest
  - `auth_mode` 'None' | 'Username and Password' | 'Token' — The authentication mode to use when accessing this upstream.
  - `auth_secret` string, nullable — Secret to provide with requests to upstream.
  - `auth_username` string, nullable — Username to provide with requests to upstream.
  - `extra_header_1` string, nullable — The key for extra header #1 to send to upstream.
  - `extra_header_2` string, nullable — The key for extra header #2 to send to upstream.
  - `extra_value_1` string, nullable — The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted.
  - `extra_value_2` string, nullable — The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted.
  - `is_active` boolean — Whether or not this upstream is active and ready for requests.
  - `mode` 'Proxy Only' | 'Cache and Proxy' | 'Cache Only' — The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode.
  - `name` string, required — A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.
  - `priority` integer — Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.
  - `upstream_prefix` string — A unique prefix used to distinguish this upstream source within the repository. Generic upstreams can represent entirely different file servers, and we do not attempt to blend them. The prefix ensures each source remains separate, and requests including this prefix are routed to the correct upstream.
  - `upstream_url` string, uri, required — The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
  - `verify_ssl` boolean — If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams.

## Response `201`

Created

- GenericUpstream
  - `auth_mode` 'None' | 'Username and Password' | 'Token' — The authentication mode to use when accessing this upstream.
  - `auth_secret` string, nullable — Secret to provide with requests to upstream.
  - `auth_username` string, nullable — Username to provide with requests to upstream.
  - `available` boolean — Whether the upstream is available for use.
  - `can_reindex` boolean — Whether the upstream can be reindexed.
  - `created_at` string, date-time — The datetime the upstream source was created.
  - `disable_reason` 'N/A' | 'Upstream points to its own repository' | 'Missing upstream source' | 'RSA key did not verify the upstream's APKINDEX signature' | 'Upstream was disabled by request of user'
  - `disable_reason_text` string — Human-readable explanation of why this upstream is disabled
  - `extra_header_1` string, nullable — The key for extra header #1 to send to upstream.
  - `extra_header_2` string, nullable — The key for extra header #2 to send to upstream.
  - `extra_value_1` string, nullable — The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted.
  - `extra_value_2` string, nullable — The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted.
  - `has_failed_signature_verification` boolean — Whether the upstream has failed signature verification.
  - `index_package_count` integer, nullable — The number of packages available in this upstream source
  - `index_status` string, nullable — The current indexing status of this upstream source
  - `is_active` boolean — Whether or not this upstream is active and ready for requests.
  - `last_indexed` string, nullable — The last time this upstream source was indexed
  - `mode` 'Proxy Only' | 'Cache and Proxy' | 'Cache Only' — The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode.
  - `name` string, required — A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.
  - `pending_validation` boolean — When true, this upstream source is pending validation.
  - `priority` integer — Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.
  - `slug_perm` string, slug
  - `updated_at` string, date-time
  - `upstream_prefix` string — A unique prefix used to distinguish this upstream source within the repository. Generic upstreams can represent entirely different file servers, and we do not attempt to blend them. The prefix ensures each source remains separate, and requests including this prefix are routed to the correct upstream.
  - `upstream_url` string, uri, required — The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
  - `verify_ssl` boolean — If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams.

## Other responses

- `400` — Request could not be processed (see detail).
- `422` — Missing or invalid parameters (see detail).

---

[API](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1.md) · [All operations](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudsmith/cloudsmith-api-v1/revisions/4d7879df9b2f/schema)
