Authentication Methods
Private Connect API supports two authentication methods:- API Keys - For programmatic access and automation
- Session Tokens - For web application access (magic link authentication)
API Key Authentication
API keys are the primary authentication method for programmatic access. Include your API key in thex-api-key header:
Obtaining an API Key
Create an API key from the dashboard:- Sign in to app.privateconnect.co
- Navigate to Settings → API Keys
- Click “Create API Key”
- Save the key securely - it’s only shown once
API Key Management
Create API Key
Create a new API key for your workspace.Name for the API key (1-50 characters)
List API Keys
Retrieve all API keys for your workspace.Full API keys are never returned in list operations, only the prefix for identification.
Get API Key Details
Retrieve details for a specific API key.Update IP Restrictions
Restrict API key usage to specific IP ranges.Array of CIDR ranges (e.g.,
["10.0.0.0/8", "192.168.1.0/24"]). Empty array allows all IPs.Revoke API Key
Permanently revoke an API key.Session Token Authentication
Session tokens are used for web application access via magic link authentication.Register User
Create a new user account and workspace.User email address
Workspace name
Login
Request a magic link login email.Verify Magic Link
Verify a magic link token (called automatically when clicking the email link).session cookie and returns:
Get Current User
Retrieve the currently authenticated user.Logout
Invalidate the current session.Security Best Practices
Secure API Key Storage
Secure API Key Storage
- Store API keys in environment variables or secret management systems
- Never commit API keys to version control
- Use different keys for development, staging, and production
- Rotate keys periodically
IP Restrictions
IP Restrictions
- Restrict API keys to known IP ranges when possible
- Use CIDR notation for IP ranges (e.g.,
10.0.0.0/8) - Update IP restrictions when infrastructure changes
Key Rotation
Key Rotation
- Create a new API key before revoking the old one
- Update all services to use the new key
- Verify the new key works before revoking the old one
- Monitor for any requests using the old key
Rate Limit Handling
Rate Limit Handling
- Implement exponential backoff when rate limited
- Cache responses when appropriate
- Use webhooks instead of polling for real-time updates
- Monitor rate limit headers to avoid limits