ICP Generator API Documentation

The Agent Lab ICP Generator provides a REST API for AI agents, automation tools (Zapier, Make, n8n), and custom integrations to generate, store, and retrieve Ideal Customer Profiles.

Base URL

https://nteiowzcwwckdaggqrjg.supabase.co

Authentication

All API endpoints require license-based authentication. Include your credentials in the request body or query parameters:

{
  "license_id": "your-license-id",
  "api_key": "your-api-key"
}

Endpoints

1. Validate License (Get Configuration & Available Endpoints)

Endpoint: POST /functions/v1/validate-icp-license

Description: Validates your license, returns configuration and available API endpoints for your license tier.

Request:

{
  "license_id": "lic_abc123def456",
  "api_key": "sk_live_abc123def456xyz"
}

Response (Success 200):

{
  "valid": true,
  "customer_name": "Acme Corp",
  "config": {
    "version": 1,
    "fields": [
      {
        "name": "company_size",
        "type": "dropdown",
        "options": ["early", "growth", "scale", "enterprise"]
      }
    ]
  },
  "config_version": 1,
  "integrations_enabled": {
    "crm": true,
    "email": false,
    "slack": true,
    "zapier": true
  },
  "api_endpoints": {
    "generate": "/functions/v1/generate-icp-profile",
    "list_profiles": "/functions/v1/list-icp-profiles",
    "update_profile": "/functions/v1/update-icp-profile",
    "sync_webhook": "https://webhook.your-domain.com/icp"
  }
}

Response (Error 401):

{
  "valid": false,
  "error": "Invalid license or API key"
}

2. Generate ICP Profile

Endpoint: POST /functions/v1/generate-icp-profile

Description: Creates and stores a new ICP profile. Returns immediately with the saved profile ID.

Request:

{
  "license_id": "lic_abc123def456",
  "api_key": "sk_live_abc123def456xyz",
  "profile_name": "Tech SaaS ICP Q4 2024",
  "profile_data": {
    "companySize": "growth",
    "revenue": "1-10m",
    "industry": ["tech", "finance"],
    "stage": "growth",
    "decisionRole": ["director", "c-suite"],
    "departments": ["sales", "operations"],
    "buyingPower": "committee",
    "painPoints": [
      "Limited operational visibility",
      "Tool fragmentation and data silos",
      "Lost revenue from missed follow-ups"
    ],
    "budget": "50-200k",
    "salesCycle": "3-6mo",
    "tools": ["Salesforce", "HubSpot", "Slack"]
  }
}

Response (Success 201):

{
  "success": true,
  "profile_id": "uuid-12345678-abcd",
  "profile_name": "Tech SaaS ICP Q4 2024",
  "profile_data": { /* same as request */ },
  "created_at": "2024-07-08T14:32:00Z"
}

Response (Error 401):

{
  "error": "Invalid license or API key"
}

Response (Error 400):

{
  "error": "Missing license_id, api_key, or profile_data"
}

3. List ICP Profiles

Endpoint: GET /functions/v1/list-icp-profiles?license_id=...&api_key=...&limit=50&offset=0

Alternative: POST /functions/v1/list-icp-profiles

Description: Retrieves all saved ICP profiles for your license. Supports pagination.

Query Parameters (GET):

Request Body (POST):

{
  "license_id": "lic_abc123def456",
  "api_key": "sk_live_abc123def456xyz",
  "limit": 20,
  "offset": 0
}

Response (Success 200):

{
  "success": true,
  "profiles": [
    {
      "id": "uuid-12345678-abcd",
      "license_id": "lic_abc123def456",
      "profile_name": "Tech SaaS ICP Q4 2024",
      "profile_data": { /* profile object */ },
      "synced_to": {
        "hubspot": {
          "timestamp": "2024-07-08T10:00:00Z",
          "contact_id": "hubspot_123"
        }
      },
      "created_at": "2024-07-08T14:32:00Z",
      "updated_at": "2024-07-08T14:32:00Z"
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 145,
    "has_more": true
  }
}

Integration Examples

Zapier Integration

  1. Create a Zap that triggers on a webhook or schedule
  2. Use the “Webhooks by Zapier” action to call:
    POST https://nteiowzcwwckdaggqrjg.supabase.co/functions/v1/generate-icp-profile
  3. Pass your license credentials in the JSON body
  4. Map your fields to the profile_data structure
  5. Use the returned profile_id to trigger downstream actions (create CRM contact, send email, etc.)

Make (Zapier Alternative)

  1. Create a Scenario in Make
  2. Add a “HTTP” module and set Method to POST
  3. Set the URL to the endpoint you want to call
  4. Add your request body with license credentials and profile data
  5. Map the response (profile_id) to your next module for further automations

n8n Self-Hosted Workflow

{
  "nodes": [
    {
      "name": "Generate ICP",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [250, 300],
      "parameters": {
        "url": "https://nteiowzcwwckdaggqrjg.supabase.co/functions/v1/generate-icp-profile",
        "method": "POST",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "license_id",
              "value": "={{ $env['ICP_LICENSE_ID'] }}"
            },
            {
              "name": "api_key",
              "value": "={{ $env['ICP_API_KEY'] }}"
            },
            {
              "name": "profile_name",
              "value": "={{ $node['Trigger'].json.trigger_name }}"
            },
            {
              "name": "profile_data",
              "value": "={{ $node['Transform Data'].json }}"
            }
          ]
        }
      }
    }
  ]
}

Claude API / LLM Agent Integration

Use your License ID and API Key in your agent’s tools:

import anthropic
import requests
import json

client = anthropic.Anthropic()

tools = [
    {
        "name": "generate_icp_profile",
        "description": "Generate and save an ICP profile based on company criteria",
        "input_schema": {
            "type": "object",
            "properties": {
                "company_size": {"type": "string", "enum": ["early", "growth", "scale", "enterprise"]},
                "revenue": {"type": "string", "enum": ["0-1m", "1-10m", "10-100m", "100m+"]},
                "industry": {"type": "array", "items": {"type": "string"}},
                "stage": {"type": "string"},
                "decision_roles": {"type": "array", "items": {"type": "string"}},
                "profile_name": {"type": "string"}
            },
            "required": ["company_size", "revenue", "profile_name"]
        }
    },
    {
        "name": "list_icp_profiles",
        "description": "List all saved ICP profiles for this license",
        "input_schema": {
            "type": "object",
            "properties": {
                "limit": {"type": "integer", "default": 10}
            }
        }
    }
]

def generate_icp(profile_data):
    response = requests.post(
        "https://nteiowzcwwckdaggqrjg.supabase.co/functions/v1/generate-icp-profile",
        json={
            "license_id": "your-license-id",
            "api_key": "your-api-key",
            "profile_name": profile_data.get("profile_name"),
            "profile_data": profile_data
        }
    )
    return response.json()

def list_icps(limit=10):
    response = requests.get(
        f"https://nteiowzcwwckdaggqrjg.supabase.co/functions/v1/list-icp-profiles?license_id=your-license-id&api_key=your-api-key&limit={limit}"
    )
    return response.json()

# Run your agentic loop
while True:
    response = client.messages.create(
        model="claude-opus-4-1",
        max_tokens=1024,
        tools=tools,
        messages=[
            {"role": "user", "content": "Generate an ICP for a B2B SaaS company selling to mid-market tech companies"}
        ]
    )
    
    for block in response.content:
        if block.type == "tool_use":
            if block.name == "generate_icp_profile":
                result = generate_icp(block.input)
            elif block.name == "list_icp_profiles":
                result = list_icps(block.input.get("limit", 10))

Webhook Integration

When you configure a webhook URL on your license, we’ll POST events to it automatically:

Event: Profile Generated

{
  "event": "icp_profile_generated",
  "license_id": "lic_abc123def456",
  "profile_id": "uuid-12345678-abcd",
  "timestamp": "2024-07-08T14:32:00Z"
}

Use webhooks to trigger downstream actions:


Rate Limits

Rate limit headers are included in all responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1720444800

Error Handling

All errors return JSON with a status code and error message:

StatusErrorMeaning
400Missing required fieldsCheck your request body
401Invalid license or API keyVerify credentials
401License expiredRenew your license
405Method not allowedUse the correct HTTP verb
500Internal server errorRetry with exponential backoff

Data Retention


Support

For API issues, integrations help, or to report bugs:

License Updates

Your license configuration is cached and updated hourly. To force an immediate refresh:

  1. Call validate-icp-license endpoint
  2. Pull the latest config_version and integrations_enabled fields
  3. Update your agent/automation tool configuration

Last Updated: July 8, 2024
API Version: 1.0
Base URL: https://nteiowzcwwckdaggqrjg.supabase.co