From fb81881c96e2e81eb8ed6c10210accf8644befde Mon Sep 17 00:00:00 2001 From: romain-priour-lc Date: Mon, 29 Sep 2025 20:59:31 -0700 Subject: [PATCH 1/4] Add x-tenant-id header info in the API key section --- src/langsmith/administration-overview.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/langsmith/administration-overview.mdx b/src/langsmith/administration-overview.mdx index 246bf8334..666cae4d8 100644 --- a/src/langsmith/administration-overview.mdx +++ b/src/langsmith/administration-overview.mdx @@ -104,6 +104,13 @@ Service keys are similar to PATs, but are used to authenticate requests to the L Service keys are prefixed with `lsv2_sk_` + +Use the `X-Tenant-Id` header to specify the target workspace. + +- If the header is omitted, the request defaults to the workspace where the API key was created (unless the key is organization-scoped). +- When using an organization-scoped service key, you must include the `X-Tenant-Id` header for workspace-scoped resources; otherwise the request will return 403 Forbidden. + + To see how to create a service key or Personal Access Token, see the [setup guide](/langsmith/create-account-api-key) From 4377e1694beb938dd882eb6bcaf6100fe76f0f54 Mon Sep 17 00:00:00 2001 From: romain-priour-lc Date: Mon, 29 Sep 2025 21:06:19 -0700 Subject: [PATCH 2/4] improve wording --- src/langsmith/administration-overview.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/langsmith/administration-overview.mdx b/src/langsmith/administration-overview.mdx index 666cae4d8..e23caafe6 100644 --- a/src/langsmith/administration-overview.mdx +++ b/src/langsmith/administration-overview.mdx @@ -107,8 +107,8 @@ Service keys are prefixed with `lsv2_sk_` Use the `X-Tenant-Id` header to specify the target workspace. -- If the header is omitted, the request defaults to the workspace where the API key was created (unless the key is organization-scoped). -- When using an organization-scoped service key, you must include the `X-Tenant-Id` header for workspace-scoped resources; otherwise the request will return 403 Forbidden. +- When using PATs, if you don't provide this header, operations will default to the selected default workspace upon key creation. +- When using an organization-scoped service key, you must include the `X-Tenant-Id` header for workspace-scoped resources; otherwise the request will return `403 Forbidden`. From 3e44bc87939718b428acb2cd7a7dec3bafbd882b Mon Sep 17 00:00:00 2001 From: romain-priour-lc Date: Mon, 29 Sep 2025 21:06:58 -0700 Subject: [PATCH 3/4] re-word --- src/langsmith/administration-overview.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/langsmith/administration-overview.mdx b/src/langsmith/administration-overview.mdx index e23caafe6..288b703b7 100644 --- a/src/langsmith/administration-overview.mdx +++ b/src/langsmith/administration-overview.mdx @@ -107,7 +107,7 @@ Service keys are prefixed with `lsv2_sk_` Use the `X-Tenant-Id` header to specify the target workspace. -- When using PATs, if you don't provide this header, operations will default to the selected default workspace upon key creation. +- When using PATs, if you don't provide this header, operations will default to the default workspace that was selected when creating the key. - When using an organization-scoped service key, you must include the `X-Tenant-Id` header for workspace-scoped resources; otherwise the request will return `403 Forbidden`. From 4132f0f0bd9a6f8d75edfb3e3642038c9d4a0a87 Mon Sep 17 00:00:00 2001 From: Romain Priour Date: Wed, 1 Oct 2025 18:09:17 -0700 Subject: [PATCH 4/4] Review comment Co-authored-by: Kathryn May <44557882+katmayb@users.noreply.github.com> --- src/langsmith/administration-overview.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/langsmith/administration-overview.mdx b/src/langsmith/administration-overview.mdx index 288b703b7..d6407d51b 100644 --- a/src/langsmith/administration-overview.mdx +++ b/src/langsmith/administration-overview.mdx @@ -107,8 +107,8 @@ Service keys are prefixed with `lsv2_sk_` Use the `X-Tenant-Id` header to specify the target workspace. -- When using PATs, if you don't provide this header, operations will default to the default workspace that was selected when creating the key. -- When using an organization-scoped service key, you must include the `X-Tenant-Id` header for workspace-scoped resources; otherwise the request will return `403 Forbidden`. +- **When using PATs**: If this header is omitted, requests will run against the default workspace associated with the key. +- **When using organization-scoped service keys**: You must include the `X-Tenant-Id` header when accessing workspace-scoped resources. Without it, the request will fail with a `403 Forbidden` error.