Libraries

List your libraries and what their documents are made of.

Document libraries are the collections your documents live in. These endpoints list the libraries your key can see, read one and fetch the labels that power search filters. Every request needs your API key as a bearer token; see Authentication.

List libraries

GET /libraries

Returns every library the key can access in one response, each with the categories and tags its documents use and a document count.

JSON
{
  "libraries": [
    {
      "id": "lib_...",
      "name": "Support",
      "description": "How the support team handles requests",
      "categories": ["Billing", "Accounts"],
      "tags": ["stripe", "refunds"],
      "documentCount": 128,
      "createdAt": "2026-05-04T09:12:00Z",
      "updatedAt": "2026-07-28T16:40:00Z"
    },
    ...
  ]
}

Get a library

GET /libraries/{id}

Returns one library, adding the edgeCount of its graph. {id} accepts a lib_... ID or the library's slug, and old slugs keep working after a rename.

JSON
{
  "id": "lib_...",
  "name": "Support",
  "description": "How the support team handles requests",
  "categories": ["Billing", "Accounts"],
  "tags": ["stripe", "refunds"],
  "documentCount": 128,
  "edgeCount": 342,
  "createdAt": "2026-05-04T09:12:00Z",
  "updatedAt": "2026-07-28T16:40:00Z"
}

Library tags

GET /libraries/{id}/tags

Returns the library's tags with document counts. These are the values the tag filter accepts on document lists and search.

JSON
{ "tags": [{ "name": "stripe", "documentCount": 34 }, ...] }

Library categories

GET /libraries/{id}/categories

Returns the library's categories with document counts, the values the category filter accepts. Same shape as tags, under a categories key.

Library applications

GET /libraries/{id}/applications

Returns the applications the library's documents involve, with document counts, the values the application filter accepts. Same shape, under an applications key.

Library graph

GET /libraries/{id}/graph

Returns the whole graph for one library: its documents and the edges between them. Each edge joins two documents with a label such as often next or alternative to, so you can see how one piece of work leads to another.

Edges also carry an edgeType (data when the link was seen in real recorded sequences, semantic when the documents are related by meaning) and a support count of the recordings behind the link. A data edge with support below 3 is marked lowConfidence.

JSON
{
  "documents": [...],
  "edges": [
    {
      "sourceDocumentId": "doc_...",
      "sourceDocumentTitle": "Refund an order",
      "targetDocumentId": "doc_...",
      "targetDocumentTitle": "Email the customer",
      "label": "often next",
      "edgeType": "data",
      "recordingCount": 14,
      "support": 14,
      "lowConfidence": false
    },
    ...
  ],
  "truncated": false
}

Very large graphs are capped at 2000 documents and 5000 edges, most active first. When the cap trims the response, truncated is true.