{"record":{"id":"a7cc91d4f5949656","repo":"paperclipai/paperclip","slug":"failed-to-create-board-api-key","errorCode":null,"errorMessage":"Failed to create board API key","messagePattern":"Failed to create board API key","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/token.ts","lineNumber":162,"sourceCode":"    board\n      .command(\"create\")\n      .description(\"Create a named board API key\")\n      .option(\"-C, --company-id <id>\", \"Company ID used for audit context\")\n      .option(\"--name <name>\", \"API key label\", \"cli-board\")\n      .option(\"--expires-at <iso8601>\", \"Expiration timestamp\")\n      .option(\"--ttl-days <days>\", \"Expiration in days from now\")\n      .option(\"--never-expires\", \"Create a non-expiring key\")\n      .action(async (opts: BoardTokenOptions) => {\n        try {\n          const ctx = resolveCommandContext(opts);\n          const expiresAt = resolveBoardKeyExpiresAt(opts);\n          const payload = createBoardApiKeySchema.parse({\n            name: opts.name,\n            requestedCompanyId: opts.companyId ?? ctx.companyId ?? null,\n            expiresAt,\n          });\n          const key = await ctx.api.post<CreatedBoardKey>(\"/api/board-api-keys\", payload);\n          if (!key) throw new Error(\"Failed to create board API key\");\n          printOutput({ key }, { json: ctx.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n    { includeCompany: false },\n  );\n\n  addCommonClientOptions(\n    board\n      .command(\"list\")\n      .description(\"List board API keys for the current board user\")\n      .action(async (opts: BaseClientOptions) => {\n        try {\n          const ctx = resolveCommandContext(opts);\n          const keys = (await ctx.api.get<BoardKeyRow[]>(\"/api/board-api-keys\")) ?? [];\n          if (ctx.json) {\n            printOutput(keys, { json: true });","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/token.ts#L144-L180","documentation":"token board create posted the board key creation and got a falsy result, so no key material is available to display/export; a sentinel guard on the API response.","triggerScenarios":"Thrown at cli/src/commands/client/token.ts:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify credentials and server reachability, then retry creating the board API key."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}