# ExchangeDockerCredential consumes an identity token once for the authenticated owner.


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

API version: v1


> This API is experimental. Features, interfaces,
> and behavior may change.




`POST /v1/identity/exchange`

ExchangeDockerCredential consumes an identity token once for the authenticated owner.
The exchanged credential is stored for that owner; the response is empty.

Returns unimplemented when this operation is unavailable. Support does not grant permission.

## Connection and access

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


Server: `https://connect.docker.com/sandboxes`

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

```json
[
  {
    "bearer": []
  }
]
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request POST \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-binary @request-body \
  'https://connect.docker.com/sandboxes/v1/identity/exchange'
```


Prepare request-body using the selected media type and schema.


## Parameters

## Request and responses

### Request  application/json




Schema:

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










### Response 200 application/json

Success


Schema:

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










### Response 501 application/json

This operation is not available on this service.


Schema:

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









unimplemented:
```json
{
  "code": "unimplemented",
  "message": "This operation is not available on this service."
}
```


### Response default application/json

The structured Error body identifies the failure with a stable code and optional typed details.


Schema:

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









Schema example:
```json
{
  "code": "notFound",
  "details": [],
  "message": "sandbox not found"
}
```


## Complete operation contract

```json
{
  "description": "ExchangeDockerCredential consumes an identity token once for the authenticated owner.\nThe exchanged credential is stored for that owner; the response is empty.\n\nReturns unimplemented when this operation is unavailable. Support does not grant permission.",
  "operationId": "exchangeDockerCredential",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/IdentityExchangeServiceExchangeDockerCredentialRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ExchangeCompositionCredentialResponse"
          }
        }
      },
      "description": "Success"
    },
    "501": {
      "content": {
        "application/json": {
          "examples": {
            "unimplemented": {
              "summary": "This operation is not available on this service.",
              "value": {
                "code": "unimplemented",
                "message": "This operation is not available on this service."
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "This operation is not available on this service."
    },
    "default": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "The structured Error body identifies the failure with a stable code and optional typed details."
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "summary": "ExchangeDockerCredential consumes an identity token once for the authenticated owner.",
  "tags": [
    "Credentials"
  ],
  "x-sbx-authenticated-only": false,
  "x-sbx-conditional-permissions": [],
  "x-sbx-error-responses": [
    {
      "code": "UNIMPLEMENTED",
      "description": "This operation is not available on this service."
    }
  ],
  "x-sbx-plane": "control",
  "x-sbx-required-permissions": [
    "credentialsExchange"
  ],
  "x-sbx-serving-surface": "management"
}
```

## Referenced schemas

- [#/components/schemas/Error](/reference/api/sandboxes/latest/schemas/Error/)

- [#/components/schemas/ExchangeCompositionCredentialResponse](/reference/api/sandboxes/latest/schemas/ExchangeCompositionCredentialResponse/)

- [#/components/schemas/IdentityExchangeServiceExchangeDockerCredentialRequest](/reference/api/sandboxes/latest/schemas/IdentityExchangeServiceExchangeDockerCredentialRequest/)




