---
title: "Update a sub-key (active / scopes / childLabel)"
method: PATCH
path: "/api/v1/organizations/{id}/keys/{keyId}"
tags: ["Multi-tenancy"]
---

# Update a sub-key (active / scopes / childLabel)

`PATCH /api/v1/organizations/{id}/keys/{keyId}`

## Request

- Base URL: `https://legal.nexusquantum.legal`
- URL: `https://legal.nexusquantum.legal/api/v1/organizations/{id}/keys/{keyId}`
- Auth: HTTP bearer

The master cannot be modified from this route (it will return 409). For the master use `/api/developer/keys/{id}`.

## Path parameters

- `id` string, uuid, required
- `keyId` string, uuid, required

## Request body

- object
  - `active` boolean
  - `scopes` string[]
  - `childLabel` string

## Response `200`

Sub-key updated.

- object
  - `api_key` OrgKey
    - `id` string, uuid
    - `name` string
    - `key_prefix` string: First 12 chars (nlk_xxxxxxxx). The rest is NOT exposed.
    - `role` 'solo' | 'master' | 'child'
    - `child_label` string, nullable
    - `scopes` string[]
    - `tier` 'standard' | 'premium' | 'enterprise'
    - `rate_limit_rpm` integer
    - `active` boolean
    - `created_at` string, date-time
    - `last_used_at` string, date-time, nullable
    - `expires_at` string, date-time, nullable

## Other responses

- `403`: You are not master of this org.
- `409`: You tried to mutate the master from this route. Use `/api/developer/keys/{id}`.

---

[API](https://skmtc.dev/nexusquantum/apis/nexus-legal-api.md) · [All operations](https://skmtc.dev/nexusquantum/apis/nexus-legal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nexusquantum/apis/nexus-legal-api/revisions/4084d8d4eb0b?raw)
