# Poll the sign-in status
URL: https://musicapi.com/docs/reference/get-sign-in-status.md

`GET https://api.musicapi.com/app/integrations/byUniqueId/{uniqueId}`

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

Poll this while a sign-in that you started with `uniqueId` runs. It needs no credentials: the `uniqueId` you chose is the secret. Send `tokenOnly=1` from a browser, so the answer never holds music-service credentials.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `uniqueId` | uuid | yes | The UUID v4 that you passed as `uniqueId` when you started the sign-in. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `tokenOnly` | boolean | no | Leave `authData` out of the answer. Default: `false`. |

## Response 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authModel` | AuthModel | yes |  |
| `authModel.uuid` | uuid | yes |  |
| `authModel.status` | string | yes | One of: initialised, success, error. |
| `authModel.error` | string \| null | yes |  |
| `authModel.errorType` | string \| null | yes | One of: accessDenied, notAllowedInYourCountry, missingScopes, deniedSubscriptionTier, null. |
| `oneTimeToken` | string \| null | yes | A one-time token for this login, when the login asked for one (`requestOneTimeToken=true`). |
| `integrationUser` | IntegrationUserWithAuthData \| null | yes | The connected user once the login succeeded. `authData` is present only when the login asked for a one-time token, the call has no `tokenOnly=1`, and the return URL is not an http(s) URL. |
| `integrationUser.uuid` | uuid | yes | The integrationUserUUID. Use it in every `/api/{integrationUserUUID}/...` call. |
| `integrationUser.integrationUserId` | string | yes | The user's id on the music service. |
| `integrationUser.name` | string \| null | yes |  |
| `integrationUser.email` | string \| null | yes |  |
| `integrationUser.imageUrl` | string \| null | yes |  |
| `integrationUser.country` | string \| null | yes | ISO 3166-1 alpha-2 country of the account, when the service tells us. |
| `integrationUser.authData` | object | no | The raw music-service credentials, without the refresh token. Only in answers to a Client Secret (Basic) or one-time-token call. |
| `integrationUser.authDataExpiresAt` | number \| null | no | When `authData` expires, in milliseconds since the epoch. |

```json
{
  "authModel": {
    "uuid": "5b0c6f0e-2c8a-4d0e-9a51-7e3f1c2d9b44",
    "status": "initialised",
    "error": "string",
    "errorType": "accessDenied"
  },
  "oneTimeToken": "string",
  "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",
    "authData": {},
    "authDataExpiresAt": 0
  }
}
```

## Errors

- 404: No sign-in with this uniqueId.

## Example

```bash
curl https://api.musicapi.com/app/integrations/byUniqueId/{uniqueId}
```
