Skip to main content

API Overview

Influgen exposes two API surfaces:

  1. Authenticated product API for the full app workflow
  2. Agency public API for external automation

Use the product API when you need full workspace behavior such as editing characters, moderating content, managing billing, or configuring enterprise features. Use the public API when you want a narrower, stable automation surface for character creation, content generation, publishing, and credit checks.

Base path

Most routes live under:

/api/v1

Examples in this guide assume an API origin like:

https://api.influgen.ai

Authentication modes

Session auth

Session auth uses bearer access tokens returned from login or registration.

Key endpoints:

  • POST /api/v1/auth/register
  • POST /api/v1/auth/login
  • POST /api/v1/auth/refresh
  • GET /api/v1/auth/me
  • POST /api/v1/auth/logout

Registration requires:

  • email
  • password with minimum length 8
  • accept_terms: true
  • accept_privacy: true

Successful auth responses return:

  • user
  • access_token
  • refresh_token
  • token_type
  • expires_in

Example login:

curl https://api.influgen.ai/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "operator@example.com",
"password": "correct-horse-battery-staple"
}'

Example response:

{
"user": {
"id": "user_01HZX6A9T4B3C2D1E0F9G8H7J6",
"email": "operator@example.com",
"display_name": "Maya",
"status": "active",
"role": "user",
"locale": "en",
"onboarding_step": "welcome"
},
"access_token": "eyJhbGciOi...",
"refresh_token": "eyJhbGciOi...",
"token_type": "Bearer",
"expires_in": 3600
}

Public API keys

Public API keys are available only on the Agency plan. They are created from:

  • GET /api/v1/api-keys
  • POST /api/v1/api-keys
  • DELETE /api/v1/api-keys/{id}

Permissions are scoped per key:

  • characters:read
  • characters:write
  • content:generate
  • content:read
  • content:publish
  • credits:read

Rate limits are plan-aware. Default config values are:

  • Starter: 60 requests/minute
  • Pro: 180 requests/minute
  • Agency: 300 requests/minute

In practice, only Agency workspaces can use the public API key flow today.

Route families

The full product API includes:

  • auth and session management
  • characters and influencers
  • content generation and moderation
  • publishing integrations and scheduling
  • analytics and engagement
  • billing and monetization
  • marketplace
  • enterprise and white-label
  • adapters and self-hosted routing

The public API includes:

  • POST /api/v1/public/characters
  • GET /api/v1/public/characters
  • POST /api/v1/public/generate
  • GET /api/v1/public/content/{id}
  • POST /api/v1/public/publish
  • GET /api/v1/public/credits

Real-time updates with WebSocket

Influgen also exposes:

  • GET /api/v1/ws

The socket authenticates after connect. Send a first message shaped like:

{
"type": "auth",
"token": "YOUR_ACCESS_TOKEN"
}

After that, the socket streams progress events for the authenticated user on the generation progress channel.

Error model

Most errors are returned as structured JSON with an application error code and a readable message. Treat the HTTP status code as the first signal and the error code as the second.

Common patterns:

  • 401: missing or invalid auth
  • 403: plan or permission restriction
  • 404: missing resource
  • 409: conflict such as duplicate or invalid state transition
  • 402 or 429: credits or rate limits depending on the workflow