eternalsocial.dev

Authentication

How to authenticate your API requests

Authentication

The eternalsocial.dev API uses Bearer tokens for authentication. You can use an API Key or a JWT token.

API Keys

API Keys are the recommended authentication method for production applications.

Create an API Key

  1. Go to the Dashboard
  2. Click Create API Key
  3. Give it a descriptive name (e.g., "Production", "Development")
  4. Copy the generated key - it will only be shown once

Use the API Key

Include the key in the Authorization header:

curl -X GET 'https://api.eternalsocial.dev/accounts' \
  -H 'Authorization: Bearer sk_live_abc123...'

Never expose your API Key in frontend code. Always use environment variables and make calls from your backend.

JWT Tokens

JWT tokens are used for user authentication in the dashboard and applications that need sessions.

Get a token

curl -X POST 'https://api.eternalsocial.dev/auth/login' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "your@email.com",
    "password": "your_password"
  }'

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "user_123",
    "email": "your@email.com"
  }
}

Use the token

curl -X GET 'https://api.eternalsocial.dev/accounts' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIs...'

Rate Limits

TypeLimit
Requests per minute60
Requests per hour1000
Requests per day10000

Need higher limits? Contact us at support.

Authentication Errors

CodeDescription
401Invalid or expired token
403No permission for this resource
429Rate limit exceeded
{
  "error": "Unauthorized",
  "message": "Invalid or expired token"
}

On this page