POST
/
retrieve
/
docs
JavaScript
import Morphik from 'morphik';

const client = new Morphik({
  apiKey: 'My API Key',
});

const response = await client.retrieve.createDocs({ query: 'x' });

console.log(response);
[
  {
    "score": 123,
    "document_id": "<string>",
    "metadata": {},
    "content": {
      "type": "url",
      "value": "<string>",
      "filename": "<string>"
    },
    "additional_metadata": {}
  }
]

Headers

authorization
string

Body

application/json

Base retrieve request model

query
string
required
Minimum length: 1
filters
object | null
k
integer
default:4
Required range: x > 0
min_score
number
default:0
use_reranking
boolean | null
use_colpali
boolean | null
padding
integer
default:0

Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only)

Required range: x >= 0
graph_name
string | null

Name of the graph to use for knowledge graph-enhanced retrieval

hop_depth
integer | null
default:1

Number of relationship hops to traverse in the graph

Required range: 1 <= x <= 3
include_paths
boolean | null
default:false

Whether to include relationship paths in the response

folder_name

Optional folder scope for the operation. Accepts a single folder name or a list of folder names.

end_user_id
string | null

Optional end-user scope for the operation

Response

Successful Response

score
number
required
document_id
string
required
metadata
object
required
content
object
required

Represents either a URL or content string

additional_metadata
object
required