---
title: "Mint a link code for the signed-in account"
method: POST
path: "/api/nodes/link-codes"
tags: ["nodes"]
---

# Mint a link code for the signed-in account

`POST /api/nodes/link-codes`

## Request

- Base URL: `https://app.nerdit.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.nerdit.ai/api/nodes/link-codes`
- Auth: none declared

Issue a code, and the node row it names, to this session (D-LC1/D-LC2).

The plaintext is in the answer and nowhere else: the audit row records
the code's id, its node and its expiry, and passes the plaintext as a
forbidden value so that a future edit which interpolated it into the
metadata would fail loudly rather than ship a readable code in
``cloud_audit``.

## Request body

- LinkCodeMintRequest: Ask for a code, optionally naming the node it will link. ``node_id`` selects the reissue leg (D-LC4): the named node keeps its slug and its open codes are revoked, so a code the user lost is replaced rather than added to. Omitted — which is what the console sends — a new node row is minted with the code.
  - `name` string, nullable
  - `node_id` string, uuid, nullable

## Response `201`

Successful Response

- LinkCodeMintResponse: The one and only time the plaintext code leaves this deployment. Nothing stores it — the row holds ``sha256_hex`` alone — so this body is unrepeatable: a client that loses it revokes the code and mints another.
  - `code` string, required
  - `link_code_id` string, uuid, required
  - `expires_at` string, date-time, required
  - `node_id` string, uuid, required
  - `node_slug` string, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error

---

[API](https://skmtc.dev/nerdit/apis/nerdit-cloud-web.md) · [All operations](https://skmtc.dev/nerdit/apis/nerdit-cloud-web/llms.txt) · [OpenAPI document](https://skmtc.dev/nerdit/apis/nerdit-cloud-web/revisions/06e3b44b58be?raw)
