Skip to content

GET /compose/links/{link_collection}

Lists stored links in a collection. Intended for debugging and inspection.


Request

URL Parameters:

Parameter Description
link_collection Name of the link collection to inspect

Query Parameters:

Parameter Type Required Default Description
limit int 100 Maximum number of links to return

Behavior

Returns up to limit forward links from the collection as {source_value, target_value} pairs. Also returns the total number of links stored across all source values. If the collection does not exist, returns an empty list with total: 0.


Responses

200 OK

{
  "link_collection": "expertise_to_employees",
  "links": [
    { "source_value": "machine learning", "target_value": "Alice" },
    { "source_value": "machine learning", "target_value": "Bob" },
    { "source_value": "finance",          "target_value": "Carol" }
  ],
  "total": 3
}
Field Description
link_collection Name of the collection inspected
links Array of {source_value, target_value} pairs, up to limit
total Total number of forward links in the collection

Error Responses

Status Condition
500 Unexpected internal error

Notes

  • Only forward links are listed. To inspect reverse mappings, use /compose/links/match with direction: "reverse".
  • total reflects the full count, even if limit truncates the returned list.
  • This endpoint requires no auth body — it is a simple GET with URL and query params only.

Example

import requests

SERVER_URL = "http://18.220.128.24:8000"
API_KEY    = "yourapitoken"

def list_links(link_collection: str, limit: int = 100) -> dict:
    response = requests.get(
        f"{SERVER_URL}/compose/links/{link_collection}",
        headers={"X-API-Key": API_KEY},
        params={"limit": limit},
    )
    response.raise_for_status()
    return response.json()


result = list_links("expertise_to_employees", limit=50)
print(result)

Expected output:

{
  "link_collection": "expertise_to_employees",
  "links": [
    { "source_value": "machine learning", "target_value": "Alice" },
    { "source_value": "machine learning", "target_value": "Bob" },
    { "source_value": "finance",          "target_value": "Carol" }
  ],
  "total": 3
}