API Reference

API Authentication

Learn how to authenticate with the TigerTrust API.

API Authentication

TigerTrust supports multiple authentication methods depending on your use case.

Authentication Methods

MethodUse CaseFormat
API KeyAgent communication, CI/CD integrationsX-Agent-API-Key header
SessionDashboard/browser accessCookie-based session
OAuth 2.0SSO with Google, Azure ADOAuth flow

API Key Authentication

API keys are the primary authentication method for programmatic access.

Key Types

TypePrefixPurpose
Agentak_Agent-to-collector communication
Publicck_Public API access

Creating an API Key

  1. Navigate to Settings → API Keys in the dashboard
  2. Click Create API Key
  3. Select key type (Agent or Public)
  4. Set expiration (optional)
  5. Copy the key - it won't be shown again

Using API Keys

Include the API key in the X-Agent-API-Key header:

curl -X GET "https://api.tigertrust.io/api/certificates" \
  -H "X-Agent-API-Key: ak_your_api_key_here"

Or use Bearer token format:

curl -X GET "https://api.tigertrust.io/api/certificates" \
  -H "Authorization: Bearer ak_your_api_key_here"

Key Validation

API keys are validated against:

  • Existence: Key must exist in the database
  • Active status: Key must not be deactivated
  • Expiration: Key must not be expired
  • Revocation: Key must not be revoked
  • Type: Key type must match the required scope

Workspace Context

All API requests operate within a workspace context.

Workspace Header

Specify workspace for multi-workspace accounts:

curl -X GET "https://api.tigertrust.io/api/certificates" \
  -H "X-Agent-API-Key: ak_your_api_key_here" \
  -H "X-Workspace-ID: ws_123456"

If not specified, the default workspace is used.

Session Authentication

For browser-based access, TigerTrust uses secure HTTP-only cookies.

Login Flow

# Login
curl -X POST "https://api.tigertrust.io/api/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "password": "your_password"}'

# Response includes session cookie
# Set-Cookie: connect.sid=...; HttpOnly; Secure; SameSite=Strict

Session Details

  • Duration: 7 days
  • Storage: PostgreSQL session store
  • Security: HTTP-only, Secure, SameSite=Strict cookies

OAuth 2.0 / SSO

TigerTrust supports OAuth 2.0 with:

  • Google Workspace
  • Azure Active Directory
  • Okta
  • Custom SAML providers

Google OAuth Flow

1. Redirect to: GET /api/auth/google
2. User authenticates with Google
3. Callback to: GET /api/auth/google/callback
4. Session created, user redirected to dashboard

Two-Factor Authentication

When 2FA is enabled:

# Initial login returns 2FA token
POST /api/auth/login
Response: {"requires2FA": true, "token": "2fa_token_here"}

# Submit 2FA code
POST /api/auth/verify-2fa
Body: {"token": "2fa_token_here", "code": "123456"}

Error Responses

StatusError CodeDescription
401UNAUTHORIZEDMissing or invalid credentials
401TOKEN_EXPIREDAPI key has expired
401KEY_REVOKEDAPI key has been revoked
403FORBIDDENValid auth but insufficient permissions
403WORKSPACE_ACCESS_DENIEDNo access to specified workspace

Rate Limiting

API requests are rate-limited per API key:

TierRequests/MinuteRequests/Hour
Free601,000
Pro30010,000
Enterprise1,00050,000

Rate limit headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1704067200

Best Practices

  1. Never commit API keys - Use environment variables
  2. Rotate keys regularly - Set expiration dates
  3. Use minimal scopes - Request only needed permissions
  4. Monitor key usage - Review audit logs
  5. Revoke unused keys - Clean up old integrations