Skip to content

docs: correct Coder Agents API paths and required organization_id - #28573

Closed
nickvigilante wants to merge 8 commits into
mainfrom
vigilante/docs-719-correct-coder-agents-api-paths-apiv2-apiexperimental-and
Closed

docs: correct Coder Agents API paths and required organization_id#28573
nickvigilante wants to merge 8 commits into
mainfrom
vigilante/docs-719-correct-coder-agents-api-paths-apiv2-apiexperimental-and

Conversation

@nickvigilante

@nickvigilante nickvigilante commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Coder Agents docs pointed API consumers at /api/v2/chats, but the entire chat surface is registered under /api/experimental. Every affected path is corrected, and the create-chat example in the getting started guide now includes the organization_id field that postChats requires.

  • Replace /api/v2/chats with /api/experimental/chats across docs/ai-coder/agents/, including the Tasks to Chats endpoint mapping table and all curl, websocat, and wss:// examples.
  • Add organization_id to the create-chat example in getting-started.md, with a note that the caller must be an organization member and can find the ID via GET /api/v2/organizations.
  • Generated files under docs/reference/ are untouched; they already use the experimental paths.

Linear: DOCS-719 https://linear.app/codercom/issue/DOCS-719

Analysis evidence

Route registration (coderd/coderd.go):

  • Line 1320: r.Route("/api/experimental", func(r chi.Router) { with the comment that experimental routes are not guaranteed to be stable.
  • Line 1474: r.Route("/chats", func(r chi.Router) { nested inside that experimental route, covering /, /watch, /files, /models (line 1437, registered at the experimental root as a default-organization shortcut), /config/*, /providers, /user-provider-configs, and /{chat}/... (/messages, /stream, /interrupt, /debug/runs, /debug/runs/{debugRun}).
  • The /api/v2 route block begins after the experimental block closes, so no /api/v2/chats route exists.
  • The cost endpoints referenced in spend-management.md (/cost/users, /cost/{user}/summary) were also registered under /api/experimental/chats when they existed (commit 1482cdd11b).

Required organization_id (coderd/exp_chats.go, postChats):

  • if req.OrganizationID == uuid.Nil returns 400 with Message: "organization_id is required.".
  • Membership is then validated with httpmw.UserAuthorization(ctx).HasOrganizationMembership(req.OrganizationID).
  • tasks-to-chats-migration.md already documented both the field and the membership rule, so the two pages are now consistent.

Validation: pnpm install --frozen-lockfile, pnpm run format-docs, and pnpm run lint-docs all run clean (0 errors, 499 files linted). Only the nine intended files are modified.

Generated by Coder Agents on behalf of @nickvigilante.


Stacked on #28482. This PR targets ethan/codagt-715-document-org-scoped-admin-configuration-for-agents and merges that branch in, resolving the shared edits (tasks-to-chats-migration.md endpoint table, getting-started.md system-prompt line, chat-debug-logging.md) by combining that PR's navigation and org-scoped models route with this PR's /api/experimental prefixes. Re-target to main after #28482 merges.

The chat surface mounts under /api/experimental, not /api/v2. Update every
Coder Agents doc that referenced /api/v2/chats, including the Tasks to Chats
endpoint mapping table and the curl and websocat examples.

Also add the required organization_id field to the create-chat example in the
getting started guide, matching the migration guide.
@linear-code

linear-code Bot commented Aug 25, 2026

Copy link
Copy Markdown

DOCS-719

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

Hold for #28482. That PR rewrites the same tasks-to-chats-migration.md endpoint table and touches the same getting-started.md lines, and it deliberately leaves the /api/v2/chats prefixes and the missing organization_id for this PR to fix. To avoid conflicting edits, this PR will rebase after #28482 merges, keeping its org-scoped models route (/api/experimental/organizations/{organization}/chats/models) in place of the legacy /chats/models shim used here.

Generated by Coder Agents on behalf of @nickvigilante.

ethanndickson and others added 6 commits August 25, 2026 15:49
Coder Agents settings now belong to an organization. Document the new
scope split, the permissions that control edit access, and the new
Organization settings section that holds model overrides.

Add a new "Organization scope" page. Update the models, getting started,
platform controls, MCP servers, advisor, architecture, and migration
pages for the new scope. Correct stale breadcrumbs and API routes.
…odel wording

Remove implementation details from the organization scope documentation.
Correct the Advisor and Virtual desktop locations to the Deployment
settings section. Correct the Add model and Add server button labels.
Replace the star action with the Default badge and the model form option.
Document that the first model of an organization becomes its default.
…oped-admin-configuration-for-agents' into vigilante/docs-719-correct-coder-agents-api-paths-apiv2-apiexperimental-and

# Conflicts:
#	docs/ai-coder/agents/getting-started.md
#	docs/ai-coder/agents/platform-controls/chat-debug-logging.md
#	docs/ai-coder/agents/tasks-to-chats-migration.md
@nickvigilante
nickvigilante changed the base branch from main to ethan/codagt-715-document-org-scoped-admin-configuration-for-agents August 25, 2026 16:20

Copy link
Copy Markdown
Contributor Author

Now stacked on #28482 per the plan above: base re-targeted to its branch, conflicts resolved in a merge commit (kept its org-scoped models route and Admin settings navigation, applied the /api/experimental prefixes on top). Will re-target to main once #28482 merges. Generated by Coder Agents on behalf of @nickvigilante.

Base automatically changed from ethan/codagt-715-document-org-scoped-admin-configuration-for-agents to main August 25, 2026 16:24
@nickvigilante
nickvigilante marked this pull request as ready for review August 25, 2026 16:41
@nickvigilante

Copy link
Copy Markdown
Contributor Author

@ethanndickson @mattvollmer I think Coder Agents (the tool used to construct this PR) thought that Coder Agents' API routes were not updated. Matt, I remember your PR where we updated the routes, so if this PR is garbage, just say so and I'll close it.

@ethanndickson

Copy link
Copy Markdown
Member

Yep pls close

…rrect-coder-agents-api-paths-apiv2-apiexperimental-and

# Conflicts:
#	docs/ai-coder/agents/getting-started.md
#	docs/ai-coder/agents/platform-controls/chat-debug-logging.md
#	docs/ai-coder/agents/tasks-to-chats-migration.md
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants