FruxonDocs
IntegrationsAssets

Looks up an asset, and optionally one of its documents, by the ids the search index reports.

A search hit — from `POST /assets/{asset}:search`, or a `search_assets` result in a run's trace — names its asset and document by the search index's own ids, not the ones the other asset endpoints take. This translates them: it returns the asset's id and name, and the knowledge base the asset backs, if any. With `documentId` it also says where that document stands now. The index deletes a document and creates a new one whenever its source changes, so an id recorded earlier may be gone even though its source is still indexed. `CURRENT` means the id is still indexed and its text is unchanged. `REINDEXED` means one document from the same source replaced it; `current` is the replacement and its text may differ. `MISSING` means nothing in the asset can be told apart as its replacement. Pass whatever else the hit carries (`knowledgeDocumentId`, `sourceUrl`, `fileName`) so a replacement can be recognised. Read the document's text with `GET /assets/{asset}/documents/{document}/chunks`, using `assetId` and `document.current.id` from this response.

GET
/v1/tenants/{tenant}/assets:lookup
AuthorizationBearer <token>

JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.

In: header

Path Parameters

tenant*string

The tenant identifier

Query Parameters

ragAssetId?string

The asset's id in the search index: a search hit's assetId (asset_id in a tool result).

Formatuuid
documentId?string

The indexed document's id: a search hit's documentId (document_id in a tool result).

Formatuuid
knowledgeDocumentId?string

The hit's knowledge_document_id, when it came from a knowledge base.

Formatuuid
sourceUrl?string

The hit's source URL, when it has one.

fileName?string

The hit's file name (source in a tool result).

Response Body

curl -X GET "https://api.fruxon.com/v1/tenants/string/assets:lookup"
{
  "assetId": "00000000-0000-0000-0000-000000000000",
  "assetName": "string",
  "knowledgeBaseId": "00000000-0000-0000-0000-000000000000",
  "knowledgeBaseName": "string",
  "document": {
    "requestedDocumentId": "00000000-0000-0000-0000-000000000000",
    "state": "CURRENT",
    "current": {
      "id": "00000000-0000-0000-0000-000000000000",
      "assetId": "00000000-0000-0000-0000-000000000000",
      "fileName": "string",
      "fileId": "string",
      "contentType": "string",
      "sourceUrl": "string",
      "fileSize": 0,
      "chunkCount": 0,
      "status": "PENDING",
      "errorMessage": "string",
      "createdAt": 0,
      "modifiedAt": 0,
      "processedAt": 0,
      "metadata": {}
    },
    "knowledgeDocumentId": "00000000-0000-0000-0000-000000000000"
  }
}
Empty
Empty
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}