Authentication

All API requests require an API key passed in the Authorization header.

API Key Format

SocialSyncerAPI keys start with sk_ followed by a random string:

sk_abc123def456ghi789jkl012mno345

Using Your API Key

Include your key in every request's Authorization header as a Bearer token:

Python

import httpx

resp = httpx.get(
    "https://api.socialsyncerapi.com/v1/accounts",
    headers={"Authorization": "Bearer sk_your_api_key"}
)
print(resp.json())

Node.js

const resp = await fetch("https://api.socialsyncerapi.com/v1/accounts", {
  headers: { "Authorization": "Bearer sk_your_api_key" }
});
const data = await resp.json();

curl

curl https://api.socialsyncerapi.com/v1/accounts \
  -H "Authorization: Bearer sk_your_api_key"

Getting Your API Key

  1. Sign up at app.socialsyncerapi.com/signup
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Copy your key — it's only shown once
Keep your API key secret. Never commit it to version control, embed it in client-side code, or share it in public repositories. Use environment variables.

Environment Variables

# .env
SOCIALAPI_KEY=sk_your_api_key

# Usage
import httpx
import os

resp = httpx.get(
    "https://api.socialsyncerapi.com/v1/accounts",
    headers={"Authorization": f"Bearer {os.environ['SOCIALAPI_KEY']}"}
)

Error Responses

Missing API Key

HTTP/1.1 401 Unauthorized

{
  "error": "Missing API key",
  "code": "AUTH_MISSING_KEY"
}

Invalid API Key

HTTP/1.1 401 Unauthorized

{
  "error": "Invalid API key",
  "code": "AUTH_INVALID_KEY"
}

OAuth Flow

Connecting social accounts uses OAuth 2.0. The flow is:

  1. Call GET /v1/connect/{platform} to get an auth URL
  2. Redirect the user to the auth URL
  3. User authorizes your app

  4. They're redirected back to your callback with a code parameter
  5. Exchange the code: POST /v1/connect/{platform}

See Connect Accounts for full details.

Rate Limits

When rate limited, you'll receive a 429 Too Many Requests response. Implement exponential backoff.

HTTP/1.1 429 Too Many Requests
Retry-After: 60

{
  "error": "Rate limit exceeded",
  "code": "RATE_LIMIT_EXCEEDED"
}