# List access tokens


[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/orgs/{org_name}/access-tokens`

List access tokens for an organization.


## 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/orgs/myorganization/access-tokens'
```



## Parameters

### org_name

Location: path. Required: yes.

Name of the organization (namespace).

```json
{
  "description": "Name of the organization (namespace).",
  "example": "myorganization",
  "in": "path",
  "name": "org_name",
  "pointer": "/paths/~1v2~1orgs~1{org_name}~1access-tokens/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### page

Location: query. Required: no.

Page number (starts on 1).

```json
{
  "description": "Page number (starts on 1).",
  "in": "query",
  "name": "page",
  "pointer": "/paths/~1v2~1orgs~1{org_name}~1access-tokens/get/parameters/0",
  "required": false,
  "schema": {
    "default": 1,
    "type": "integer"
  }
}
```

### page_size

Location: query. Required: no.

Number of items (rows) per page.

```json
{
  "description": "Number of items (rows) per page.",
  "in": "query",
  "name": "page_size",
  "pointer": "/paths/~1v2~1orgs~1{org_name}~1access-tokens/get/parameters/1",
  "required": false,
  "schema": {
    "default": 10,
    "type": "integer"
  }
}
```

## Request and responses

### Response 200 application/json

OK


Schema:

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









Schema example:
```json
{
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2022-05-20T00:54:18Z",
      "created_by": "johndoe",
      "expires_at": "2023-05-20T00:54:18Z",
      "id": "a7a5ef25-8889-43a0-8cc7-f2a94268e861",
      "is_active": true,
      "label": "My organization token",
      "last_used_at": "2022-06-15T12:30:45Z"
    }
  ],
  "total": 1
}
```


### 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

Not Found


Schema:

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









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


## Complete operation contract

```json
{
  "description": "List access tokens for an organization.\n",
  "operationId": "getV2OrgsByNameAccessTokens",
  "parameters": [
    {
      "$ref": "#/components/parameters/page"
    },
    {
      "$ref": "#/components/parameters/page_size"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/getOrgAccessTokensResponse"
          }
        }
      },
      "description": "OK"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "summary": "List access tokens",
  "tags": [
    "org-access-tokens"
  ]
}
```

## Referenced schemas

- `#/components/parameters/page`

- `#/components/parameters/page_size`

- `#/components/responses/Forbidden`

- `#/components/responses/NotFound`

- `#/components/responses/Unauthorized`

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




