---
title: "API Keys - Xata"
description: "Generate and manage API keys for secure access to your Xata database"
source: "https://xata.io/docs/platform/api-key"
---

Skip to main content

![API Keys navigation overview](https://mintcdn.com/xata/PDDxPY9xptrEGBCP/images/platform/api-keys-nav.png?fit=max\&auto=format\&n=PDDxPY9xptrEGBCP\&q=85\&s=1879cbe2786539ab73a2d10a8385e684)

## ​Overview

API keys provide programmatic access to your Xata database without requiring user authentication. They’re essential for integrating Xata with your applications and automating database operations.

![API Keys overview interface](https://mintcdn.com/xata/PDDxPY9xptrEGBCP/images/platform/api-keys-overview.png?fit=max\&auto=format\&n=PDDxPY9xptrEGBCP\&q=85\&s=a00b47903349d93ce17199850bf6ee31)

## ​Scoping

Control what each key can access with granular permissions and restrictions.

![API Keys scoping interface](https://mintcdn.com/xata/PDDxPY9xptrEGBCP/images/platform/api-keys-scope.png?fit=max\&auto=format\&n=PDDxPY9xptrEGBCP\&q=85\&s=f62e1888cfc2cab30ab5fd4706aec250)

### ​Project and Branch Access

- **All projects and branches**: Full access across your organization
- **Specific branches**: Limited to selected development or production branches

### ​Functionality Access

Control access to specific platform features:

- **API keys**: Manage your API keys to authenticate requests to your organization
- **Organization**: Manage your organization settings and members
- **Organization deletion**: Submit a deletion request for an organization (`org:delete` scope)
- **Invitations**: Manage organization invitations to add new members
- **Project**: Manage your projects and their settings
- **Branch**: Manage your branches and their settings
- **Credentials**: Read and rotate database credentials for branches
- **Metrics**: View and manage your API usage metrics

## ​Access Control

- **No Access**: Keys with no access cannot perform any operations
- **Read-Only**: Keys with read-only access can only read or view
- **Read and Write**: Keys with read and write access have full access

### ​From the CLI

Create and manage API keys using the Xata CLI:

```
# Create a user API key
xata keys user create

# Create an organization API key
xata keys organization create

# List user API keys
xata keys user list

# List organization API keys
xata keys organization list
```

For more CLI commands, see the [CLI Reference](/docs/cli/keys).

Was this page helpful?

[Previous](/docs/platform/account)

[Organizations](/docs/platform/organization)

[Next](/docs/platform/organization)
