What are API Keys?
API keys in Tembo are authentication tokens that:- Authenticate requests to Tembo’s public API endpoints
- Belong to an organization and inherit that organization’s permissions
- Are secure - generated using cryptographically secure random tokens
- Can be revoked at any time for security
Creating API Keys
Through the Web Interface
- Navigate to Settings → API Keys in your Tembo dashboard
- Click “Create API Key”
- Copy the generated API key immediately - it won’t be shown again for security reasons
- Store the API key securely in your application or password manager
API keys are only displayed once after creation. Make sure to copy and store them securely before closing the creation dialog.
Key Limits
Each organization can have up to 10 active API keys at a time. If you need more, contact support.Using API Keys
Authentication Methods
You can authenticate API requests using your API key in two ways:Bearer Token (Recommended)
Include your API key in theAuthorization
header:
Query Parameter
Pass the API key as a query parameter:The Bearer token method is recommended as it’s more secure - query parameters can be logged in server access logs.
Available API Endpoints
API keys provide access to Tembo’s public API endpoints:Task Management
- Create Task:
POST /public-api/task/create
- List Tasks:
GET /public-api/task/list
- Search Tasks:
GET /public-api/task/search
Repository Management
- List Repositories:
GET /public-api/repository/list
Creating Tasks via API
Here’s how to create a new task using the API:Request Parameters
description
(string, required): A clear description of the taskjson
(string, required): Additional task metadata in JSON formatqueueRightAway
(boolean, optional): Whether to queue the task immediately (default: false)codeRepoIds
(array, optional): Array of repository IDs to associate with the taskbranch
(string, optional): Target branch for the task
Listing Tasks
Retrieve a paginated list of tasks for your organization:Query Parameters
limit
(number, optional): Number of tasks per page (1-100, default: 10)page
(number, optional): Page number (default: 1)
Searching Tasks
Search for tasks by title or description:Query Parameters
q
(string, required): Search query to match against task titles and descriptionslimit
(number, optional): Number of results per page (1-100, default: 10)page
(number, optional): Page number (default: 1)
Managing API Keys
Viewing Active Keys
In the Tembo dashboard, go to Settings → API Keys to see:- All active API keys for your organization
- Creation dates for each key
- Truncated key values (first and last 8 characters)
- Key status (Active/Revoked)
Revoking API Keys
To revoke an API key:- Go to Settings → API Keys
- Find the key you want to revoke
- Click the trash icon next to the key
- Confirm the revocation
Revoking an API key is immediate and irreversible. Any applications using the revoked key will stop working immediately.
Security Best Practices
Storage
- Never commit API keys to version control
- Use environment variables to store API keys in applications
- Use secure credential management systems in production environments
Rotation
- Rotate API keys regularly as part of your security practices
- Create new keys before revoking old ones to prevent service interruptions
- Audit key usage periodically to ensure only necessary keys are active
Access Control
- Use separate keys for different applications or environments
- Revoke unused keys immediately
- Monitor API key usage through your application logs
Example Integrations
Node.js
Python
cURL Script
Troubleshooting
Common Issues
401 Unauthorized- Verify your API key is correct and hasn’t been revoked
- Ensure you’re using the correct authentication method
- Check that your organization has access to the API
- Validate your request payload matches the expected format
- Ensure required fields are included
- Check that JSON is properly formatted
- API keys may be subject to rate limiting
- Implement exponential backoff in your applications
- Contact support if you need higher rate limits
Getting Help
If you’re having trouble with API keys:- Check the Tembo dashboard to verify your key is active
- Review the API endpoint documentation
- Contact support at hi@tembo.io
Next Steps
- Set up integrations to connect your repositories
- Learn about pull request automation
- Configure webhooks for real-time updates