---
title: "POST /api/users/{user}/linkedIdentities"
method: POST
path: "/api/users/{user}/linkedIdentities"
tags: ["UserService"]
---

# POST /api/users/{user}/linkedIdentities

`POST /api/users/{user}/linkedIdentities`

## Request

- The document declares no server URL.
- Auth: none declared

CreateLinkedIdentity completes an OAuth flow and links the resulting SSO
 identity to the authenticated user, who must be the parent.

## Path parameters

- `user` string, required

## Request body

- CreateLinkedIdentityRequest: Request message for UserService.CreateLinkedIdentity.
  - `parent` string, required: Required. The user who owns the linked identity. Must be the caller. Format: users/{user}
  - `identityProvider` string, required: Required. The identity provider to link. Format: identity-providers/{idp}
  - `code` string, required: Required. The authorization code from the identity provider.
  - `redirectUri` string, required: Required. The redirect URI used in the OAuth flow.
  - `codeVerifier` string: Optional. The PKCE code verifier used in the OAuth flow.

## Response `200`

OK

- LinkedIdentity: LinkedIdentity is an SSO identity linked to a user account.
  - `name` string: Identifier. The resource name of the linked identity. {linked_identity} is the ID of the identity provider. Format: users/{user}/linkedIdentities/{linked_identity}
  - `identityProvider` string: Output only. The resource name of the identity provider. Format: identity-providers/{idp}
  - `externalUid` string: The external user identifier from the identity provider: the subject that signs in as this user. Set by signing in through the provider, or declared in a configuration file for a declared user.

## Other responses

- `default`: Default error response

## Changes

- **2026-10-31** `1593c4167dba`: 1 info
  - the response optional property `externalUid` became not read-only for the status `200`
- **2026-10-08** `1846a777b0ef`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/usememos/apis/untitled-api/changes/api/users/:user/linkedIdentities/post.md)

---

[API](https://skmtc.dev/usememos/apis/untitled-api.md) - [All operations](https://skmtc.dev/usememos/apis/untitled-api/llms.txt) - [OpenAPI document](https://skmtc.dev/usememos/apis/untitled-api/revisions/f587355e35b4?raw)
