---
title: "Link a user account with the provider's account using an id token"
method: POST
path: "/link/idtoken"
tags: ["security"]
---

# Link a user account with the provider's account using an id token

`POST /link/idtoken`

Link the authenticated user's account with an external OAuth provider account using an ID token. Requires elevated permissions.

## Request body

- LinkIdTokenRequest
  - `provider` 'apple' | 'google', required
  - `idToken` string, required — Apple ID token
  - `nonce` string — Nonce used during sign in process

## Response `200`

Identity linked successfully

- 'OK'

## Other responses

- `default` — An error occurred while processing the request

## Changes

- **2025-10-09** `2bb5c4e40463` — 1 warning, 3 info
  - added the new `email-already-in-use` enum value to the `error` response property for the response status `default`
  - removed the `otp-too-many-attempts` enum value from the `error` response property for the response status `default`
  - removed the `provider-account-already-linked` enum value from the `error` response property for the response status `default`
  - removed the `user-already-exists` enum value from the `error` response property for the response status `default`

[Change history](https://skmtc.dev/nhost/apis/nhost-authentication-api/changes/link/idtoken/post.md)

---

[API](https://skmtc.dev/nhost/apis/nhost-authentication-api.md) · [All operations](https://skmtc.dev/nhost/apis/nhost-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nhost/nhost-authentication-api/revisions/2bb5c4e40463/schema)
