{"record":{"id":"570e77a109d181c8","repo":"jackwener/OpenCLI","slug":"could-not-resolve-board-username-slug-doe-570e77","errorCode":null,"errorMessage":"Could not resolve board \"${username}/${slug}\" (does it exist and do you own it?)","messagePattern":"Could not resolve board \"(.+?)/(.+?)\" \\(does it exist and do you own it\\?\\)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/utils.js","lineNumber":270,"sourceCode":"}\n\n/** POST a /delete/ mutation; resolves once the request succeeds (data is usually null). */\nexport async function pinterestResourceDelete(page, resource, options, sourceUrl) {\n  const { data } = await pinterestResourceFetch(page, resource, options, sourceUrl, 'delete');\n  return data;\n}\n\n/**\n * Resolve a board ref to its numeric id (the write endpoints need the id, not the slug).\n * Pass `preloaded` — the board `resolveBoardTarget` already fetched — to skip the extra request.\n */\nexport async function resolveBoardId(page, username, slug, path, preloaded = null) {\n  const board = preloaded && preloaded.id\n    ? preloaded\n    : (await pinterestResourceFetch(page, 'BoardResource', { username, slug, field_set_key: 'detailed' }, path)).data;\n  const boardId = board && board.id;\n  if (!boardId) {\n    throw new CommandExecutionError(`Could not resolve board \"${username}/${slug}\" (does it exist and do you own it?)`);\n  }\n  return { boardId: String(boardId), board };\n}\n\n/**\n * Resolve a board argument to { username, slug, path }, accepting a full board URL,\n * <username>/<slug>, or a numeric board id (which BoardResource can look up directly).\n * Display names are deliberately not accepted: a name cannot say whose board it is.\n */\nexport async function resolveBoardTarget(page, raw) {\n  const trimmed = String(raw ?? '').trim();\n  if (!trimmed) throw new ArgumentError('board is required', 'Pass <username>/<slug>, a board URL, or a numeric board id');\n\n  const direct = tryParseBoardRef(trimmed);\n  if (direct) return { ...direct, board: null };\n\n  if (!/^\\d+$/.test(trimmed)) {\n    throw new ArgumentError(","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/utils.js#L252-L288","documentation":"resolveBoardId fetches BoardResource for username/slug and requires board.id in the response. When the payload has no id, the board likely doesn't exist or isn't owned by the logged-in user, so it throws CommandExecutionError naming the username/slug pair.","triggerScenarios":"Calling board commands with a username/slug that doesn't exist; slug casing/punctuation wrong (Pinterest slugs are lowercase, hyphenated); board belongs to another user; preloaded board object lacks an id; secret board not visible to the session.","commonSituations":"Typo in board slug; using the board display name ('My Recipes') instead of the slug ('my-recipes'); user renamed the board so the slug changed; querying another account's private board.","solutions":["Verify the board exists by opening pinterest.com/<username>/<slug>/ in Chrome","Use the exact slug from the board URL, not the display name","Run user-boards to list boards and copy the correct id/slug","Confirm you are logged in as the account that owns the board"],"exampleFix":"// before\nawait cmd.boardPins({ board: 'me/My Recipes!' });\n// after\nawait cmd.boardPins({ board: 'me/my-recipes' });","handlingStrategy":"validation","validationCode":"if (!/^[^/]+\\/[a-z0-9-]+$/.test(boardRef)) throw new Error(`Board ref must look like username/slug, got: ${boardRef}`);","typeGuard":"null","tryCatchPattern":"try { const { boardId } = await cmd.resolveBoard(b); } catch (e) { if (/Could not resolve board/.test(e.message)) { console.error(`Board '${b}' not found or not yours — check the URL slug.`); } else throw e; }","preventionTips":["Use the exact slug from the board's URL, never the display name","List boards with user-boards and copy the id","Verify you're logged in as the board owner for private boards","Watch for slug changes after board renames"],"tags":["board-resolution","not-found","pinterest"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}