---
title: "Create Registry."
method: POST
path: "/registry"
tags: ["Registries"]
---

# Create Registry.

`POST /registry`

Create a Registry.

## Query parameters

- `space_ref` string, required

## Request body

- RegistryRequest
  - `identifier` string, required
  - `packageType` 'DOCKER' | 'MAVEN' | 'PYTHON' | 'GENERIC' | 'HELM' | 'NUGET' | 'NPM' | 'RPM' | 'CARGO' | 'GO' | 'HUGGINGFACE', required — refers to package
  - `description` string
  - `allowedPattern` string[]
  - `blockedPattern` string[]
  - `cleanupPolicy` CleanupPolicy[]
    - `name` string
    - `expireDays` integer
    - `versionPrefix` string[]
    - `packagePrefix` string[]
  - `labels` string[]
  - `config` union — SubConfig specific for Virtual or Upstream Registry
    - object — Configuration for Harness Virtual Artifact Registries
      - `type` 'VIRTUAL' | 'UPSTREAM', required — refers to type of registry i.e virtual or upstream
      - `upstreamProxies` string[]
    - object — Configuration for Harness Artifact UpstreamProxies
      - `type` 'VIRTUAL' | 'UPSTREAM', required — refers to type of registry i.e virtual or upstream
      - `authType` 'UserPassword' | 'AccessKeySecretKey' | 'Anonymous', required — Authentication type
      - `auth` union
        - UserPassword
          - `userName` string, required
          - `secretIdentifier` string
          - `secretSpacePath` string
          - `secretSpaceId` integer
        - unknown
        - AccessKeySecretKey
          - `accessKey` string
          - `accessKeySecretIdentifier` string
          - `accessKeySecretSpacePath` string
          - `accessKeySecretSpaceId` integer
          - `secretKeyIdentifier` string, required
          - `secretKeySpacePath` string
          - `secretKeySpaceId` integer
      - `upstreamProxyConfigFirewallMode` 'ALLOW' | 'WARN' | 'BLOCK' — Firewall mode applied to an upstream proxy.
      - `url` string
      - `source` 'Dockerhub' | 'Custom' | 'AwsEcr' | 'MavenCentral' | 'PyPi' | 'NpmJs' | 'NugetOrg' | 'Crates' | 'GoProxy' | 'HuggingFace'
      - `remoteUrlSuffix` string — Optional path suffix appended to the remote URL for this registry. For Python upstreams, this allows overriding the default `/simple` path used for PyPI-compatible indexes. Leading and trailing slashes are not required and will be normalized.
  - `parentRef` string, required
  - `isPublic` boolean, required

## Response `201`

response for create, get and update registry

- object
  - `status` 'SUCCESS' | 'FAILURE' | 'ERROR', required — Indicates if the request was successful or not
  - `data` Registry, required — Harness Artifact Registry
    - `cleanupPolicy` CleanupPolicy[]
      - `name` string
      - `expireDays` integer
      - `versionPrefix` string[]
      - `packagePrefix` string[]
    - `identifier` string, required
    - `packageType` 'DOCKER' | 'MAVEN' | 'PYTHON' | 'GENERIC' | 'HELM' | 'NUGET' | 'NPM' | 'RPM' | 'CARGO' | 'GO' | 'HUGGINGFACE', required — refers to package
    - `description` string
    - `url` string, required
    - `allowedPattern` string[]
    - `blockedPattern` string[]
    - `labels` string[]
    - `config` union — SubConfig specific for Virtual or Upstream Registry
      - object — Configuration for Harness Virtual Artifact Registries
        - `type` 'VIRTUAL' | 'UPSTREAM', required — refers to type of registry i.e virtual or upstream
        - `upstreamProxies` string[]
      - object — Configuration for Harness Artifact UpstreamProxies
        - `type` 'VIRTUAL' | 'UPSTREAM', required — refers to type of registry i.e virtual or upstream
        - `authType` 'UserPassword' | 'AccessKeySecretKey' | 'Anonymous', required — Authentication type
        - `auth` union
          - UserPassword
            - `userName` string, required
            - `secretIdentifier` string
            - `secretSpacePath` string
            - `secretSpaceId` integer
          - unknown
          - AccessKeySecretKey
            - `accessKey` string
            - `accessKeySecretIdentifier` string
            - `accessKeySecretSpacePath` string
            - `accessKeySecretSpaceId` integer
            - `secretKeyIdentifier` string, required
            - `secretKeySpacePath` string
            - `secretKeySpaceId` integer
        - `upstreamProxyConfigFirewallMode` 'ALLOW' | 'WARN' | 'BLOCK' — Firewall mode applied to an upstream proxy.
        - `url` string
        - `source` 'Dockerhub' | 'Custom' | 'AwsEcr' | 'MavenCentral' | 'PyPi' | 'NpmJs' | 'NugetOrg' | 'Crates' | 'GoProxy' | 'HuggingFace'
        - `remoteUrlSuffix` string — Optional path suffix appended to the remote URL for this registry. For Python upstreams, this allows overriding the default `/simple` path used for PyPI-compatible indexes. Leading and trailing slashes are not required and will be normalized.
    - `createdAt` string
    - `modifiedAt` string
    - `isPublic` boolean, required
    - `uuid` string, required
    - `deletedAt` string — Timestamp in milliseconds when the registry was soft-deleted

## Other responses

- `400` — Bad request
- `401` — Unauthenticated
- `403` — Unauthorized
- `500` — Internal server error

---

[API](https://skmtc.net/harness/apis/harness-artifact-registry-api.md) · [All operations](https://skmtc.net/harness/apis/harness-artifact-registry-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/harness/harness-artifact-registry-api/revisions/e315ed26a2f1/schema)
