Overview
The Shipstar API uses Bearer token authentication. There are two types of tokens depending on which API you’re using:| API | Token Type | How to Get |
|---|---|---|
Internal API (/api/internal/) | JWT session token | Login via /api/internal/auth/jwt/login |
Public API (/api/v1/me) | API key | Create in the Dashboard |
Public content (/api/v1/changelogs, /api/v1/blogs, etc.) | None required | Publicly accessible |
API Key Authentication
API keys are used for programmatic access to the Shipstar API. Include your key in theAuthorization header:
Creating API Keys
Sign In
Go to app.shipstar.ai and sign in to your account.
API Key Details
- Keys are hashed with SHA-256 before storage — Shipstar never stores your raw key
- Each key tracks a
last_used_attimestamp - Keys can have an optional expiration date
- Keys can be deactivated without deletion
JWT Session Authentication
The internal API (dashboard endpoints) uses JWT tokens obtained by logging in:Response
Token Refresh
JWT tokens expire after a configurable period. Refresh an expired token (within a 30-day grace period) at:Implementation Examples
Environment Variables
Always store your API key in environment variables:Backend Proxy Pattern
For web applications, create a backend proxy to keep your API key secure:Reusable Client
Create a reusable client for your application:Security Best Practices
Never expose keys in client-side code
Never expose keys in client-side code
API keys should never be included in frontend JavaScript, mobile apps, or anywhere they can be viewed by end users.
Use environment variables
Use environment variables
Store API keys in environment variables, never in code:
- Use
.envfiles for local development - Use secret management services in production (AWS Secrets Manager, HashiCorp Vault, etc.)
- Never commit
.envfiles to version control
Rotate keys regularly
Rotate keys regularly
Establish a key rotation schedule:
- Create a new API key
- Update your application to use the new key
- Verify the new key works in production
- Deactivate the old key
Use separate keys for environments
Use separate keys for environments
Create different API keys for development, staging, and production. This limits the impact if a key is compromised and makes auditing easier.
Monitor key usage
Monitor key usage
Regularly review your API usage in the Dashboard to detect unusual activity patterns and identify compromised keys.
Troubleshooting
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
- Accessing a resource that belongs to another project or team
- Account restrictions
- Check that your API key belongs to the correct project
- Verify your account permissions in the Dashboard