Skip to content

docs: pre-provisioning embed users via the embed-tenant admin API - #11695

Open
keydunov wants to merge 1 commit into
masterfrom
claude/gallant-ramanujan-k1zjuz
Open

docs: pre-provisioning embed users via the embed-tenant admin API#11695
keydunov wants to merge 1 commit into
masterfrom
claude/gallant-ramanujan-k1zjuz

Conversation

@keydunov

Copy link
Copy Markdown
Member

Check List

  • Docs have been added / updated if required
  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet

Description of Changes Made

cubejs-enterprise#14458 added two new admin endpoints for provisioning embed users ahead of their first session:

POST /api/v1/embed-tenants/{embedTenantName}/user
POST /api/v1/embed-tenants/{embedTenantName}/users

These were never documented — the Generate Session reference page only listed the groups/user-attributes admin endpoints in its "Embed-tenant admin API" section. This adds a short "Provisioning users ahead of a session" subsection describing the request fields, idempotent/desired-state semantics, and the bulk endpoint's partial-success response shape, following the existing style on the page.


Generated by Claude Code

cubejs-enterprise#14458 added POST /embed-tenants/{embedTenantName}/user
and its bulk sibling so embed users can be provisioned before their first
session, but the endpoints were never added to the Generate Session
reference alongside the existing groups/user-attributes admin endpoints.
@mintlify

mintlify Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cubed3 🟢 Ready View Preview Aug 29, 2026, 12:13 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@claude

claude Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keydunov's task in 1m 19s —— View job


Review complete — docs-only change, no blockers. 4 issues (2 medium, 2 low), all posted inline.

Full review
  • Read the diff against origin/master
  • Read surrounding page structure and conventions (docs-mintlify/CLAUDE.md)
  • Verify field names against the rest of the page
  • Check for stale prior review threads (none exist on this PR)
  • Post findings

What's good

The addition lands in the right file and the right section, follows the page's existing voice, and the semantics it documents are the ones readers actually get wrong — idempotency on externalId, per-lane replace/omit/[] behavior, and the explicit "provisioning changes who a user is, never what their session grants" boundary. The bulk endpoint's partial-success contract is exactly the kind of thing that belongs in reference docs and is usually missing.

Nothing security- or performance-relevant here; no code, tests, or navigation changes are implicated (this extends an existing page already registered in docs.json).

Findings

# Severity Location Issue
1 Medium generate-session.mdx:294 tenantGroups is presented as one of "the same identity fields as generate-session" but is documented nowhere else on the page — not in the Request Body table, not in prose. Undefined term for the reader.
2 Medium generate-session.mdx:288-292 GET .../users is listed but never described, and isn't among the endpoints the PR description says were added. Also ordered before the POSTs while the prose covers single → bulk.
3 Low generate-session.mdx:296 New subsection is inserted immediately above ### Response, which documents the generate-session response — now easily misread as the provisioning endpoints' response. Single-user POST response is undocumented.
4 Low generate-session.mdx:294-296 userAttributes omitted from the field list with no statement either way; "the account's bulk-action limit" is unactionable (no value, no link, no over-limit behavior).

Note on verification

The endpoint behavior described here originates in cubejs-enterprise#14458, which isn't in this repo — I could not confirm the request/response contracts, the existence of GET .../users, or the tenantGroups field name against source. Findings 1 and 2 are flagged partly on that basis and need a look from someone with access to that PR.

· Branch: `claude/gallant-ramanujan-k1zjuz`

POST /api/v1/embed-tenants/{embedTenantName}/users
```

The single-user endpoint takes the same identity fields as `generate-session` — `externalId`, `email`, `userProfile`, `groups`, `tenantGroups` — and is idempotent: provisioning an `externalId` that already exists updates it rather than failing. Each `groups`/`tenantGroups` lane is replaced when supplied, left untouched when omitted, and cleared with `[]`. A later session for the same `externalId` still applies whatever it carries, so provisioning only changes who a user is, never what their session grants.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tenantGroups is described here as one of "the same identity fields as generate-session", but it appears nowhere else on this page — the Request Body table (lines 33–53) documents externalId, email, userProfile, groups, userAttributes, etc., and never tenantGroups. A reader hits an undefined term with no way to learn what it means or how it differs from groups, and the "same fields as generate-session" framing is inaccurate as the page currently stands.

Either document tenantGroups in the Request Body table (if generate-session accepts it) or describe it inline here as a provisioning-only field.

Fix this →

Comment on lines +288 to +292
```text
GET /api/v1/embed-tenants/{embedTenantName}/users
POST /api/v1/embed-tenants/{embedTenantName}/user
POST /api/v1/embed-tenants/{embedTenantName}/users
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things about this block:

  1. GET /api/v1/embed-tenants/{embedTenantName}/users isn't mentioned in the PR description (which cites only the two POST endpoints from cubejs-enterprise#14458) and no prose below describes it — no response shape, and it's ambiguous whether the cursor-pagination sentence at line 282 (which precedes this subsection and refers to the groups/user-attributes lists) applies to it. Worth confirming it exists and, if it does, saying so explicitly.
  2. Listing order doesn't match the prose: the paragraphs discuss single-user then bulk, but GET leads. Reordering to POST .../user, POST .../users, GET .../users would track the narrative.


The single-user endpoint takes the same identity fields as `generate-session` — `externalId`, `email`, `userProfile`, `groups`, `tenantGroups` — and is idempotent: provisioning an `externalId` that already exists updates it rather than failing. Each `groups`/`tenantGroups` lane is replaced when supplied, left untouched when omitted, and cleared with `[]`. A later session for the same `externalId` still applies whatever it carries, so provisioning only changes who a user is, never what their session grants.

The bulk endpoint accepts a `users` array (up to the account's bulk-action limit) and is partially successful: it returns `200` with a `succeeded` list and a `failed` list (each entry carrying the `externalId` and the error the single-user call would have returned), rather than failing the whole batch over one bad entry.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new subsection is inserted directly above ### Response (line 298), which documents the generate-session response ({ "sessionId": "..." }). That heading was already sitting oddly under the ## Embed-tenant admin API H2, but this insertion makes the misreading much more likely: a reader finishes the bulk-provisioning paragraph, sees "### Response — The API returns a session object", and concludes the provisioning endpoints return a session.

Consider moving ### Response back up under the generate-session part of the page (or promoting it), so the admin-API section ends cleanly.

Related: the single-user POST response isn't documented at all here — only the bulk endpoint's shape is. Worth stating the status code and body it returns.

Comment on lines +294 to +296
The single-user endpoint takes the same identity fields as `generate-session` — `externalId`, `email`, `userProfile`, `groups`, `tenantGroups` — and is idempotent: provisioning an `externalId` that already exists updates it rather than failing. Each `groups`/`tenantGroups` lane is replaced when supplied, left untouched when omitted, and cleared with `[]`. A later session for the same `externalId` still applies whatever it carries, so provisioning only changes who a user is, never what their session grants.

The bulk endpoint accepts a `users` array (up to the account's bulk-action limit) and is partially successful: it returns `200` with a `succeeded` list and a `failed` list (each entry carrying the `externalId` and the error the single-user call would have returned), rather than failing the whole batch over one bad entry.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two smaller gaps:

  • userAttributes is conspicuously absent from the identity-field list. It's a first-class generate-session field (line 44) and this very page's bootstrap example sets it, so readers will ask whether they can seed attribute values at provisioning time. State either way — silence reads as an oversight.
  • "up to the account's bulk-action limit" gives the reader nothing actionable: no number, no place to look it up, no indication of what happens on exceeding it (whole-request 400? partial?). Either quote the limit or link to where it's configured.

Style-wise, the rest of this page pairs each concept with a JSON/fetch example; a short request body for the bulk endpoint would fit the surrounding convention better than the two dense prose paragraphs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants