← Back to Dashboard

Marketingium API Documentation

Generate AI-powered marketing content at scale using our RESTful API.

Authentication

All API requests require authentication using an API key in the header:

Authorization: Bearer YOUR_API_KEY

Base URL

https://marketingium.com/api

Endpoints

POST /campaign/create

Create a new marketing campaign with AI-generated images.

Request Body

{
    "name": "Summer Sale 2024",
    "product": "Premium athletic shoes with advanced cushioning",
    "platforms": ["instagram", "facebook", "twitter"],
    "variations": 10,
    "style": "Modern & Minimalist"
  }

Parameters

Parameter Type Required Description
name string Required Campaign name
product string Required Product description for AI to understand context
platforms array Optional Target platforms: instagram, facebook, twitter, linkedin, tiktok
variations integer Optional Number of variations per platform (default: 10)
style string Optional Visual style for generation

Response

{
    "campaignId": "uuid-here",
    "status": "processing",
    "estimatedTime": 230,
    "message": "Campaign generation started"
  }

GET /campaign/status/{campaignId}

Get the status of a campaign.

Response

{
    "id": "uuid-here",
    "name": "Summer Sale 2024",
    "status": "completed",
    "images": [...],
    "stats": {
      "requested": 30,
      "generated": 28,
      "successRate": 0.93
    }
  }

POST /influencer/generate

Generate a consistent AI influencer character.

Request Body

{
    "name": "Alex Digital",
    "personality": "Tech-savvy fitness enthusiast",
    "style": "Modern athletic wear",
    "gender": "neutral",
    "age": "25-30"
  }

Response

{
    "influencerId": "uuid-here",
    "name": "Alex Digital",
    "status": "generating",
    "estimatedCompletion": "2024-01-20T15:30:00Z"
  }

POST /content/batch

Generate multiple images from a list of prompts.

Request Body

{
    "prompts": [
      "Minimalist watch on marble background",
      "Luxury handbag in studio lighting",
      "Athletic shoes with dynamic composition"
    ],
    "variations": 3,
    "style": "Product Photography"
  }

Response

{
    "batchId": "uuid-here",
    "totalImages": 9,
    "estimatedTime": 20.7,
    "costEstimate": 0.18,
    "status": "processing"
  }

GET /analytics/realtime

Get real-time platform analytics.

Response

{
    "current": {
      "activeJobs": 847,
      "imagesPerSecond": 42.7,
      "gpuUtilization": 0.87,
      "queueDepth": 15420
    },
    "today": {
      "totalGenerated": 142847,
      "successRate": 0.98,
      "totalCost": 2856.94
    },
    "infrastructure": {
      "totalGPUs": 32,
      "activeGPUs": 28,
      "systemHealth": "optimal"
    }
  }

POST /campaign/analyze

Get AI-powered marketing insights using GPT-4.1 nano.

Request Body

{
    "product": "Eco-friendly water bottles",
    "target": "Health-conscious millennials",
    "goals": "Increase brand awareness and drive sales"
  }

Response

{
    "analysis": "Detailed marketing analysis...",
    "model": "gpt-4.1-nano",
    "timestamp": "2024-01-20T15:30:00Z"
  }

Rate Limits

Rate limits vary by plan:

Error Codes

Code Description
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Code Examples

Python

import requests
  
  api_key = "YOUR_API_KEY"
  url = "https://marketingium.com/api/campaign/create"
  
  headers = {
      "Authorization": f"Bearer {api_key}",
      "Content-Type": "application/json"
  }
  
  data = {
      "name": "Summer Campaign",
      "product": "Sustainable fashion line",
      "variations": 5,
      "platforms": ["instagram", "facebook"]
  }
  
  response = requests.post(url, json=data, headers=headers)
  print(response.json())

JavaScript

const apiKey = 'YOUR_API_KEY';
  
  fetch('https://marketingium.com/api/campaign/create', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Summer Campaign',
      product: 'Sustainable fashion line',
      variations: 5,
      platforms: ['instagram', 'facebook']
    })
  })
  .then(res => res.json())
  .then(data => console.log(data));

Webhook Support

Configure webhooks to receive real-time updates when campaigns complete:

POST /webhook/configure
  {
    "url": "https://your-server.com/webhook",
    "events": ["campaign.completed", "batch.finished"]
  }

Ready to get started?

Generate your API key from the dashboard and start creating AI-powered marketing content.

Go to Dashboard →