# List repositories in a namespace


[API catalog](/reference/api/) · [Docker Hub overview](/reference/api/hub/latest/) · [Product manual](https://docs.docker.com/docker-hub/) · [OpenAPI specification](/reference/api/hub/latest.yaml)

API version: 2-beta



`GET /v2/namespaces/{namespace}/repositories`

Returns a list of repositories within the specified namespace (organization or user).

Public repositories are accessible to everyone, while private repositories require appropriate authentication and permissions.



**OAT listing behavior**: an OAT with the `scope-repository-list` scope sees all repositories including private ones. An OAT without that scope only sees public repositories. This filtering is silent: the response is a normal `200` with no indication that private repositories were withheld.

This operation accepts bearer tokens issued from organization access tokens (OATs). The token must have the required resource access and scopes.


## Connection and access

[API connection and authentication guidance](/reference/api/hub/latest/#authentication)


Server: `https://hub.docker.com`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "bearerAuth": []
  },
  {}
]
```
## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  'https://hub.docker.com/v2/namespaces/<NAMESPACE>/repositories'
```

This example uses the first authentication alternative. Review the complete requirements.

## Parameters

### namespace

Location: path. Required: yes.

Namespace of the repository, such as a user or organization name.

```json
{
  "description": "Namespace of the repository, such as a user or organization name.",
  "in": "path",
  "name": "namespace",
  "pointer": "/paths/~1v2~1namespaces~1{namespace}~1repositories/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### page

Location: query. Required: no.

Page number to get. Defaults to 1.

```json
{
  "description": "Page number to get. Defaults to 1.",
  "in": "query",
  "name": "page",
  "pointer": "/paths/~1v2~1namespaces~1{namespace}~1repositories/get/parameters/0",
  "required": false,
  "schema": {
    "default": 1,
    "minimum": 1,
    "type": "integer"
  }
}
```

### page_size

Location: query. Required: no.

Number of repositories to get per page. Defaults to 10. Max of 100.

```json
{
  "description": "Number of repositories to get per page. Defaults to 10. Max of 100.",
  "in": "query",
  "name": "page_size",
  "pointer": "/paths/~1v2~1namespaces~1{namespace}~1repositories/get/parameters/1",
  "required": false,
  "schema": {
    "default": 10,
    "maximum": 100,
    "minimum": 1,
    "type": "integer"
  }
}
```

### name

Location: query. Required: no.

Filter repositories by name (partial match).

```json
{
  "description": "Filter repositories by name (partial match).",
  "in": "query",
  "name": "name",
  "pointer": "/paths/~1v2~1namespaces~1{namespace}~1repositories/get/parameters/2",
  "required": false,
  "schema": {
    "type": "string"
  }
}
```

### ordering

Location: query. Required: no.

Order repositories by the specified field. Prefix with '-' for descending order.
Available options:
- `name` / `-name`: Repository name (ascending/descending)
- `last_updated` / `-last_updated`: Last update time (ascending/descending)
- `pull_count` / `-pull_count`: Number of pulls (ascending/descending)


```json
{
  "description": "Order repositories by the specified field. Prefix with '-' for descending order.\nAvailable options:\n- `name` / `-name`: Repository name (ascending/descending)\n- `last_updated` / `-last_updated`: Last update time (ascending/descending)\n- `pull_count` / `-pull_count`: Number of pulls (ascending/descending)\n",
  "in": "query",
  "name": "ordering",
  "pointer": "/paths/~1v2~1namespaces~1{namespace}~1repositories/get/parameters/3",
  "required": false,
  "schema": {
    "enum": [
      "name",
      "-name",
      "last_updated",
      "-last_updated",
      "pull_count",
      "-pull_count"
    ],
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

List of repositories


Schema:

```json
{
  "$ref": "#/components/schemas/list_repositories_response"
}
```




repositories_list:
```json
{
  "count": 287,
  "next": "https://hub.docker.com/v2/namespaces/docker/repositories?page=2\u0026page_size=2",
  "previous": null,
  "results": [
    {
      "affiliation": "",
      "categories": [
        {
          "name": "Languages \u0026 frameworks",
          "slug": "languages-and-frameworks"
        },
        {
          "name": "Integration \u0026 delivery",
          "slug": "integration-and-delivery"
        },
        {
          "name": "Operating systems",
          "slug": "operating-systems"
        }
      ],
      "content_types": [
        "unrecognized",
        "image"
      ],
      "date_registered": "2015-05-19T21:13:35.937763Z",
      "description": "Image for performing Docker build requests",
      "is_private": false,
      "last_modified": "2024-10-16T13:48:34.145251Z",
      "last_updated": "2023-06-20T10:44:45.459826Z",
      "media_types": [
        "application/octet-stream",
        "application/vnd.docker.container.image.v1+json",
        "application/vnd.docker.distribution.manifest.v1+prettyjws"
      ],
      "name": "highland_builder",
      "namespace": "docker",
      "pull_count": 15722123,
      "repository_type": "image",
      "star_count": 7,
      "status": 1,
      "status_description": "active",
      "storage_size": 488723114800
    },
    {
      "affiliation": "",
      "categories": [
        {
          "name": "Languages \u0026 frameworks",
          "slug": "languages-and-frameworks"
        },
        {
          "name": "Integration \u0026 delivery",
          "slug": "integration-and-delivery"
        }
      ],
      "content_types": [
        "image"
      ],
      "date_registered": "2015-06-09T18:16:36.527329Z",
      "description": "An image for use in the Docker demo tutorial",
      "is_private": false,
      "last_modified": "2024-10-16T13:48:34.145251Z",
      "last_updated": "2015-06-19T19:06:27.388123Z",
      "media_types": [
        "application/vnd.docker.distribution.manifest.v1+prettyjws"
      ],
      "name": "whalesay",
      "namespace": "docker",
      "pull_count": 130737682,
      "repository_type": null,
      "star_count": 757,
      "status": 1,
      "status_description": "active",
      "storage_size": 103666708
    }
  ]
}
```


### Response 400 application/json

Bad Request - Invalid request parameters


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




invalid_ordering:
```json
{
  "fields": {
    "ordering": [
      "Invalid ordering value. Must be one of: name, -name, last_updated, -last_updated, pull_count, -pull_count"
    ]
  },
  "text": "Invalid ordering value"
}
```


### Response 401 application/json

Unauthorized


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "unauthorized"
}
```


### Response 403 application/json

Forbidden


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "permission denied"
}
```


### Response 404 application/json

Page not found - occurs when requesting a page number `>1` that exceeds the available results


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "not found"
}
```


## Complete operation contract

```json
{
  "description": "Returns a list of repositories within the specified namespace (organization or user).\n\nPublic repositories are accessible to everyone, while private repositories require appropriate authentication and permissions.\n\n\n\n**OAT listing behavior**: an OAT with the `scope-repository-list` scope sees all repositories including private ones. An OAT without that scope only sees public repositories. This filtering is silent: the response is a normal `200` with no indication that private repositories were withheld.\n\nThis operation accepts bearer tokens issued from organization access tokens (OATs). The token must have the required resource access and scopes.\n",
  "operationId": "listNamespaceRepositories",
  "parameters": [
    {
      "description": "Page number to get. Defaults to 1.",
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
        "default": 1,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "description": "Number of repositories to get per page. Defaults to 10. Max of 100.",
      "in": "query",
      "name": "page_size",
      "required": false,
      "schema": {
        "default": 10,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "description": "Filter repositories by name (partial match).",
      "in": "query",
      "name": "name",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Order repositories by the specified field. Prefix with '-' for descending order.\nAvailable options:\n- `name` / `-name`: Repository name (ascending/descending)\n- `last_updated` / `-last_updated`: Last update time (ascending/descending)\n- `pull_count` / `-pull_count`: Number of pulls (ascending/descending)\n",
      "in": "query",
      "name": "ordering",
      "required": false,
      "schema": {
        "enum": [
          "name",
          "-name",
          "last_updated",
          "-last_updated",
          "pull_count",
          "-pull_count"
        ],
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "examples": {
            "repositories_list": {
              "value": {
                "count": 287,
                "next": "https://hub.docker.com/v2/namespaces/docker/repositories?page=2\u0026page_size=2",
                "previous": null,
                "results": [
                  {
                    "affiliation": "",
                    "categories": [
                      {
                        "name": "Languages \u0026 frameworks",
                        "slug": "languages-and-frameworks"
                      },
                      {
                        "name": "Integration \u0026 delivery",
                        "slug": "integration-and-delivery"
                      },
                      {
                        "name": "Operating systems",
                        "slug": "operating-systems"
                      }
                    ],
                    "content_types": [
                      "unrecognized",
                      "image"
                    ],
                    "date_registered": "2015-05-19T21:13:35.937763Z",
                    "description": "Image for performing Docker build requests",
                    "is_private": false,
                    "last_modified": "2024-10-16T13:48:34.145251Z",
                    "last_updated": "2023-06-20T10:44:45.459826Z",
                    "media_types": [
                      "application/octet-stream",
                      "application/vnd.docker.container.image.v1+json",
                      "application/vnd.docker.distribution.manifest.v1+prettyjws"
                    ],
                    "name": "highland_builder",
                    "namespace": "docker",
                    "pull_count": 15722123,
                    "repository_type": "image",
                    "star_count": 7,
                    "status": 1,
                    "status_description": "active",
                    "storage_size": 488723114800
                  },
                  {
                    "affiliation": "",
                    "categories": [
                      {
                        "name": "Languages \u0026 frameworks",
                        "slug": "languages-and-frameworks"
                      },
                      {
                        "name": "Integration \u0026 delivery",
                        "slug": "integration-and-delivery"
                      }
                    ],
                    "content_types": [
                      "image"
                    ],
                    "date_registered": "2015-06-09T18:16:36.527329Z",
                    "description": "An image for use in the Docker demo tutorial",
                    "is_private": false,
                    "last_modified": "2024-10-16T13:48:34.145251Z",
                    "last_updated": "2015-06-19T19:06:27.388123Z",
                    "media_types": [
                      "application/vnd.docker.distribution.manifest.v1+prettyjws"
                    ],
                    "name": "whalesay",
                    "namespace": "docker",
                    "pull_count": 130737682,
                    "repository_type": null,
                    "star_count": 757,
                    "status": 1,
                    "status_description": "active",
                    "storage_size": 103666708
                  }
                ]
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/list_repositories_response"
          }
        }
      },
      "description": "List of repositories"
    },
    "400": {
      "content": {
        "application/json": {
          "examples": {
            "invalid_ordering": {
              "summary": "Invalid ordering value",
              "value": {
                "fields": {
                  "ordering": [
                    "Invalid ordering value. Must be one of: name, -name, last_updated, -last_updated, pull_count, -pull_count"
                  ]
                },
                "text": "Invalid ordering value"
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "description": "Bad Request - Invalid request parameters"
    },
    "401": {
      "$ref": "#/components/responses/unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/forbidden"
    },
    "404": {
      "content": {
        "application/json": {
          "examples": {
            "error": {
              "summary": "Example error response",
              "value": {
                "errinfo": null,
                "message": "not found"
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "description": "Page not found - occurs when requesting a page number `\u003e1` that exceeds the available results"
    }
  },
  "security": [
    {
      "bearerAuth": []
    },
    {}
  ],
  "summary": "List repositories in a namespace",
  "tags": [
    "repositories"
  ]
}
```

## Referenced schemas

- `#/components/responses/forbidden`

- `#/components/responses/unauthorized`

- [#/components/schemas/error](/reference/api/hub/latest/schemas/error/)

- [#/components/schemas/list_repositories_response](/reference/api/hub/latest/schemas/list_repositories_response/)




