/Documentation

    Integrations & API Reference

    Use the REST API to integrate ContentIQ with your existing tools — Zapier, Make, custom scripts, or any HTTP client.

    Authentication

    All API requests require a team API key. Generate one from Team → API Keys (owners and admins only). Keys use the ciq_ prefix.

    Authorization: Bearer ciq_your_api_key_here
    Security: API keys are shown only once when created. Store them securely. If lost, revoke the old key and generate a new one.

    Base URL

    POST https://uoritwtcielykvzbtawj.supabase.co/functions/v1/agent-api

    All requests use POST with a JSON body containing tool and params.

    Request Format

    {
      "tool": "tool_name",
      "params": {
        // tool-specific parameters
      }
    }

    Response Format

    // Success
    {
      "success": true,
      "result": { /* tool-specific response */ }
    }
    
    // Error
    {
      "error": "Error message describing what went wrong"
    }

    Rate Limits

    Each API key is limited to 30 requests per hour. Exceeding this limit returns a 429 status code. The rate limit resets on a rolling window.

    Available Tools & Examples

    Queue a URL for analysis

    {
      "tool": "queue_content_analysis",
      "params": {
        "url": "https://www.tiktok.com/@user/video/123456"
      }
    }

    Search analyzed content

    {
      "tool": "search_library",
      "params": {
        "query": "morning routine",
        "platform": "tiktok"
      }
    }

    Generate a script from patterns

    {
      "tool": "generate_script",
      "params": {
        "content_ids": [
          "uuid-1",
          "uuid-2"
        ],
        "content_type": "educational"
      }
    }

    Get workspace overview

    {
      "tool": "get_workspace_stats",
      "params": {}
    }

    Find outlier content

    {
      "tool": "discover_outliers",
      "params": {
        "hashtag": "productivity",
        "platform": "tiktok"
      }
    }
    Full tool list: See the AI Agent page for a complete list of all available tools and their descriptions.

    cURL Example

    curl -X POST \
      https://uoritwtcielykvzbtawj.supabase.co/functions/v1/agent-api \
      -H "Authorization: Bearer ciq_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "tool": "queue_content_analysis",
        "params": { "url": "https://www.tiktok.com/@user/video/123" }
      }'

    JavaScript Example

    const response = await fetch(
      "https://uoritwtcielykvzbtawj.supabase.co/functions/v1/agent-api",
      {
        method: "POST",
        headers: {
          "Authorization": "Bearer ciq_your_key_here",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          tool: "search_library",
          params: { query: "productivity tips" },
        }),
      }
    );
    
    const data = await response.json();
    console.log(data.result);

    Error Codes

    StatusMeaning
    400Missing or invalid tool / params
    401Missing or invalid API key
    429Rate limit exceeded (30/hour)
    500Internal server error during tool execution