โ† API reference

Developer ยท API reference

Website operations

Trigger enrichment, recrawl pages, regenerate schema, and generate llms.txt.

These endpoints kick off the website data operations behind the automated technical optimization: enriching a newly connected site, recrawling a page, regenerating schema for one page / one entity / the whole site, and generating the live `llms.txt` file. They start background work and return quickly.

GET /website/has-data/{company_id}

Check Website Data

Check if a company has website data (crawled and enriched). Returns True if website exists and has been crawled.

๐Ÿ”’ Requires Authorization: Bearer ll_โ€ฆ (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYesโ€”

Example request

curl -X GET "https://api.lunalift.ai/website/has-data/COMPANY_ID" \
  -H "Authorization: Bearer ll_your_api_key"

Response ยท 200 OK

Returns a JSON object on success.

POST /website/trigger-enrichment

Trigger Website Enrichment

Trigger website enrichment workflow for a company's website. This endpoint initiates the website crawling and enrichment process. The workflow runs asynchronously in the background. If domain is not provided, it will be fetched from the company record.

๐Ÿ”’ Requires Authorization: Bearer ll_โ€ฆ (or X-API-Key).

Request bodyยท TriggerEnrichmentRequest

FieldTypeRequiredDescription
company_idstringYesโ€”
domainstring | nullNoโ€”
force_full_crawlbooleanNoโ€”
force_enrichmentbooleanNoโ€”

Example request

curl -X POST "https://api.lunalift.ai/website/trigger-enrichment" \
  -H "Authorization: Bearer ll_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "company_id": "string"
}'

Response ยท 200 OK

FieldTypeNotes
successbooleanโ€”
messagestringโ€”
domainstringโ€”
POST /website/{company_id}/recrawl-page

Recrawl Page

Re-crawl a single page โ€” FAST crawl only, no enrichment side effects. Routes the one page onto the same fast RabbitMQ crawl the nightly ``customer_page_crawl_wf`` uses (``WebFetchService.queue_customer_page_for_fetch`` โ†’ ``url_fetch_queue`` โ†’ rust parser โ†’ ``result_queue`` โ†’ ``AsyncBatchedConsumer`` โ†’ ``promote_slim_to_webpage``, which advances ``website.last_crawl_at``). The sync icon deliberately does NOT run the schema / KB / llms.txt enrichment DAG: schema regen has its own ``/regen-page`` entrypoint and llms.txt its own ``/generate-llms-txt`` entrypoint. ``company_id`` is a PATH param (matching issues.py's ``/companies/{company_id}/...`` convention). Endpoint URL + ``RecrawlPageResponse`` shape are unchanged (frontend untouched).

๐Ÿ”’ Requires Authorization: Bearer ll_โ€ฆ (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYesโ€”

Request bodyยท RecrawlPageRequest

FieldTypeRequiredDescription
urlstringYesโ€”

Example request

curl -X POST "https://api.lunalift.ai/website/COMPANY_ID/recrawl-page" \
  -H "Authorization: Bearer ll_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "string"
}'

Response ยท 200 OK

FieldTypeNotes
successbooleanโ€”
messagestringโ€”
urlstringโ€”
POST /website/{company_id}/regen-page

Regen Page Schema

Enqueue a per-page schema regen for ONE page (``url_path`` is a typed query param โ€” never a URL-in-body / ``Dict[str, Any]``). Publishes a single job to ``schema_regen_queue`` (same RabbitMQ publish path the crawl fan-out uses) and returns immediately โ€” regen never runs inline on the request. The consumer calls ``schema_regen_service.regenerate_page_schema`` which rebuilds ONLY this page's served ``.schema.json`` from the base โŠ• overlay KB (WS1 single read path) and advances its ``dateModified``.

๐Ÿ”’ Requires Authorization: Bearer ll_โ€ฆ (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYesโ€”

Query parameters

NameTypeRequiredDefaultDescription
url_pathstringYesโ€”โ€”

Example request

curl -X POST "https://api.lunalift.ai/website/COMPANY_ID/regen-page?url_path=VALUE" \
  -H "Authorization: Bearer ll_your_api_key"

Response ยท 200 OK

FieldTypeNotes
successbooleanโ€”
messagestringโ€”
url_pathstringโ€”
enqueuedintegerโ€”
POST /website/{company_id}/regen-entity

Regen Entity Pages

Bounded overlay-edit fan-out: an edited ``canonical_id`` โ†’ reverse-lookup the pages that carry it (WS3 ``parent_canonical_id`` index) โ†’ enqueue a per-page regen for ONLY those pages. Never re-enriches the whole storage_key for one edit. ``canonical_id`` is a typed query param. Returns immediately with the pages enqueued.

๐Ÿ”’ Requires Authorization: Bearer ll_โ€ฆ (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYesโ€”

Query parameters

NameTypeRequiredDefaultDescription
canonical_idstringYesโ€”โ€”

Example request

curl -X POST "https://api.lunalift.ai/website/COMPANY_ID/regen-entity?canonical_id=VALUE" \
  -H "Authorization: Bearer ll_your_api_key"

Response ยท 200 OK

FieldTypeNotes
successbooleanโ€”
messagestringโ€”
canonical_idstringโ€”
enqueuedintegerโ€”
url_pathsstring[]โ€”
POST /website/{company_id}/regen-all

Regen All Schema

Enqueue a schema regen for ALL of the company's NON-SYSTEM pages. Mirrors ``/regen-page`` (same ``_authorize_company`` guard, PATH-scoped ``company_id``, same ``schema_regen_queue`` publish path) but fans out one job per non-system page instead of one. Bounded fan-out โ€” the endpoint returns immediately with the count; regen never runs inline. Targets EVERY non-SYSTEM page including schema-LESS ones (the point of bulk regen is to give schema to pages that lack it); only system pages (legal/checkout/account/search/error) are skipped, via the SHARED classifier in ``schema_regen_service``.

๐Ÿ”’ Requires Authorization: Bearer ll_โ€ฆ (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYesโ€”

Example request

curl -X POST "https://api.lunalift.ai/website/COMPANY_ID/regen-all" \
  -H "Authorization: Bearer ll_your_api_key"

Response ยท 200 OK

FieldTypeNotes
successbooleanโ€”
messagestringโ€”
enqueuedintegerโ€”
POST /website/{company_id}/generate-llms-txt

Generate Llms Txt Endpoint

Regenerate + serve this company's ``llms.txt`` โ€” its OWN entrypoint. llms.txt generation was lifted out of the ``website_enrichment_wf`` DAG (it used to be the terminal ``generate_llms_txt`` task chained off ``update_schema_descriptions``). It now runs on-demand here, decoupled from crawl and schema regen. Reuses the identical service path the DAG task used (``WebsiteService.generate_and_upload_llms_txt`` โ†’ ``generate_llms_txt``), so WS2's tombstone suppression (``read_tombstoned_canonical_ids``) still applies. No crawl, no schema regen โ€” llms.txt only.

๐Ÿ”’ Requires Authorization: Bearer ll_โ€ฆ (or X-API-Key).

Path parameters

NameTypeRequiredDescription
company_idstringYesโ€”

Example request

curl -X POST "https://api.lunalift.ai/website/COMPANY_ID/generate-llms-txt" \
  -H "Authorization: Bearer ll_your_api_key"

Response ยท 200 OK

FieldTypeNotes
successbooleanโ€”
messagestringโ€”
total_pagesintegerโ€”
llms_txt_uploadedbooleanโ€”