> ## Documentation Index
> Fetch the complete documentation index at: https://unkey.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# api_not_found

> The requested API namespace was not found in Unkey. Verify the API ID is correct, the API exists in your workspace, and has not been deleted.

<Danger>err:unkey:data:api\_not\_found</Danger>

```json Example theme={"theme":"kanagawa-wave"}
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "The requested API could not be found",
    "status": 404,
    "title": "Not Found",
    "type": "https://unkey.com/docs/errors/unkey/data/api_not_found"
  }
}
```

## What Happened?

This error occurs when you're trying to perform an operation on an API that doesn't exist in the Unkey system. In Unkey, APIs are resources that you create to organize and manage your keys.

Common scenarios that trigger this error:

* Using an incorrect API ID in your requests
* Referencing an API that has been deleted
* Attempting to access an API in a workspace you don't have access to
* Typos in API names when using name-based lookups

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

```bash theme={"theme":"kanagawa-wave"}
# Attempting to create a key for a non-existent API
curl -X POST https://api.unkey.com/v2/keys.createKey \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "apiId": "api_nonexistent",
    "name": "hello world"
  }'
```

## How To Fix

Verify that you're using the correct API ID and that the API still exists in your workspace:

1. List all APIs in your workspace to find the correct ID
2. Check if the API has been deleted and recreate it if necessary
3. Verify you're working in the correct workspace
4. Ensure proper permissions to access the API

Here's how to list all APIs in your workspace:

```bash theme={"theme":"kanagawa-wave"}
curl -X POST https://api.unkey.com/v2/apis.listApis \
  -H "Authorization: Bearer unkey_YOUR_API_KEY"
```

If you need to create a new API, use the `apis.createApi` endpoint:

```bash theme={"theme":"kanagawa-wave"}
curl -X POST https://api.unkey.com/v2/apis.createApi \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "name": "My New API"
  }'
```

## Common Mistakes

* **Copy-paste errors**: Using incorrect API IDs from documentation examples
* **Deleted APIs**: Attempting to reference APIs that have been deleted
* **Environment confusion**: Looking for an API in production that only exists in development
* **Workspace boundaries**: Trying to access an API that exists in another workspace

## Related Errors

* [err:unkey:data:workspace\_not\_found](./workspace_not_found) - When the requested workspace doesn't exist
* [err:unkey:data:key\_not\_found](./key_not_found) - When the requested key doesn't exist
* [err:unkey:authorization:insufficient\_permissions](../authorization/insufficient_permissions) - When you don't have permission to access an API
