Mintplex-Labs/anything-llm · error

Workspace slug is required

Error message

Workspace slug is required

What it means

Validation guard in the embed-anything API endpoint: the request body lacks a workspace_slug field, so the embed request has no target workspace and is rejected with 400 before the Workspace lookup.

Source

Thrown at server/endpoints/api/embed/index.js:266

            }
          }
        }
      }
      #swagger.responses[403] = {
        schema: {
          "$ref": "#/definitions/InvalidAPIKey"
        }
      }
      #swagger.responses[404] = {
        description: "Workspace not found"
      }
    */
    try {
      const data = reqBody(request);

      if (!data.workspace_slug)
        return response
          .status(400)
          .json({ error: "Workspace slug is required" });
      const workspace = await Workspace.get({
        slug: String(data.workspace_slug),
      });

      if (!workspace)
        return response.status(404).json({ error: "Workspace not found" });

      const { embed, message: error } = await EmbedConfig.new({
        ...data,
        workspace_id: workspace.id,
      });

      response.status(200).json({ embed, error });
    } catch (e) {
      console.error(e.message, e);
      response.sendStatus(500).end();
    }

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Pass a workspace slug in the request.
  2. Verify the slug matches an existing workspace.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/endpoints/api/embed/index.js:266 when the library encounters an invalid state.

Common situations: Calling an embed/workspace endpoint without the required workspace slug parameter.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/58a15b3554a7a76a. Report an issue: GitHub.