Organization configurations

Use the REST API to manage private registry configurations for organizations.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List private registries for an organization

GET /orgs/{org}/private-registries

Lists all private registry configurations available at the organization-level without revealing their encrypted
values.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/private-registries

Response schema (Status: 200):

Create a private registry for an organization

POST /orgs/{org}/private-registries

Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using LibSodium. For more information, see "Encrypting secrets for the REST API."
For OIDC-based registries (oidc_azure, oidc_aws, oidc_jfrog, oidc_cloudsmith, or oidc_gcp), the encrypted_value and key_id fields should be omitted.
For anonymous registries (anonymous), the username, encrypted_value, and key_id fields must be omitted.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example of a private registry configuration with private visibility

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/private-registries \
  -d '{
  "registry_type": "maven_repository",
  "url": "https://maven.pkg.github.com/organization/",
  "username": "monalisa",
  "replaces_base": true,
  "encrypted_value": "c2VjcmV0",
  "key_id": "012345678912345678",
  "visibility": "private"
}'

Response schema (Status: 201):

Example of a private registry configuration with selected visibility

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/private-registries \
  -d '{
  "registry_type": "maven_repository",
  "url": "https://maven.pkg.github.com/organization/",
  "username": "monalisa",
  "encrypted_value": "c2VjcmV0",
  "key_id": "012345678912345678",
  "visibility": "selected",
  "selected_repository_ids": [
    1296269,
    1296280
  ]
}'

Response schema (Status: 201):

Get private registries public key for an organization

GET /orgs/{org}/private-registries/public-key

Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/private-registries/public-key

Response schema (Status: 200):

Get a private registry for an organization

GET /orgs/{org}/private-registries/{secret_name}

Get the configuration of a single private registry defined for an organization, omitting its encrypted value.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/private-registries/SECRET_NAME

Response schema (Status: 200):

Update a private registry for an organization

PATCH /orgs/{org}/private-registries/{secret_name}

Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using LibSodium. For more information, see "Encrypting secrets for the REST API."
For OIDC-based registries (oidc_azure, oidc_aws, oidc_jfrog, oidc_cloudsmith, or oidc_gcp), the encrypted_value and key_id fields should be omitted.
For anonymous registries (anonymous), the username, encrypted_value, and key_id fields must be omitted, and auth_type cannot be changed to or from anonymous.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Update a secret-based private registry

Request:

curl -L \
  -X PATCH \
  https://api.github.com/orgs/ORG/private-registries/SECRET_NAME \
  -d '{
  "username": "monalisa",
  "encrypted_value": "c2VjcmV0",
  "key_id": "012345678912345678"
}'

Response schema (Status: 204):

Update an OIDC private registry (Azure)

Request:

curl -L \
  -X PATCH \
  https://api.github.com/orgs/ORG/private-registries/SECRET_NAME \
  -d '{
  "tenant_id": "12345678-1234-1234-1234-123456789012",
  "visibility": "selected",
  "selected_repository_ids": [
    1296269,
    1296280
  ]
}'

Response schema (Status: 204):

Delete a private registry for an organization

DELETE /orgs/{org}/private-registries/{secret_name}

Delete a private registry configuration at the organization-level.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/private-registries/SECRET_NAME

Response schema (Status: 204):