Developer · API reference
Competitors & relationships
Manage a company's competitive graph and domain aliases.
The relationships endpoints manage the competitive graph — the competitors LunaLift benchmarks you against — plus the domain aliases that map every domain a company owns to a single entity.
/relationships/{company_id}Get Company Relationships
Get all entity relationships for a company
🔒 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/relationships/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key"Response · 200 OK
Returns a JSON object on success.
/relationships/create/{company_id}Create Relationship
Create a new entity relationship with optional prompt generation
🔒 Requires Authorization: Bearer ll_… (or X-API-Key).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | — |
Request body· CreateRelationshipRequest
| Field | Type | Required | Description |
|---|---|---|---|
parent_id | string | Yes | — |
parent_type | EntityType | Yes | Entity types in the graph. |
child_id | string | Yes | — |
child_type | EntityType | Yes | Entity types in the graph. |
create_prompts | boolean | No | — |
execute_prompts | boolean | No | — |
Example request
curl -X POST "https://api.lunalift.ai/relationships/create/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"parent_id": "string",
"parent_type": {},
"child_id": "string",
"child_type": {}
}'Response · 200 OK
Returns a JSON object on success.
/relationships/update/{company_id}Update Relationship
Update the relationship_type of a company_relationship row. Domain-keyed: the badge surfaces carry the target domain, not the int PK. Normalises the domain (shared helper), resolves slim_company via domain_hash, and scopes the UPDATE to (company_id, slim_company_id). Mutates ONLY relationship_type — tracked/source/confidence/enriched_at are left untouched (a label correction is not a re-enrichment).
🔒 Requires Authorization: Bearer ll_… (or X-API-Key).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | — |
Request body· UpdateRelationshipRequest
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | — |
relationship_type | RelationshipType | Yes | Classification of company relationship to customer. |
Example request
curl -X POST "https://api.lunalift.ai/relationships/update/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"domain": "string",
"relationship_type": {}
}'Response · 200 OK
Returns a JSON object on success.
/relationships/delete/{company_id}Delete Relationship
Delete an entity relationship with prompt management options
🔒 Requires Authorization: Bearer ll_… (or X-API-Key).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | — |
Request body· DeleteRelationshipRequest
| Field | Type | Required | Description |
|---|---|---|---|
parent_id | string | Yes | — |
child_id | string | Yes | — |
deactivate_prompts | boolean | No | — |
delete_prompts | boolean | No | — |
remove_references | boolean | No | — |
Example request
curl -X DELETE "https://api.lunalift.ai/relationships/delete/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key"Response · 200 OK
Returns a JSON object on success.
/relationships/competitors/{company_id}List Competitors
List all manually tracked competitors for a company.
🔒 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/relationships/competitors/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key"Response · 200 OK
Returns a JSON object on success.
/relationships/competitors/{company_id}Add Competitor
Add a manually tracked competitor to a company.
🔒 Requires Authorization: Bearer ll_… (or X-API-Key).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | — |
Request body· AddCompetitorRequest
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | — |
domain | string | Yes | — |
Example request
curl -X POST "https://api.lunalift.ai/relationships/competitors/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"domain": "string"
}'Response · 200 OK
Returns a JSON object on success.
/relationships/generate-prompts/{company_id}Generate Prompts For Relationships
Generate prompts for existing relationships
🔒 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/relationships/generate-prompts/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key"Response · 200 OK
Returns a JSON object on success.
/relationships/domain-alias/{company_id}List Domain Aliases
The company's EFFECTIVE alias set — its own merges UNION the global tier (global winning a same-alias conflict), one row per alias. Each row is tagged ``scope`` ('company' | 'global') so the UI can offer Undo on the company's own merges and render globally-folded pairs as non-revertible. This is what makes the "same as <canonical>" hint DURABLE across reloads — the read fold hides aliases, so without this endpoint the UI can't know they exist.
🔒 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/relationships/domain-alias/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key"Response · 200 OK
Returns a JSON object on success.
/relationships/domain-alias/{company_id}Add Domain Alias
Declare ``alias_domain`` a "same as" (alias of) ``canonical_domain`` for THIS company. Read-time dedup: every leaderboard fold collapses the alias into its canonical at query time. Pure lookup — no reprocessing, no backfill, instantly reversible via DELETE. Auto-promotes to the global tier once >= 2 distinct companies set the same pair.
🔒 Requires Authorization: Bearer ll_… (or X-API-Key).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Yes | — |
Request body· DomainAliasRequest
| Field | Type | Required | Description |
|---|---|---|---|
alias_domain | string | Yes | — |
canonical_domain | string | Yes | — |
Example request
curl -X POST "https://api.lunalift.ai/relationships/domain-alias/COMPANY_ID" \
-H "Authorization: Bearer ll_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"alias_domain": "string",
"canonical_domain": "string"
}'Response · 200 OK
Returns a JSON object on success.
