Authentication¶
OpenSkip uses two authentication methods: JWT tokens for interactive sessions and API keys for programmatic access.
Public vs Protected Endpoints¶
| Action | Authentication Required |
|---|---|
| Reading shows, episodes, timestamps | :material-close: No |
| Submitting timestamps | :material-check: Yes |
| Managing your account | :material-check: Yes |
| Admin operations | :material-check: Yes (Admin role) |
Registration¶
Invite Code Required
Registration requires a valid invite code. Contact an administrator to obtain one.
{
"username": "myusername",
"email": "user@example.com",
"password": "securepassword123",
"invite_code": "INVITE_CODE_HERE"
}
Response:
{
"id": 1,
"username": "myusername",
"email": "user@example.com",
"role": "contributor",
"is_active": true,
"is_approved": false,
"created_at": "2024-01-15T10:30:00Z"
}
Approval Required
New accounts require admin approval before you can log in. You'll receive a "pending approval" message until approved.
JWT Authentication¶
Login¶
Response:
Using the Token¶
Include the token in the Authorization header:
Token Expiration¶
JWT tokens expire after 24 hours. Request a new token by logging in again.
API Key Authentication¶
API keys are ideal for automated scripts and integrations.
Create an API Key¶
Requires JWT authentication first.
Permissions:
| Permission | Access Level |
|---|---|
read | Read-only access |
submit | Can submit timestamps |
moderate | Can review submissions (moderators only) |
Response:
{
"id": 1,
"key_prefix": "osk_abc1",
"name": "My Plex Plugin",
"permissions": "submit",
"is_active": true,
"created_at": "2024-01-15T10:30:00Z",
"api_key": "osk_abc123def456..."
}
Save Your API Key
The full API key is only shown once when created. Store it securely!
Using an API Key¶
Include the key in the X-API-Key header:
List Your API Keys¶
Revoke an API Key¶
Get Current User¶
Verify your authentication and get account details:
Response:
{
"id": 1,
"username": "myusername",
"email": "user@example.com",
"role": "contributor",
"is_active": true,
"is_approved": true,
"created_at": "2024-01-15T10:30:00Z"
}
User Roles¶
| Role | Capabilities |
|---|---|
contributor | Submit timestamps, manage own account |
moderator | Review and approve/reject submissions |
admin | Full access, manage users, generate invite codes |