---
title: "Link Identity"
method: POST
path: "/api/v1/me/account/identity-links"
tags: ["account-erasure", "identity-links"]
---

# Link Identity

`POST /api/v1/me/account/identity-links`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/me/account/identity-links`
- Auth: none declared

Create an identity link: count another account as the same owner as
the session user. (A sign-in provider is attached with ``link-provider``.)

The proof is this browser session: the target must be one of the accounts
signed in on it, which each entered through its own sign-in, and both the
session user and the target must have proved their credential here within
``IDENTITY_LINK_SIGN_IN_WINDOW`` (#1803, #1818) — a link is symmetric, so a stale
sign-in on either side would let whoever holds an old session hand that
account's private contexts to another. Nothing is ever linked by an email
match (#481). An id that is not in the session answers 404 whether or not
such an account exists; freshness is checked only after that.

Either account may already be in a link set; the sets then merge, and
every account of both is audited and sent the ``ACCOUNT_LINKED`` notice
(#1875), not only the two named here.

Raises (via the global handler): 422 for the caller's own id, 404 for an
account not signed in here, 403 (``AUTH-305``) when either account has not
signed in within the window, 409 when the set would exceed its size cap.

## Headers

- `authorization` string, nullable

## Request body

- IdentityLinkTarget: Body for linking or unlinking an account.
  - `user_id` string, required

## Response `200`

Successful Response

- IdentityLinkStatusResponse: Returned by the link and unlink endpoints on success.
  - `status` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
