---
title: "Create a container registry"
method: POST
path: "/organization/{organizationId}/containerRegistry"
tags: ["Container Registries"]
---

# Create a container registry

`POST /organization/{organizationId}/containerRegistry`

## Request

- Base URL: `https://api.qovery.com`
- URL: `https://api.qovery.com/organization/{organizationId}/containerRegistry`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/qovery/apis/qovery-api/docs/organization/:organizationId/containerRegistry/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `organizationId` string, uuid, required

## Request body

- ContainerRegistryRequest
  - `name` string, required
  - `kind` 'ECR' | 'SCALEWAY_CR' | 'DOCKER_HUB' | 'GITHUB_CR' | 'GITHUB_ENTERPRISE_CR' | 'GITLAB_CR' | 'PUBLIC_ECR' | 'DOCR' | 'GENERIC_CR' | 'GCP_ARTIFACT_REGISTRY' | 'AZURE_CR', required: The type of your container registry
  - `description` string
  - `url` string, uri: URL of the container registry: * For `DOCKER_HUB`: it must be `https://docker.io` (default with 'https://docker.io' if no url provided for `DOCKER_HUB`) * For `GITHUB_CR`: it must be `https://ghcr.io` (default with 'https://ghcr.io' if no url provided for `GITHUB_CR`) * For `GITLAB_CR`: it must be `https://registry.gitlab.com` (default with 'https://registry.gitlab.com' if no url provided for `GITLAB_CR`) * For others: it's required and must start by `https://`
  - `config` object, required: This field is dependent of the container registry kind: * `ECR` needs in the config: region, access_key_id, secret_access_key * `SCALEWAY_CR` needs in the config: region, scaleway_access_key, scaleway_secret_key * `GCP_ARTIFACT_REGISTRY` needs in the config: region, json_credentials * `DOCKER_HUB` needs in the config (optional): username, password * `GITHUB_CR` needs in the config (optional): username, password * `GITLAB_CR` needs in the config (optional): username, password * `PUBLIC_ECR` doesn't need credentials info * `GENERIC_CR` needs in the config (optional): username, password * `DOCR` is not supported anymore
    - `access_key_id` string: Required if kind is `ECR` or `PUBLIC_ECR`
    - `secret_access_key` string: Required if kind is `ECR` or `PUBLIC_ECR`
    - `region` string: Required if kind is `ECR` or `SCALEWAY_CR`
    - `scaleway_access_key` string: Required if kind is `SCALEWAY_CR`
    - `scaleway_secret_key` string: Required if kind is `SCALEWAY_CR`
    - `scaleway_project_id` string: Required if kind is `SCALEWAY_CR`
    - `json_credentials` string: Required if kind is `GCP_ARTIFACT_REGISTRY`
    - `username` string: optional, for kind `DOCKER_HUB` We encourage you to set credentials for Docker Hub due to the limits on the pull rate
    - `password` string: optional, for kind `DOCKER_HUB` We encourage you to set credentials for Docker Hub due to the limits on the pull rate
    - `role_arn` string: For ECR, you can either set a static access_key or use a role arn that we are going to assume
    - `azure_tenant_id` string: Required if kind is `AZURE_CR`.
    - `azure_subscription_id` string: Required if kind is `AZURE_CR`.

## Response `201`

Create a Container Registry

- ContainerRegistryResponse
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time
  - `name` string
  - `kind` 'ECR' | 'SCALEWAY_CR' | 'DOCKER_HUB' | 'GITHUB_CR' | 'GITHUB_ENTERPRISE_CR' | 'GITLAB_CR' | 'PUBLIC_ECR' | 'DOCR' | 'GENERIC_CR' | 'GCP_ARTIFACT_REGISTRY' | 'AZURE_CR': The type of your container registry
  - `description` string
  - `url` string: URL of the container registry
  - `cluster` object
    - `id` string, uuid, required
    - `name` string, required
  - `associated_services_count` integer: The number of services using this container registry
  - `config` object
    - `username` string
    - `region` string
    - `scaleway_access_key` string
    - `scaleway_project_id` string
    - `access_key_id` string
    - `role_arn` string
    - `azure_tenant_id` string
    - `azure_subscription_id` string
    - `azure_application_id` string
    - `azure_application_object_id` string

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access forbidden
- `404`: Resource not found

---

[API](https://skmtc.dev/qovery/apis/qovery-api.md) - [All operations](https://skmtc.dev/qovery/apis/qovery-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qovery/apis/qovery-api/revisions/93c4960a44ba?raw)
