# Push destination token
URL: https://musicapi.com/docs/reference/push-transfer-session-target-auth.md

`PUT https://api.musicapi.com/public/transfer-sessions/{sessionUuid}/target-auth`

Section: Managed Transfers.
Product: MusicAPI Managed Transfers.
Auth: Basic, DevToken (any one of them). Use Basic with your Client ID and Client Secret from your server only.

Replaces the stored token of the session's destination account. The token must be for the same account. If a transfer of this session waits for the destination (`user.auth_failed` with `preauthorized: true`), it resumes.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `sessionUuid` | uuid | yes | The sessionUuid from Create transfer session |

## Request body

`application/json`, required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authData` | PreauthorizedAuthData | yes |  |
| `authData.accessToken` | string | yes | The user's access token for your destination service. |
| `authData.refreshToken` | string | no | The refresh token. Used only when your destination integration has OAuth client credentials that can renew it. |
| `authData.expiresAt` | date-time \| number | no | When the access token expires: an ISO 8601 date, or a Unix time in seconds or milliseconds. |

## Response 200

The token is stored.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sessionUuid` | uuid | no |  |
| `target` | PreauthorizedTarget | no |  |
| `target.integrationType` | string | no |  |
| `target.integrationUserUuid` | uuid | no |  |
| `target.displayName` | string \| null | no |  |
| `transferResumed` | boolean | no | True when a transfer of this session waited for the destination and now continues. |

```json
{
  "sessionUuid": "5b0c6f0e-2c8a-4d0e-9a51-7e3f1c2d9b44",
  "target": {
    "integrationType": "spotify",
    "integrationUserUuid": "5b0c6f0e-2c8a-4d0e-9a51-7e3f1c2d9b44",
    "displayName": "Jane Listener"
  },
  "transferResumed": true
}
```

## Errors

- 400: The body is not valid.
- 401: The request has no credentials.
- 403: The credential is not secret, or the transfer service is not enabled for your account.
- 404: Your account has no session with this UUID.
- 409: The token is for another account, the session has no pre-authorized destination, or the session ended.
- 422: The music service refused the access token.
- 503: The music service could not be reached to check the token. Try again later.

## Example

```bash
curl -X PUT "https://api.musicapi.com/public/transfer-sessions/{sessionUuid}/target-auth" \
  -u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"authData":{"accessToken":"string","refreshToken":"string","expiresAt":"2026-10-16T09:41:07.000Z"}}'
```
