Create an API key
GET/api/videos
API keys provide secure access to the Flare API. Each key can be configured with specific scopes to limit access.
Creating a Key
- Navigate to Profile → API Keys in the Flare dashboard
- Click Create API Key
- Enter a descriptive name (e.g., "Production Server", "CI/CD Pipeline")
- Select the required scopes for your use case
- Click Create and copy your key immediately
Security Best Practices
- Keys are shown only once - Store them securely immediately after creation
- Use environment variables - Never commit API keys to version control
- Rotate regularly - Create new keys periodically and revoke old ones
- Minimum scopes - Only request the permissions you need
Key Format
Flare API keys use the format flr_pat_... to help you identify them in your code and logs.
Examples
# Store your API key in an environment variable
export FLARE_API_KEY="flr_pat_..."
# Use the variable in requests
curl https://flare.link/api/videos \
-H "Authorization: Bearer $FLARE_API_KEY"// Load API key from environment
const FLARE_API_KEY = process.env.FLARE_API_KEY;
// Create a reusable client
async function flareRequest(endpoint, options = {}) {
const res = await fetch(`https://flare.link${endpoint}`, {
...options,
headers: {
Authorization: `Bearer ${FLARE_API_KEY}`,
"Content-Type": "application/json",
...options.headers,
},
});
return res.json();
}
// List all videos
const { videos } = await flareRequest("/api/videos");import os
import requests
# Load API key from environment
FLARE_API_KEY = os.environ.get("FLARE_API_KEY")
# Create a session with default headers
session = requests.Session()
session.headers.update({
"Authorization": f"Bearer {FLARE_API_KEY}",
"Content-Type": "application/json"
})
# List all videos
res = session.get("https://flare.link/api/videos")
videos = res.json()["videos"]Expected response
{
"success": true,
"videos": [
{
"id": "vid_abc123",
"fileName": "product-demo.mp4",
"duration": 120,
"createdAt": "2025-01-15T10:30:00.000Z"
}
]
}