Opentrace uses Clerk for authentication. All API requests require a valid Bearer token.
Include the JWT token in the Authorization header:
curl -X GET https://api.opentrace.online/api/projects \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"The backend uses Clerk's verification middleware to validate tokens. Every API endpoint (except health checks) requires authentication. Invalid or expired tokens return:
{
"detail": "Unauthorized"
}HTTP Status: 401 Unauthorized
Tokens are short-lived and automatically refreshed by the Clerk frontend SDK. You don't need to manage token refresh manually if using the Opentrace web app.
When a user signs in for the first time, a Clerk webhook automatically provisions them in the Opentrace database. The webhook is triggered on the user.created event and creates a row in the users table with the Clerk user ID and email.