Authentication
The Spreetail Channel Integration API uses JWT (JSON Web Token) Bearer token authentication. All API endpoints require a valid access token obtained through the /auth/login endpoint.
Quick Start
- Get Credentials: Contact [email protected] for your Client ID and Client Secret
- Authenticate: Call
/auth/loginto receive a JWT access token - Use Token: Include the token in the
Authorizationheader for all requests
Authentication Flow
# Step 1: Login
POST /auth/login
{
"client_id": "your-client-id",
"client_secret": "your-client-secret"
}
# Response
{
"success": true,
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 86400
}
}
# Step 2: Use Token
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Token Details
- Validity: 24 hours (86,400 seconds)
- Format: JWT Bearer token
- Header:
Authorization: Bearer <token>
Security Best Practices
- ✅ Cache tokens and reuse for their full validity period
- ✅ Store credentials securely (environment variables, secrets management)
- ✅ Never log or expose tokens
- ✅ Rotate credentials regularly
Learn More
- Complete Authentication Guide - Detailed authentication documentation
- Error Handling - How to handle authentication errors
- Best Practices - Security and token management best practices
