paperclipai/paperclip · error
Missing companyId in path. Use /api/companies/{companyId}/is
Error message
Missing companyId in path. Use /api/companies/{companyId}/issues. What it means
Path-shape diagnostic on GET /api/companies/issues: this route only exists to catch the common malformed URL where the companyId segment is empty, which lands the request on /issues instead of /companies/{companyId}/issues. It tells the caller to include the company id in the path.
Source
Thrown at server/src/routes/companies.ts:412
}
const allowed = new Set(req.actor.companyIds ?? []);
res.json(result.filter((company) => allowed.has(company.id)));
});
router.get("/stats", async (req, res) => {
assertBoard(req);
const allowed = req.actor.source === "local_implicit" || req.actor.isInstanceAdmin
? null
: new Set(req.actor.companyIds ?? []);
const stats = await svc.stats();
if (!allowed) {
res.json(stats);
return;
}
const filtered = Object.fromEntries(Object.entries(stats).filter(([companyId]) => allowed.has(companyId)));
res.json(filtered);
});
// Common malformed path when companyId is empty in "/api/companies/{companyId}/issues".
router.get("/issues", (_req, res) => {
res.status(400).json({
error: "Missing companyId in path. Use /api/companies/{companyId}/issues.",
});
});
router.get("/:companyId/artifacts", async (req, res) => {
const companyId = req.params.companyId as string;
assertCompanyAccess(req, companyId);
const query = companyArtifactsQuerySchema.parse(req.query);
res.json(await artifacts.list(companyId, query, {
userId: query.starred && req.actor.type === "board" ? req.actor.userId : undefined,
}));
});
router.get("/:companyId/timeline", async (req, res) => {
const companyId = req.params.companyId as string;View on GitHub (pinned to 01ad858492)
Solutions
- Include the required field(s) in the request path, query, or body as named by the error message, then retry.
- Check the API contract in packages/shared validators for the exact required shape of this endpoint.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/routes/companies.ts:380 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18).
Data as JSON: /api/errors/dfde84b2027690b2.
Report an issue: GitHub.