# Get a connected user
URL: https://musicapi.com/docs/connect-users/connected-users.md

> Read a connected user of your account, and the user's own profile on the music service ("Me").

Product: MusicAPI Core and MusicAPI Managed Transfers. Section: Connect your users.

A connected user is one music account that signed in through your hosted sign-in. Two calls read it.

| Call                                                                                                                 | What it returns                                                                                    | Calls the music service       |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------- |
| [`GET /public/integrations/user/{integrationUserUUID}`](https://musicapi.com/docs/reference/get-integration-user.md) | What MusicAPI stored at the sign-in: name, email, image, country. With Basic, also the raw tokens. | Only to renew expiring tokens |
| [`GET /api/{integrationUserUUID}/users/profile`](https://musicapi.com/docs/reference/get-user-profile.md)            | The profile as the service returns it now ("Me")                                                   | Yes                           |

## The stored user

```bash
curl "https://api.musicapi.com/public/integrations/user/3f0b8c1e-6a4d-4c7a-9a55-2f1e7d9b0c11" \
  -u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET"
```

```bash
curl "https://api.musicapi.com/public/integrations/user/3f0b8c1e-6a4d-4c7a-9a55-2f1e7d9b0c11" \
  -H "Authorization: Token $MUSICAPI_CLIENT_ID"
```

```json
{
  "integrationUser": {
    "uuid": "3f0b8c1e-6a4d-4c7a-9a55-2f1e7d9b0c11",
    "integrationUserId": "mica.nowak",
    "name": "Mica Nowak",
    "email": "mica@example.com",
    "imageUrl": "https://images.example.com/mica.jpg",
    "country": "PL"
  },
  "integration": { "type": "spotify" }
}
```

`integration.type` tells you the service of this user. `country` is the ISO 3166-1 alpha-2 code, when the service gives one.

## The service profile ("Me")

```bash
curl "https://api.musicapi.com/api/3f0b8c1e-6a4d-4c7a-9a55-2f1e7d9b0c11/users/profile" \
  -u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET"
```

This is a library call: it goes to the music service, it counts as one request, and it answers `412` when the user must sign in again. Use it to check that a connection still works.

## List all connected users

The **Music Users** page of the dashboard lists every connected user with search and a service filter. The API has no list endpoint: store the `integrationUserUUID` of each user when the callback comes in.
