API Reference
API Authentication
API Authentication
The Conseto API uses JWT tokens for authentication. All authenticated endpoints require a Bearer token in the Authorization header.
Getting a Token
bash
curl -X POST https://api.conseto.io/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "your@email.com",
"password": "your_password"
}'
# Response:
{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "uuid",
"email": "your@email.com",
"role": "user"
}
}Using the Token
bash
# Include in every authenticated request
curl https://api.conseto.io/api/clients \
-H "Authorization: Bearer YOUR_JWT_TOKEN"API Keys
For server-side SDKs, use your API key (found in Dashboard → Settings → Projects):
javascript
// Node.js SDK
const conseto = new Conseto({
clientId: 'conseto_yoursite_xxx',
apiKey: 'csk_your32hexcharkey'
});Security
Never expose your API key in client-side code. API keys are for server-to-server communication only.
Auth Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login | Login and get JWT token |
| POST | /api/auth/register | Create new account |
| POST | /api/auth/forgot-password | Request password reset email |
| POST | /api/auth/reset-password | Reset password with token |
| POST | /api/auth/resend-verification | Resend email verification |