Overview
The Teak API uses Bearer token authentication with API keys. Each API key is tied to your user account and provides full access to your personal knowledge hub.Generating API Keys
You can generate an API key from your Teak settings:- Navigate to Settings in your Teak web app
- Go to the API Keys section
- Click Generate API Key
- Copy the generated key immediately - you won’t be able to see it again
Generating a new API key will automatically revoke any existing keys. Only one API key can be active per user at a time.
API Key Format
API keys follow this format:- Prefix: A 12-character hex identifier (6 bytes)
- Secret: A 48-character hex secret (24 bytes)
Example
Using API Keys
Include your API key in theAuthorization header of every request using the Bearer authentication scheme:
Example cURL Request
Example JavaScript Request
Example Python Request
API Key Security
Key Storage
API keys are securely hashed using SHA-256 with a server-side pepper before storage. The full key is only displayed once during generation.Key Revocation
API keys are automatically revoked when:- You generate a new API key
- You manually revoke the key from settings
- Your user account is deleted
401 Unauthorized response:
Authentication Errors
Missing Authorization Header
Status:401 Unauthorized
- The
Authorizationheader is missing - The header format is incorrect (not “Bearer [token]”)
- The token value is empty
Invalid API Key
Status:401 Unauthorized
- The API key format is incorrect
- The API key doesn’t exist in the database
- The API key has been revoked
- The associated user account no longer exists
Rate Limited
Status:429 Too Many Requests
API Key Metadata
You can view metadata about your active API key in the settings:- Name: Custom name for the key (defaults to “API Keys”)
- Key Prefix: First 12 characters for identification (e.g.,
a1b2c3d4e5f6••••••••) - Created At: When the key was generated
- Last Used At: Most recent API request timestamp
The
lastUsedAt timestamp is updated every time you make an authenticated API request.Access Levels
All API keys currently havefull_access permission, which allows:
- Creating new cards (text, links, images, etc.)
- Searching all cards
- Viewing and filtering favorites
- Full read/write access to your personal knowledge hub
More granular permission levels may be added in future releases.
Next Steps
API Overview
Learn about available endpoints and rate limits
Create Card Endpoint
Start creating cards via the API