<!-- llms.txt: https://workos.com/llms.txt -->

# Identities

Represents [User](https://workos.com/docs/reference/authkit/user) identities obtained from external identity providers.

When a user authenticates using an external provider like [Google OAuth](https://workos.com/docs/integrations/google-oauth), information from that provider will be made available as one of the user's Identities. You can read more about the process in our [identity linking guide](https://workos.com/docs/authkit/identity-linking).

> Applications should check the `type` before making assumptions about the shape of the identity. Currently only `OAuth` identities are supported, but more types may be added in the future.

## Get user identities

Get a list of identities associated with the user. A user can have multiple associated identities after going through [identity linking](https://workos.com/docs/authkit/identity-linking). Currently only OAuth identities are supported. More provider types may be added in the future.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/user_management/users/user_01E4ZCR3C56J083X43JQXF3JK5/identities" \
  --header "Authorization: Bearer sk_example_123456789"
```

```js language="js" title="Request" tab="1"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

const identities = await workos.userManagement.getUserIdentities(
  'user_01E4ZCR3C56J083X43JQXF3JK5',
);
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.user_management.get_user_identities(id: "user_01E4ZCR3C56J083X43JQXF3JK5")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.user_management.get_user_identities(id_="user_01E4ZCR3C56J083X43JQXF3JK5")
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.UserManagement().GetIdentities(context.Background(), "user_01E4ZCR3C56J083X43JQXF3JK5")
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->userManagement()
    ->getUserIdentities(id: "user_01E4ZCR3C56J083X43JQXF3JK5");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.userManagement.getUserIdentities("user_01E4ZCR3C56J083X43JQXF3JK5");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.UserManagement.GetIdentitiesAsync("user_01E4ZCR3C56J083X43JQXF3JK5");
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .user_management()
        .get_user_identities("user_01E4ZCR3C56J083X43JQXF3JK5")
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
[
  {
    "idp_id": "4F42ABDE-1E44-4B66-824A-5F733C037A6D",
    "type": "OAuth",
    "provider": "MicrosoftOAuth"
  }
]
```

:::

### GET /user_management/users/{id}/identities

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the user. |