---
title: "Add container registry"
method: POST
path: "/registries"
tags: ["ContainerRegistries"]
---

# Add container registry

`POST /registries`

## Request

- Base URL: `https://api.bunny.net/mc`
- URL: `https://api.bunny.net/mc/registries`
- Auth: API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/magic-containers-api/docs/registries/post.ts> (a function with typed inputs; its response is checked against the schema)

Add a container registry for user.

## Request body

- ContainerRegistryRequest
  - `displayName` string, required: Container registry display name
  - `type` 'dockerHub' | 'gitHub' | 'bunnyRegistry' | 'oci'
  - `hostName` string, nullable: The registry's host, with an optional port (e.g. "registry.example.com" or "registry.example.com:5000"). An https:// prefix and a namespace path ("rg.fr-par.scw.cloud/my-namespace") are dropped; http:// is refused. Required for the Oci type and ignored for the others.
  - `passwordCredentials` Credentials: Password credentials for container registry
    - `userName` string, required: User name
    - `password` string, required: Password

## Response `200`

Container registry was successfully added.

- SaveContainerRegistryResult
  - `id` integer, nullable
  - `error` string, nullable
  - `status` 'saved' | 'secretsValidationFailed' | 'unknownErrorOccured' | 'notFound' | 'invalidInput'

## Other responses

- `400`: Invalid input.
- `401`: User is unauthorized.
- `500`: Unexpected server error.

## Changes

- **2026-11-12** `7bb58a0591b0`: 6 info
  - added the new optional request property `hostName` (media type: application/json)
  - added the new optional request property `hostName` (media type: text/json)
  - added the new optional request property `hostName` (media type: application/*+json)
  - added the new `oci` enum value to the request property `type` (media type: application/json)
  - …2 more
- **2026-08-08** `0054dcaa32fb`: 3 warning, 3 info
  - the `displayName` request property's maxLength was set to `50` (media type: application/json)
  - the `displayName` request property's maxLength was set to `50` (media type: text/json)
  - the `displayName` request property's maxLength was set to `50` (media type: application/*+json)
  - added the new `bunnyRegistry` enum value to the request property `type` (media type: application/json)
  - …2 more
- **2026-04-26** `62fb48c758fb`: 6 breaking, 5 warning, 15 info
  - removed the enum value `DockerHub` of the request property `type` (media type: application/json)
  - removed the enum value `DockerHub` of the request property `type` (media type: text/json)
  - removed the enum value `DockerHub` of the request property `type` (media type: application/*+json)
  - removed the enum value `GitHub` of the request property `type` (media type: application/json)
  - …22 more

[Operation history](https://skmtc.dev/bunny/apis/magic-containers-api/changes/registries/post.md)

---

[API](https://skmtc.dev/bunny/apis/magic-containers-api.md) - [All operations](https://skmtc.dev/bunny/apis/magic-containers-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/magic-containers-api/revisions/7bb58a0591b0?raw)
