English
Authentication & API Keys
StackVid supports two standard authentication mechanisms designed for server-to-server automation and web client access.
1. API Key Authentication (Recommended for Server / Scripts)
API Keys are ideal for backend workers, cron jobs, command-line scripts, and automation platforms like n8n or Make.
Key Format
- All API Keys start with the prefix:
tk_live_... - Only cryptographic SHA-256 hashes are stored in the database.
Usage in HTTP Requests
Include your API Key in the X-API-Key HTTP header:
bash
curl -X GET https://api.stackvid.dev/api/users/me \
-H "X-API-Key: tk_live_YOUR_KEY"typescript
import axios from 'axios';
const api = axios.create({
baseURL: 'https://api.stackvid.dev/api',
headers: {
'X-API-Key': process.env.STACKVID_API_KEY,
},
});python
import os
import requests
headers = {
'X-API-Key': os.getenv('STACKVID_API_KEY')
}
res = requests.get('https://api.stackvid.dev/api/users/me', headers=headers)2. Bearer JWT Token (For Web Applications)
When authenticating via username/password on the frontend, the system returns a signed JWT accessToken.
Usage:
Pass the token in the Authorization header:
http
Authorization: Bearer eyJhbG...c...Token lifetime and renewal
The accessToken is valid for 1 hour. Sign-in also returns a refreshToken — keep it secret, it renews the session:
bash
curl -X POST https://api.stackvid.dev/api/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refreshToken": "YOUR_REFRESH_TOKEN"}'The response carries a new accessToken and a new refreshToken: each refresh token works once, so always store the one you just received. Presenting an old one again ends the whole session (it means someone else may hold a copy) and you must sign in again.
- A refresh token expires after 14 days without use, and 30 days after sign-in at the latest.
- Signing out (
POST /api/auth/logoutwith the same body), changing or resetting the password, and account suspension revoke it. - For long-running servers and scripts prefer an API key (section 1): it does not expire every hour.
3. Managing API Keys via Dashboard
You can generate, copy, and revoke API keys directly from the Dashboard → API Keys (/api-keys) user interface:

- Create: Enter a friendly identifier (e.g.
Production Serverorn8n Worker) and click Generate Key. Make sure to copy your secret key immediately as it is only displayed once for security. - Expiry: You can set a lifetime in days when creating a key (
expiresInDays). Leave it empty for a key that never expires — but for an integration with a known end, setting one is the safer default. - Revoke: Click Revoke next to any compromised or unused key to invalidate it immediately.
- Any revoked or expired key is rejected on subsequent API requests with a
401 Unauthorizedstatus code. - Limit: Each account may hold at most 10 active API keys. Revoke an old one before creating another.
A Runner token is not an API key
The Chrome extension's token (Flow Video Suite → Runner Fleet) looks like an API key — same tk_live_ prefix — but it is a separate kind of credential: it is used only to join the runner fleet and cannot call the REST API.
The reverse holds too: an API key cannot register as a runner. Each account keeps one active runner token; pressing Regenerate token disables the previous one immediately, which is also how you cut off a machine you no longer control.