---
title: "Set secret values on one owned node for a scope (names come back)"
method: POST
path: "/api/nodes/{node_id}/secrets/{service}"
tags: ["nodes"]
---

# Set secret values on one owned node for a scope (names come back)

`POST /api/nodes/{node_id}/secrets/{service}`

## 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/{node_id}/secrets/{service}`
- Auth: none declared

Forward one set to the node and answer with its key names (S2).

Set only; replacing is overwriting. CSRF and the rate limit gate it
(rule 6), standing and never the plan (D-NC8). The value is in
``payload`` and leaves this function only as the daemon request body:
it is never audited (rule 2), logged (rule 3), echoed (rule 4) or
retried (rule 5), and a refusal is the daemon's own words (rule 7).

## Path parameters

- `service` string, required
- `node_id` string, uuid, required

## Request body

- NodeSecretValuesWrite: S2: key → value, the values in this body and nowhere else (rule 1). ``hide_input_in_errors`` keeps a value out of any rendered ``ValidationError``, and every check below raises a sentence that names no key and no value: a value pasted into the key field must not come back in a 422 either. The 422 envelope drops ``input`` (``app.py``) but keeps ``loc``, which is why ``values`` is typed ``Any`` and checked here: a typed dict would put the failing key into the location.
  - `values` object, required

## Response `200`

Successful Response

- NodeSecretKeysView: Which keys one scope holds, by name, and whether the node was reachable. There is no value field and there is nowhere to put one: the daemon cannot return a value, and this cloud must not invent what it does not hold. The absence is the contract.
  - `online` boolean, required
  - `service` string, required
  - `keys` string[], required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable Content
- `429`: Too Many Requests
- `502`: Bad Gateway

---

[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)
