- Docs
- Connect your users
Get a connected user
Core + Managed TransfersGuide · 1 min
Read a connected user of your account, and the user's own profile on the music service ("Me").
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} | 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 | The profile as the service returns it now ("Me") | Yes |
The stored user
curl "https://api.musicapi.com/public/integrations/user/3f0b8c1e-6a4d-4c7a-9a55-2f1e7d9b0c11" \
-u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET"
{
"integrationUser": {
"uuid": "3f0b8c1e-6a4d-4c7a-9a55-2f1e7d9b0c11",
"integrationUserId": "mica.nowak",
"name": "Mica Nowak",
"email": "[email protected]",
"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")
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.