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.
/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
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | โ |
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.
/website/trigger-enrichmentTrigger 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
| Field | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | โ |
domain | string | null | No | โ |
force_full_crawl | boolean | No | โ |
force_enrichment | boolean | No | โ |
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
| Field | Type | Notes |
|---|---|---|
success | boolean | โ |
message | string | โ |
domain | string | โ |
/website/{company_id}/recrawl-pageRecrawl 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
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | โ |
Request bodyยท RecrawlPageRequest
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | โ |
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
| Field | Type | Notes |
|---|---|---|
success | boolean | โ |
message | string | โ |
url | string | โ |
/website/{company_id}/regen-pageRegen 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
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | โ |
Query parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
url_path | string | Yes | โ | โ |
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
| Field | Type | Notes |
|---|---|---|
success | boolean | โ |
message | string | โ |
url_path | string | โ |
enqueued | integer | โ |
/website/{company_id}/regen-entityRegen 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
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | โ |
Query parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
canonical_id | string | Yes | โ | โ |
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
| Field | Type | Notes |
|---|---|---|
success | boolean | โ |
message | string | โ |
canonical_id | string | โ |
enqueued | integer | โ |
url_paths | string[] | โ |
/website/{company_id}/regen-allRegen 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
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | โ |
Example request
curl -X POST "https://api.lunalift.ai/website/COMPANY_ID/regen-all" \
-H "Authorization: Bearer ll_your_api_key"Response ยท 200 OK
| Field | Type | Notes |
|---|---|---|
success | boolean | โ |
message | string | โ |
enqueued | integer | โ |
/website/{company_id}/generate-llms-txtGenerate 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
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | โ |
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
| Field | Type | Notes |
|---|---|---|
success | boolean | โ |
message | string | โ |
total_pages | integer | โ |
llms_txt_uploaded | boolean | โ |
