Back to Documentation

Authentication

Security

Learn how to securely authenticate your API requests

API Keys
SEER uses API keys for authentication

Getting Your API Key

  1. Log in to your SEER dashboard
  2. Navigate to Settings → API Keys
  3. Click "Generate New API Key"
  4. Give your key a descriptive name (e.g., "Production Pipeline")
  5. Copy and securely store your API key

Important: API keys are only shown once. Store them securely and never commit them to version control.

API Key Format

SEER API keys start with df_ followed by 64 hexadecimal characters:

df_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Using Your API Key

Include your API key in the auth header:

# HTTP Header
Authorization: df_your_api_key_here

# cURL Example
curl -H "Authorization: df_your_api_key_here" \
     https://api.seer.ansrstudio.com/monitoring

# Python Example
headers = {"Authorization": "df_your_api_key_here"}
requests.post(url, headers=headers, json=data)

Security Best Practices

Do's
  • ✓ Store API keys in environment variables
  • ✓ Use different keys for dev/staging/production
  • ✓ Rotate keys regularly (every 90 days)
  • ✓ Use secrets management tools (AWS Secrets Manager, etc.)
  • ✓ Revoke compromised keys immediately
  • ✓ Monitor API key usage in dashboard
Don'ts
  • ✗ Never commit API keys to Git
  • ✗ Don't hardcode keys in source code
  • ✗ Don't share keys via email or chat
  • ✗ Don't use the same key across all environments
  • ✗ Don't log API keys in application logs
  • ✗ Don't expose keys in client-side code

Storing API Keys Securely

Environment Variables

# .env file (never commit this!)
SEER_API_KEY=df_your_api_key_here

# Python
import os
api_key = os.environ['SEER_API_KEY']

# Node.js
const apiKey = process.env.SEER_API_KEY;

# Bash
export SEER_API_KEY="df_your_api_key_here"

Docker Secrets

# docker-compose.yml
services:
  pipeline:
    image: my-pipeline:latest
    environment:
      - SEER_API_KEY=${SEER_API_KEY}

# Or use Docker secrets
echo "df_your_api_key_here" | docker secret create seer_api_key -

AWS Secrets Manager

import boto3
import json

def get_api_key():
    client = boto3.client('secretsmanager')
    response = client.get_secret_value(SecretId='seer/api-key')
    secret = json.loads(response['SecretString'])
    return secret['api_key']

api_key = get_api_key()

API Key Management

Creating Multiple Keys

Create separate API keys for different environments or services:

  • Production Pipeline Key
  • Staging Environment Key
  • Development Key
  • CI/CD Pipeline Key

Revoking Keys

If a key is compromised, revoke it immediately from the dashboard:

  1. Go to Settings → API Keys
  2. Find the compromised key
  3. Click "Revoke" to disable it
  4. Generate a new key and update your applications

Monitoring Usage

Track API key usage in your dashboard to detect unusual activity:

  • Last used timestamp
  • Request count
  • Failed authentication attempts