Skip to main content

API Keys

The Infinipost API uses API keys to authenticate requests. You can generate and manage your API keys from the Infinipost dashboard.

Obtaining Your API Key

  1. Navigate to SettingsAPI Keys in your dashboard
  2. Click Generate New API Key
  3. Give your key a descriptive name (e.g., “Production Server”)
  4. Copy the key immediately (it won’t be shown again)
Keep your API keys secure! Treat them like passwords:
  • Don’t commit them to version control
  • Don’t share them publicly
  • Rotate them regularly
  • Use environment variables in your code

Using Your API Key

Include your API key in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY

Example Request

curl https://api.infinipost.co/v1/accounts \
  -H "Authorization: Bearer sk_live_abc123..."

API Key Types

Infinipost provides two types of API keys:

Test Keys

Start with sk_test_
  • Use for development and testing
  • No charges incurred
  • Limited to 10 accounts

Live Keys

Start with sk_live_
  • Use for production
  • Full access to all features
  • Standard billing applies

Best Practices

Store Keys Securely

Use environment variables instead of hardcoding:
// ✅ Good
const apiKey = process.env.INFINIPOST_API_KEY;

// ❌ Bad
const apiKey = 'sk_live_abc123...';

Rotate Keys Regularly

  1. Generate a new key in the dashboard
  2. Update your application to use the new key
  3. Delete the old key once confirmed working

Use Separate Keys per Environment

Create different keys for different environments:
  • Production API Key → Production server
  • Staging API Key → Staging server
  • Development API Key → Local development

Error Responses

Missing API Key

{
  "error": {
    "code": "unauthorized",
    "message": "No API key provided"
  }
}
HTTP Status: 401 Unauthorized

Invalid API Key

{
  "error": {
    "code": "invalid_api_key",
    "message": "The API key provided is invalid"
  }
}
HTTP Status: 401 Unauthorized

Expired API Key

{
  "error": {
    "code": "api_key_expired",
    "message": "This API key has expired"
  }
}
HTTP Status: 401 Unauthorized

Questions?

If you’re having authentication issues, reach out to drew.arlint@gmail.com.