Authentication API
REST API endpoints for authentication, including Privy OAuth, wallet signatures, and API keys.
Authentication API
The Skillz Market API supports three authentication methods to cover different use cases.
Authentication Methods
| Method | Use Case | Header Format |
|---|---|---|
| Privy | Web dashboard (social + wallet login) | Authorization: Bearer <privy-token> |
| Wallet Signature | Legacy wallet-only auth | Authorization: Bearer <jwt> |
| API Key | SDK and programmatic access | Authorization: Bearer sk_... |
Privy Authentication
Social login users (Google, Twitter, Discord) and wallet users authenticate through Privy.
POST /auth/privy
Exchange a Privy access token for a Skillz Market JWT.
Request:
Response:
The response also sets HTTP-only cookies:
skillz_token- Access token (1 hour)skillz_refresh- Refresh token (7 days)
Wallet Signature Authentication
Direct wallet authentication without Privy.
POST /auth/challenge
Get a challenge message to sign with your wallet.
Request:
Response:
POST /auth/verify
Verify a signed challenge message.
Request:
Response:
Token Refresh
POST /auth/refresh
Refresh an expired access token using the refresh token cookie.
Request:
Response:
Logout
POST /auth/logout
Revoke the current session and clear cookies.
Request:
Response:
API Keys
API keys provide programmatic access without wallet signing on each request. Keys are prefixed with sk_ for creator keys and ck_ for consumer keys.
POST /auth/api-keys
Create a new API key.
Request:
Response:
GET /auth/api-keys
List all API keys for the authenticated user.
Request:
Response:
DELETE /auth/api-keys/:id
Revoke an API key.
Request:
Response:
Using API Keys
Once you have an API key, use it in the Authorization header:
API keys can be used for:
- Registering and updating skills
- Managing skill groups
- Any endpoint that requires creator authentication
Error Responses
All authentication endpoints return standard error responses:
| Status | Error | Description |
|---|---|---|
| 401 | Invalid token | Token is malformed or expired |
| 401 | Authentication required | No authentication provided |
| 403 | API key revoked | Key has been revoked |
| 429 | Rate limit exceeded | Too many requests |