Authentication
The Shinzo Platform API uses multiple authentication methods depending on the type of operation. This guide covers all authentication types, their use cases, and security best practices.
Authentication Methods
1. JWT Tokens (User Authentication)
Purpose: Authenticating users for dashboard and management API access.
JWT tokens are issued when users log in via email/password or OAuth. They provide access to user-specific resources and management endpoints.
Response:
Token expiration: 24 hours
Header format:
2. Ingest Tokens (Telemetry)
Purpose: Sending telemetry data from your MCP servers via the SDKs.
Ingest tokens are designed for use with the Shinzo SDKs and telemetry ingestion endpoints. They have write-only permissions for telemetry data.
Header format:
Purpose: Programmatic access to agent management, Spotlight analytics, and model proxy endpoints.
Platform API keys are designed for server-to-server communication, CI/CD pipelines, and automated workflows. They support authentication via multiple header formats.
Key format: sk_shinzo_*
Generating Tokens
JWT Tokens
JWT tokens are obtained by logging in:
- Email/Password:
POST /auth/login
- Google OAuth:
GET /auth/oauth/google then POST /auth/oauth/google/callback
- GitHub OAuth:
GET /auth/oauth/github then POST /auth/oauth/github/callback
Ingest Tokens
Generate ingest tokens via API (requires JWT authentication):
Or from your Shinzo Platform dashboard under Settings > Tokens.
Create platform API keys via API (requires JWT authentication):
Or from your dashboard under Settings > API Keys.
Tokens and API keys are only displayed once at creation. Store them securely as they cannot be retrieved later.
Endpoint Authentication Requirements
Security Best Practices
Environment Variables
Never hardcode tokens in your source code. Use environment variables:
Token Rotation
Regularly rotate tokens to minimize the impact of potential leaks:
- Create a new token/key with the same permissions
- Update your applications to use the new token
- Verify the new token is working
- Revoke the old token
Least Privilege
- Use ingest tokens for SDK telemetry only
- Use platform API keys for server-to-server communication
- Create separate tokens for different environments (dev, staging, prod)
Monitoring
Monitor token usage in your dashboard:
- Review
last_used_at timestamps
- Investigate unused tokens
- Revoke tokens that are no longer needed
Error Responses
Invalid Token
Status Code: 401 Unauthorized
Missing Token
Status Code: 401 Unauthorized
Email Not Verified
Status Code: 403 Forbidden
Feature Not Enabled
Status Code: 403 Forbidden