Skip to main content

Overview

API keys provide persistent authentication tokens for programmatic access to Jellyfin Server without requiring user credentials. They are designed for server-to-server communication, automation scripts, and third-party integrations.
API keys have administrator-level privileges and bypass normal user authentication. Store them securely and never expose them in client-side code, public repositories, or logs.

When to Use API Keys

API keys are ideal for:
  • Background Services - Long-running processes that need persistent access
  • Server Automation - Scripts for maintenance, backups, or administration
  • Third-Party Integrations - External services connecting to Jellyfin
  • CI/CD Pipelines - Automated testing or deployment workflows
  • Monitoring Tools - Health checks and metrics collection
For user-facing applications, use user authentication instead of API keys to maintain proper permission boundaries.

List API Keys

Retrieve all existing API keys.

Endpoint Details

GET
Retrieve all API keys
string
required
Must include a token with administrator privileges
Authorization Required: RequiresElevation (Administrator)

Response

array
Array of API key objects
integer
Total number of API keys
integer
Starting index (always 0)

Response Example

Create API Key

Create a new API key for an application.

Endpoint Details

POST
Create a new API key
string
required
Name of the application that will use this API key. Choose a descriptive name that identifies the purpose or service.
string
required
Must include a token with administrator privileges
Authorization Required: RequiresElevation (Administrator) Response: 204 No Content
The API key token is not returned in the response. After creating a key, call List API Keys to retrieve the newly generated token.

Complete Example: Create and Retrieve

Revoke API Key

Delete an API key to permanently revoke access.

Endpoint Details

DELETE
Revoke an API key
string
required
The access token to revoke (the API key itself)
string
required
Must include a token with administrator privileges
Authorization Required: RequiresElevation (Administrator) Response: 204 No Content
Revoking an API key is permanent and cannot be undone. Any services using the revoked key will immediately lose access.

Using API Keys

Once created, API keys work exactly like user access tokens and can be included in requests using any of these methods:
You can optionally include client information:

Method 2: Query Parameter

Method 3: Legacy Headers (if enabled)

API Key Permissions

API keys automatically have administrator-level privileges, granting access to:
  • All user data and content
  • Server configuration endpoints
  • User management operations
  • System administration functions
  • Library management
  • Plugin installation and configuration
There is no way to create limited-scope API keys. For applications that need restricted access, use user authentication with appropriate user permissions instead.

Security Best Practices

Secure Storage

Store API keys in environment variables, never in source code:
Use secret management services for production:
  • AWS Secrets Manager
  • Azure Key Vault
  • HashiCorp Vault
  • Kubernetes Secrets
If storing in config files:
  • Use restrictive file permissions (chmod 600)
  • Exclude from version control (.gitignore)
  • Encrypt sensitive configuration files

Access Control

  1. Descriptive Names - Use clear, descriptive app names that identify the purpose
  2. Minimal Keys - Create only as many keys as necessary
  3. Regular Audits - Periodically review and revoke unused keys
  4. Rotation Policy - Consider rotating keys on a schedule (quarterly/annually)
  5. Activity Monitoring - Monitor DateLastActivity to identify inactive keys

Network Security

  1. HTTPS Only - Always use HTTPS in production to encrypt API keys in transit
  2. Firewall Rules - Restrict API access to known IP addresses when possible
  3. VPN/Private Network - Consider using VPN or private networks for sensitive integrations
  4. Rate Limiting - Implement rate limiting on your services using API keys

Troubleshooting

Authentication Fails with API Key

Problem: Receiving 401 Unauthorized when using an API key Solutions:
  • Verify the API key hasn’t been revoked (check DateRevoked field)
  • Ensure the API key is being sent correctly in the Authorization header or query parameter
  • Check that legacy authorization is enabled if using X-Emby-Token headers
  • Confirm the API key string is complete and not truncated

Cannot Create API Key

Problem: Receiving 403 Forbidden when creating an API key Solutions:
  • Verify you’re authenticated with an administrator account
  • Check that your user has the “IsAdministrator” permission
  • Ensure the server has completed initial setup

API Key Not Listed After Creation

Problem: New API key doesn’t appear in the list Solutions:
  • Wait a moment and try listing again (database write may be async)
  • Verify the creation request returned 204 No Content
  • Check server logs for any database errors
  • Ensure you have permission to view all API keys

Example: Complete Integration

Here’s a complete example of managing API keys in a Python application:

Next Steps

Authentication Overview

Learn about user authentication and token management

System Endpoints

Use API keys to access system information