docs: document the Sessions HTTP API (reference, channels, scopes)#3942
Conversation
Adds the Sessions API to the formal API reference: create/list/retrieve/update/close (OpenAPI spec + management/sessions pages), a reference page for the .in/.out realtime channel HTTP endpoints, and a session-scopes section in the authentication docs. Cross-linked with the conceptual ai-chat/sessions page. Documents the shipped HTTP contract for non-SDK and server-to-server callers.
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
WalkthroughThis PR adds a complete Sessions API to the OpenAPI spec with five new path operations (create, list, retrieve, update, close) and eight new component schemas plus three reusable parameters. Corresponding MDX stub pages are created for each operation and wired into the 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
From bot review of the Sessions API docs: - externalId is read-only after create (cannot be changed or cleared, it keys the durable streams and token scope). Drop the "null clears it" claim from the OpenAPI spec and the ai-chat/sessions page. - List sessions uses a sessions-specific pagination parameter (min 1, default 20) instead of the shared runs one (min 10, default 25, "runs per page"). - read:sessions grants listing the session's runs, not listing sessions.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 3b1b2539-2ec6-4ed3-9ea1-d4851604658d
📒 Files selected for processing (3)
docs/ai-chat/sessions.mdxdocs/management/authentication.mdxdocs/v3-openapi.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/management/authentication.mdx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
docs/**/*.mdx
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/**/*.mdx: MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format
Use Mintlify components for structured content: , , , , , , /, /
Always import from@trigger.dev/sdkin code examples (never from@trigger.dev/sdk/v3)
Code examples must be complete and runnable where possible
Use language tags in code fences:typescript,bash,json
Files:
docs/ai-chat/sessions.mdx
🧠 Learnings (2)
📚 Learning: 2026-03-10T12:44:14.176Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3200
File: docs/config/config-file.mdx:353-368
Timestamp: 2026-03-10T12:44:14.176Z
Learning: In the trigger.dev repo, docs PRs are often companions to implementation PRs. When reviewing docs PRs (MDX files under docs/), check the PR description for any companion/related PR references and verify that the documented features exist in those companion PRs before flagging missing implementations. This ensures docs stay in sync with code changes across related PRs.
Applied to files:
docs/ai-chat/sessions.mdx
📚 Learning: 2026-04-30T20:30:29.458Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3226
File: docs/ai-chat/quick-start.mdx:13-13
Timestamp: 2026-04-30T20:30:29.458Z
Learning: In this repo’s documentation MDX files (`docs/**/*.mdx`), use `ts` and `tsx` (not `typescript`) as the code-fence language tags for TypeScript/TSX snippets. Do not flag `ts`/`tsx` code-fence language tags as incorrect in any docs MDX file, since this is the site-wide Mintlify-compatible convention.
Applied to files:
docs/ai-chat/sessions.mdx
🪛 LanguageTool
docs/ai-chat/sessions.mdx
[grammar] ~141-~141: Ensure spelling is correct
Context: ...ession. externalId is read-only after create: it cannot be changed or cleared (it key...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (4)
docs/v3-openapi.yaml (2)
3353-3353: LGTM!Also applies to: 3580-3603
3433-3435: LGTM!Also applies to: 4421-4423
docs/ai-chat/sessions.mdx (2)
1-5: Frontmatter is complete and valid.All required fields (
title,description) and optional field (sidebarTitle) are present in YAML format.
29-315: Code examples are correctly formatted and use the right import sources.All TypeScript code examples use
tslanguage tags (per repo convention) and import from@trigger.dev/sdk, not@trigger.dev/sdk/v3. Examples are complete and illustrate the concepts clearly.
Summary
Documents the Sessions HTTP API for non-SDK and server-to-server callers, which until now appeared only in the conceptual ai-chat/sessions page.
What's covered
create/list/retrieve/update/closeadded to the OpenAPI spec and a new "Sessions API" group (management/sessions/*), mirroring the Runs API..in/.outrealtime HTTP endpoints (append, SSE read, records drain), the wire protocol,Last-Event-IDresume, and the per-direction auth boundary (.outappend is secret-key only).read:sessions:{id}/write:sessions:{id}in the authentication docs, with the capability boundary and the 1h token TTL.Cross-linked with the SDK-side
ai-chat/sessionspage. Verified by rendering each page on the Mintlify dev server.