Lesson 6 · Access and security

What is an API key?

An API key is a credential that unlocks authorized access to an API. It identifies the caller and helps the API decide whether the request is allowed, which account it belongs to, and how usage should be tracked.

The API key unlocks access to the API
💻
Your AppSends a request with an API key
APIChecks the key before allowing access
API ACCESS
🔑
ACCESS TO API GRANTED
Without the key, the API keeps the door closed.
With a valid key, the API unlocks access and the request can continue.
🪪

Identification

The key tells the API which customer, application, or account is requesting access.

🧱

Protection

Credentials help prevent anonymous use and can limit which capabilities a caller is authorized to access.

📏

Usage tracking

Keys make it possible to meter calls, apply quotas, monitor activity, and associate usage with an account.

Important: API keys should be treated like passwords. Do not publish them in public web pages, repositories, screenshots, or client-side code.

Quick check

Which is a safe practice?