Authentication

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

  1. Get Credentials: Contact [email protected] for your Client ID and Client Secret
  2. Authenticate: Call /auth/login to receive a JWT access token
  3. Use Token: Include the token in the Authorization header 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