Example
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "The requested workspace could not be found",
    "status": 404,
    "title": "Not Found",
    "type": "https://unkey.com/docs/api-reference/errors-v2/unkey/data/workspace_not_found"
  }
}

What Happened?

This error occurs when you’re trying to perform an operation on a workspace that doesn’t exist in the Unkey system. This can happen when referencing a workspace by ID or name in API calls.

Common scenarios that trigger this error:

  • Using an incorrect workspace ID
  • Referencing a workspace that has been deleted
  • Attempting to access a workspace you don’t have permission to see
  • Typos in workspace names when using name-based lookups

Here’s an example of a request that would trigger this error:

# Attempting to list keys in a non-existent workspace
curl -X POST https://api.unkey.com/v1/keys.listKeys \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "workspaceId": "ws_nonexistent"
  }'

How To Fix

Verify that you’re using the correct workspace ID or name and that the workspace still exists:

  1. Check your Unkey dashboard to see a list of workspaces you have access to
  2. Verify the workspace ID or name in your API calls
  3. Ensure you have permission to access the workspace
  4. If needed, create a new workspace through the dashboard or API

To find your correct workspace ID, you can:

# List workspaces you have access to
curl -X GET https://api.unkey.com/v1/workspaces.listWorkspaces \
  -H "Authorization: Bearer unkey_YOUR_API_KEY"

Common Mistakes

  • Deleted workspaces: Attempting to reference workspaces that have been deleted
  • Copy-paste errors: Using incorrect IDs from documentation examples
  • Permission issues: Trying to access workspaces you’ve been removed from
  • Case sensitivity: Using incorrect casing in workspace name lookups