docs(sessions): replace repo/branch params with organizationId

Merged
SW
5mo ago
+4-26

Summary

Two cleanups in CreateSessionRequest (the body schema for POST /api/sessions):

  1. Drift cleanup: drop repoOwner, repoName, isNewBranch — these were documented but the api's Zod schema never accepted them. They were silently dropped by Zod's default non-strict parsing. Removing them so the docs reflect reality.
  2. Architectural cleanup: drop cloneUrl and branch. The api now derives the clone URL itself from auth context (via the unified recoupable/<accountId> naming introduced by recoupable/api#618), so the caller doesn't construct repo URLs anymore.

New shape:

{
  title?: string;
  organizationId?: string;  // uuid; omit for personal session
  sandboxType?: "vercel";
}

Contract

BodySession typeWorkspace repo
{}personalrecoupable/<auth.accountId> — ensured (created if missing)
{ organizationId }orgrecoupable/<organizationId> — ensured, with org-access validation

Paired changes

This docs PR represents the contract; the api PR enforcing it is incoming (will enforce the new Zod schema + forward organizationId to validateAuthContext). Once both ship, the Session response shape still includes branch, cloneUrl, repoOwner, repoName since those are columns on the row — only the request body schema is slimmed here.

Test plan

  • Mintlify preview renders CreateSessionRequest without the dropped fields
  • organizationId shows up with format: uuid description
  • No other MDX page references the dropped fields (verified via grep — only the Session response schema still names them, which is correct)

🤖 Generated with Claude Code


Summary by cubic

Simplified CreateSessionRequest to use only organizationId; the server now derives the workspace repo from auth. Also removed sandboxType since only vercel was supported.

  • Migration
    • Stop sending repoOwner, repoName, branch, cloneUrl, isNewBranch, sandboxType.
    • To create an org session, send organizationId (uuid). Omit it for a personal session. The server provisions or reuses recoupable/<organizationId> or recoupable/<accountId>.
    • Response fields remain unchanged.

Summary by CodeRabbit

  • Breaking Changes
    • Updated session creation behavior to support both personal and organization-based provisioning. Sessions now accept organizationId for organization context, with automatic repository workspace provisioning. Removed direct repository configuration fields; the service now handles repository URL generation internally.

Review Change Stack