Skip to content

Authentication

Learn how to authenticate your API requests to Laminr.

API Keys

Laminr uses API keys to authenticate requests. API keys are associated with service accounts, so be sure to keep them secure!

Creating a Service Account and API Key

Tenant Admin Required

You must be a tenant administrator to create service accounts and API keys. If you don't have admin access, contact your organization's Laminr administrator.

Step 1: Navigate to Service Accounts

  1. Log in to your Laminr dashboard
  2. Click on your profile/tenant menu in the top navigation
  3. Select Tenant Admin from the dropdown
  4. Navigate to the Service Accounts section in the left sidebar

Step 2: Create a Service Account

  1. Click Create Service Account
  2. Give your service account a descriptive name (e.g., "Production API", "CI/CD Pipeline")
  3. Optionally add a description to help identify its purpose
  4. Click Create to save the service account

Step 3: Generate an API Key

  1. Find your newly created service account in the list
  2. Click Add API Key for that service account
  3. Give your API key a descriptive name (e.g., "Production Server", "Development", "Staging")
  4. Click Create API Key
  5. Copy the key immediately - you won't be able to see it again!

Service Account Organization

You can create multiple service accounts for different purposes (e.g., one for production, one for development). Each service account can have multiple API keys, making it easy to rotate keys or separate access by environment.

Save Your API Key

The API key is only displayed once when created. Make sure to copy and store it securely before closing the dialog.

Using Your API Key

Include your API key in the x-api-key header of every request:

x-api-key: YOUR_API_KEY

Example request:

curl https://api.laminr.ai/v1/files \
  -H "x-api-key: sk_live_abc123xyz789"

Security Best Practices

Keep Your Keys Secret

Never Expose Your API Key

  • Don't commit API keys to version control
  • Don't include them in client-side code
  • Don't share them in support tickets or public forums
  • Use environment variables to store them

Environment Variables

Store your API key in environment variables:

Bash/Linux/macOS:

export LAMINR_API_KEY="sk_live_abc123xyz789"

Python:

import os

api_key = os.environ.get("LAMINR_API_KEY")

Node.js:

const apiKey = process.env.LAMINR_API_KEY;

Rotate Keys Regularly

If you suspect a key has been compromised:

  1. Generate a new API key in your dashboard
  2. Update your application with the new key
  3. Delete the old key immediately

Use Different Keys for Different Environments

Create separate API keys for:

  • Development: For local development and testing
  • Staging: For your staging environment
  • Production: For your production environment

This allows you to: - Isolate issues - Track usage by environment - Revoke keys without affecting other environments

Authentication Errors

401 Unauthorized

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}

Common causes: - Missing x-api-key header - Incorrect API key format - Revoked or deleted API key

403 Forbidden

{
  "error": {
    "code": "forbidden",
    "message": "Insufficient permissions for this resource"
  }
}

Common causes: - Using a test key for production endpoints - API key doesn't have required permissions - Account limitations

Next Steps