API Reference
Help videos API

Help videos API

The docs site exposes public feeds for help videos and docs search, plus Ask Aila.

Base URL:

https://docs.aila.fyi

GET /api/videos

Return the public help-video catalog. The response does not include transcripts.

The catalog is CORS-open. Cache it for one hour.

curl https://docs.aila.fyi/api/videos

Response

{
  "videos": [
    {
      "id": "connect-ghl",
      "title": "Connect GoHighLevel",
      "status": "published",
      "youtubeId": "xxxx",
      "durationSec": 98,
      "audience": ["Admin"],
      "docPages": ["/integrations/gohighlevel"],
      "faqPage": "crm-sync",
      "summary": "Connect LeadConnector and set summary options.",
      "keywords": ["GoHighLevel", "LeadConnector"],
      "chapters": [
        {
          "id": "connect-ghl.1",
          "startSec": 0,
          "endSec": 38,
          "label": "Connect LeadConnector",
          "summary": "Open Settings, click LeadConnector, pick a sub-account.",
          "questions": ["How do I connect LeadConnector?"]
        }
      ]
    }
  ]
}

Draft videos are omitted until a YouTube id is set.

Use startSec as an integer. Build a watch URL like this:

https://youtu.be/YOUTUBE_ID?t=START_SEC

GET /api/docs/search

Lexical search over the full docs corpus. No LLM call. CORS-open. Cache it for one hour.

curl 'https://docs.aila.fyi/api/docs/search?q=gohighlevel+inbound'

Pass all=1 for a full dump of section chunks.

Each hit is { slug, title, section, snippet, url, policy? }. A matching per-slug policy may include doNotLinkFor.


GET /api/videos/:id/transcript

Return timestamped transcript segments for one published video.

curl https://docs.aila.fyi/api/videos/connect-ghl/transcript

POST /api/ask

Ask a product question. The model answers from written docs and the video catalog. The server resolves timestamps. The model cannot invent a start time.

Auth

Send one of:

  • Origin header on the allow list (docs widget)
  • Authorization: Bearer ASK_AILA_SERVICE_KEY (MCP and eval)

Body

FieldTypeNotes
messagesarrayRequired. Each item has role (user or assistant) and string content. Replay text only. Max 8 user turns. Max 1000 characters per message.
pagestringOptional current docs path. This goes in the user message.
streambooleanDefault true. Set false for MCP and eval.

Do not send tool_use or tool_result blocks in history.

JSON mode

curl -X POST https://docs.aila.fyi/api/ask \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ASK_AILA_SERVICE_KEY" \
  -d '{"stream":false,"messages":[{"role":"user","content":"How do I connect GoHighLevel?"}]}'

Response:

{
  "answer": "Open Settings → Connections. Click LeadConnector.",
  "citations": [
    {
      "videoId": "connect-ghl",
      "chapterId": "connect-ghl.1",
      "title": "Connect GoHighLevel",
      "label": "Connect LeadConnector",
      "startSec": 0,
      "endSec": 38,
      "youtubeId": "xxxx",
      "url": "https://youtu.be/xxxx?t=0",
      "embedUrl": "https://www.youtube-nocookie.com/embed/xxxx?start=0&end=38&rel=0",
      "docPages": ["/integrations/gohighlevel"],
      "faqPage": "crm-sync",
      "summary": "Open Settings, click LeadConnector, pick a sub-account.",
      "reason": "Shows the Connect button and sub-account picker."
    }
  ],
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  }
}

Stream mode

Content-Type: text/event-stream

Events:

EventData
textJSON object with a text string
citationsJSON object with a citations array
doneJSON object with a usage object
errorJSON object with an error string
curl -N -X POST https://docs.aila.fyi/api/ask \
  -H "Content-Type: application/json" \
  -H "Origin: https://docs.aila.fyi" \
  -d '{"messages":[{"role":"user","content":"How do I connect GoHighLevel?"}]}'

Errors

StatusReason
403Missing Origin, or Origin is not on the allow list.
413A message is longer than 1000 characters.
429Rate limit. Read Retry-After.
400Bad body, too many turns, or tool blocks in history.

Limits: 20 requests / 10 minutes / IP, and 300 requests / hour globally.


MCP tools

The public MCP route in the Aila app repo (src/app/api/mcp/) should add:

  1. search_help_videos — lexical search over GET /api/videos. No LLM call.
  2. ask_aila_docsPOST /api/ask with stream: false and the service key.

See the implementation brief in the docs repo: docs/mcp-help-videos-brief.md.