AdMachineAdMachine

AdMachine API Documentation

Use the AdMachine API to generate ad creatives, analyze competitors, and manage brand projects programmatically.

Base URL

https://api.adscan.ai

Authentication

Authenticated endpoints require an API key in the Authorization header:

Authorization: Bearer adscan_live_your_api_key_here

Some procedures (marked "no auth" below) can be called without authentication.

Protocol

AdMachine uses tRPC v11 over HTTP. Each procedure is called at its own endpoint.

Queries (GET)

GET /admachine.getCards?input={"json":{"projectId":"clx456def"}}
Authorization: Bearer adscan_live_xxx

Mutations (POST)

POST /admachine.generateCopy
Content-Type: application/json
Authorization: Bearer adscan_live_xxx

{"json":{"brandName":"FitPro","brandColors":["#FF6B00"],...}}

All responses are wrapped in {"result":{"data":{"json":{...}}}}.

Available Procedures

AI Generation (no auth required)

  • admachine.analyzeDomain — Analyze a domain for brand info (query)
  • admachine.generateCopy — Generate ad copy with AI (mutation)
  • admachine.generateImage — Generate ad image with AI (mutation)
  • admachine.matchCompetitors — Match competitor names to database (query)
  • admachine.searchAdvertisers — Search advertisers by name (query)
  • admachine.loadTopAds — Load top-performing ads for companies (query)

User & Teams

  • admachine.me — Get current user + teams (query)
  • admachine.createTeam — Create a team (mutation)
  • admachine.getMyTeams — List user's teams (query)
  • admachine.inviteMember — Invite member to team (mutation)
  • admachine.joinTeam — Join team via invite token (mutation)
  • admachine.removeMember — Remove team member (mutation)
  • admachine.updateTeam — Update team name (mutation)

Projects

  • admachine.createProject — Create a brand project (mutation)
  • admachine.getProject — Get project details (query)
  • admachine.listProjects — List projects for a team (query)
  • admachine.updateProject — Update project settings (mutation)
  • admachine.deleteProject — Delete a project (mutation)
  • admachine.addCompetitor — Add competitor to project (mutation)
  • admachine.removeCompetitor — Remove competitor (mutation)

Cards (Kanban Board)

  • admachine.addCards — Add cards to kanban board (mutation)
  • admachine.getCards — Get cards for a project (query)
  • admachine.moveCard — Move card between columns (mutation)
  • admachine.updateCard — Update card generation data (mutation)
  • admachine.removeCard — Delete a card (mutation)
  • admachine.clearColumn — Clear all cards in a column (mutation)

Activity

  • admachine.getActivityLog — Get project activity log (query)

Example: Analyze a Domain

Request

GET https://api.adscan.ai/admachine.analyzeDomain?input={"json":{"domain":"nike.com"}}

Response

{
  "result": {
    "data": {
      "json": {
        "businessName": "Nike",
        "industry": "Athletic Footwear & Apparel",
        "description": "Global leader in athletic footwear, apparel, and equipment.",
        "tone": "Inspirational, bold, empowering",
        "targetAudience": "Athletes and fitness enthusiasts aged 18-45",
        "usp": "Innovation in sport performance with iconic brand recognition",
        "suggestedCompetitors": ["Adidas", "Puma", "Under Armour", "New Balance"]
      }
    }
  }
}

Example: Generate Ad Copy

Request

POST https://api.adscan.ai/admachine.generateCopy
Content-Type: application/json

{
  "json": {
    "brandName": "FitPro",
    "brandColors": ["#FF6B00", "#1A1A1A"],
    "tone": "Energetic, motivational",
    "topAds": [
      { "body": "Transform your body in 30 days.", "headline": "Home Gym Revolution" }
    ],
    "count": 3
  }
}

Response

{
  "result": {
    "data": {
      "json": {
        "concepts": [
          {
            "headline": "Your Best Workout Starts Now",
            "body": "Stop guessing. FitPro AI builds your perfect plan.",
            "cta": "Learn More",
            "angle": "Pain point",
            "rationale": "Inspired by PelotonApp's transformation hook."
          }
        ]
      }
    }
  }
}

Error Handling

Errors follow tRPC conventions:

{
  "error": {
    "message": "Error description",
    "code": -32600,
    "data": { "code": "BAD_REQUEST", "httpStatus": 400 }
  }
}
  • UNAUTHORIZED (401) — Missing or invalid API key
  • BAD_REQUEST (400) — Invalid input parameters
  • NOT_FOUND (404) — Resource not found
  • FORBIDDEN (403) — Insufficient permissions
  • INTERNAL_SERVER_ERROR (500) — Server error

Full Reference

For the complete API reference with all input/output schemas and examples, see the machine-readable docs:

Support

Questions or need help? Contact us at [email protected]