diff --git a/apps/web/app/api/dashboard/documents/[docId]/sections/[sectionId]/route.ts b/apps/web/app/api/dashboard/documents/[docId]/sections/[sectionId]/route.ts index 14d03be..98021f0 100644 --- a/apps/web/app/api/dashboard/documents/[docId]/sections/[sectionId]/route.ts +++ b/apps/web/app/api/dashboard/documents/[docId]/sections/[sectionId]/route.ts @@ -5,10 +5,11 @@ export async function GET( _request: NextRequest, { params }: { params: Promise<{ docId: string; sectionId: string }> }, ) { - const { docId, sectionId } = await params; - const { ok, status, data } = await forwardToCP( - `/v1/documents/${docId}/sections/${sectionId}`, - ); + // The engine exposes sections at the flat /v1/sections/{id} path (scoped + // by the org header), not nested under the document. docId is only part + // of the dashboard URL/breadcrumb. + const { sectionId } = await params; + const { ok, status, data } = await forwardToCP(`/v1/sections/${sectionId}`); if (!ok) { return NextResponse.json(data ?? { error: "Upstream error" }, { status }); }