> ## 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.

# identity_not_found

> The requested identity was not found in Unkey. Verify the identity ID or external ID is correct and the identity exists in your workspace.

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

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

## What Happened?

This error occurs when you're trying to perform an operation on an identity that doesn't exist in the Unkey system. Identities in Unkey are used to represent users or entities that own or use API keys.

Common scenarios that trigger this error:

* Using an incorrect identity ID or external ID
* Referencing an identity that has been deleted
* Trying to update or get information about a non-existent identity
* Typos in identity identifiers

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

```bash theme={"theme":"kanagawa-wave"}
# Attempting to get a non-existent identity
curl -X POST https://api.unkey.com/v2/identities.getIdentity \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "identityId": "ident_nonexistent"
  }'
```

## How To Fix

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

1. Check the identity ID in your request for typos or formatting errors
2. List all identities in your workspace to find the correct ID
3. If the identity has been deleted, you may need to recreate it

If you need to create a new identity, use the `identities.createIdentity` endpoint:

```bash theme={"theme":"kanagawa-wave"}
curl -X POST https://api.unkey.com/v2/identities.createIdentity \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "externalId": "user_123",
    "meta": {
      "name": "John Doe",
      "email": "john@acme.com"
    }
  }'
```

## Common Mistakes

* **Incorrect identifiers**: Using wrong identity IDs or external IDs
* **Deleted identities**: Attempting to reference identities that have been removed
* **Case sensitivity**: External IDs might be case-sensitive
* **Workspace boundaries**: Trying to access identities from another workspace

## Related Errors

* [err:unkey:data:identity\_already\_exists](./identity_already_exists) - When trying to create an identity that already exists
* [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 perform operations on identities
