<!--
{
  "availability" : [
    "iOS: 11.0.0 - 18.0.0",
    "iPadOS: 11.0.0 - 18.0.0",
    "macCatalyst: 13.0.0 - 18.0.0",
    "macOS: 11.0.0 - 15.0.0",
    "tvOS: 11.0.0 - 18.0.0",
    "watchOS: 7.0.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/SKCloudServiceController/requestUserToken(forDeveloperToken:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKCloudServiceController(im)requestUserTokenForDeveloperToken:completionHandler:"
  },
  "title" : "requestUserToken(forDeveloperToken:completionHandler:)"
}
-->

# requestUserToken(forDeveloperToken:completionHandler:)

Returns a user token that you use to access personalized Apple Music content.

```
func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping @Sendable (String?, (any Error)?) -> Void)
```

## Parameters

`developerToken`

A signed and encrypted JWT token used to authenticate the developer in Apple Music API requests.

`completionHandler`

A completion block that includes the following parameters:

- userToken: A token that identifies the user.
- error: The error that occurred, if any.

## Discussion

Use this method with your developer token to get a token that authenticates the user in personalized Apple Music API requests. Note that personalized requests return user-specific data. Errors 401 and 403 only occur when requesting a music user token. They do not occur for any of the other Apple Music API requests.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)