jackwener/OpenCLI · error · CommandExecutionError

Could not resolve board "${username}/${slug}" (does it exist

Error message

Could not resolve board "${username}/${slug}" (does it exist and do you own it?)

What it means

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.

Source

Thrown at clis/pinterest/utils.js:270

}

/** POST a /delete/ mutation; resolves once the request succeeds (data is usually null). */
export async function pinterestResourceDelete(page, resource, options, sourceUrl) {
  const { data } = await pinterestResourceFetch(page, resource, options, sourceUrl, 'delete');
  return data;
}

/**
 * Resolve a board ref to its numeric id (the write endpoints need the id, not the slug).
 * Pass `preloaded` — the board `resolveBoardTarget` already fetched — to skip the extra request.
 */
export async function resolveBoardId(page, username, slug, path, preloaded = null) {
  const board = preloaded && preloaded.id
    ? preloaded
    : (await pinterestResourceFetch(page, 'BoardResource', { username, slug, field_set_key: 'detailed' }, path)).data;
  const boardId = board && board.id;
  if (!boardId) {
    throw new CommandExecutionError(`Could not resolve board "${username}/${slug}" (does it exist and do you own it?)`);
  }
  return { boardId: String(boardId), board };
}

/**
 * Resolve a board argument to { username, slug, path }, accepting a full board URL,
 * <username>/<slug>, or a numeric board id (which BoardResource can look up directly).
 * Display names are deliberately not accepted: a name cannot say whose board it is.
 */
export async function resolveBoardTarget(page, raw) {
  const trimmed = String(raw ?? '').trim();
  if (!trimmed) throw new ArgumentError('board is required', 'Pass <username>/<slug>, a board URL, or a numeric board id');

  const direct = tryParseBoardRef(trimmed);
  if (direct) return { ...direct, board: null };

  if (!/^\d+$/.test(trimmed)) {
    throw new ArgumentError(

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the board exists by opening pinterest.com/<username>/<slug>/ in Chrome
  2. Use the exact slug from the board URL, not the display name
  3. Run user-boards to list boards and copy the correct id/slug
  4. Confirm you are logged in as the account that owns the board

Example fix

// before
await cmd.boardPins({ board: 'me/My Recipes!' });
// after
await cmd.boardPins({ board: 'me/my-recipes' });
Defensive patterns

Strategy: validation

Validate before calling

if (!/^[^/]+\/[a-z0-9-]+$/.test(boardRef)) throw new Error(`Board ref must look like username/slug, got: ${boardRef}`);

Type guard

null

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/570e77a109d181c8. Report an issue: GitHub.