---
title: "Update Org Service Key"
method: PATCH
path: "/api/v1/orgs/current/service-keys/{api_key_id}"
tags: ["orgs"]
---

# Update Org Service Key

`PATCH /api/v1/orgs/current/service-keys/{api_key_id}`

## Request

- Base URL: `https://api.smith.langchain.com`
- URL: `https://api.smith.langchain.com/api/v1/orgs/current/service-keys/{api_key_id}`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `X-Organization-Id`
  - HTTP bearer

Update an API key's role(s) in place without rotating the key.

Organization Operators cannot assign the Organization Admin role or change
a key that already holds it, and no key can change its own roles.
Workspace-scoped keys also require key-management permission in every
workspace they cover. Applies to both org-scoped and workspace-scoped keys.

## Path parameters

- `api_key_id` string, uuid, required

## Request body

- APIKeyUpdateRequest: API key PATCH schema. role_id: New workspace-level role to apply to every workspace identity attached to the key. Optional; omit to leave workspace roles unchanged. org_role_id: New org-level role to apply to the key's org identity. Workspace-scoped keys accept only the built-in ORGANIZATION_VIEWER or ORGANIZATION_RESTRICTED role. Optional; omit to leave the organization role unchanged.
  - `role_id` string, uuid, nullable
  - `org_role_id` string, uuid, nullable

## Response `200`

Successful Response

- APIKeyGetResponse: API key GET schema. role_id, org_role_id, and access_scope let clients render the key's current role state without a second round trip. For workspace-scoped service keys, org_role_id comes from the parent organization identity.
  - `created_at` string, date-time, nullable
  - `id` string, uuid, required
  - `short_key` string, required
  - `description` string, required
  - `read_only` boolean
  - `last_used_at` string, date-time, nullable
  - `expires_at` string, date-time, nullable
  - `revoked_at` string, date-time, nullable
  - `workspace_names` string[], nullable
  - `default_workspace_name` string, nullable
  - `role_id` string, uuid, nullable
  - `org_role_id` string, uuid, nullable
  - `access_scope` 'organization' | 'workspace'
  - `created_by` string, nullable
  - `is_tracing_key` boolean
  - `workspace_ids` string[]
  - `can_delete` boolean: Whether tracing-key deletion authority has been confirmed. Legacy key responses do not evaluate this capability.

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `1a8ee9358d81`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/api/v1/orgs/current/service-keys/:api_key_id/patch.md)

---

[API](https://skmtc.dev/langchain-ai/apis/langsmith.md) - [All operations](https://skmtc.dev/langchain-ai/apis/langsmith/llms.txt) - [OpenAPI document](https://skmtc.dev/langchain-ai/apis/langsmith/revisions/7a01c01f75e8?raw)
