POST
/
retrieve
/
chunks
/
grouped
JavaScript
import Morphik from 'morphik';

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

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

console.log(response.chunks);
{
  "chunks": [
    {
      "content": "<string>",
      "score": 123,
      "document_id": "<string>",
      "chunk_number": 123,
      "metadata": {},
      "content_type": "<string>",
      "filename": "<string>",
      "download_url": "<string>",
      "is_padding": true
    }
  ],
  "groups": [
    {
      "main_chunk": {
        "content": "<string>",
        "score": 123,
        "document_id": "<string>",
        "chunk_number": 123,
        "metadata": {},
        "content_type": "<string>",
        "filename": "<string>",
        "download_url": "<string>",
        "is_padding": true
      },
      "padding_chunks": [
        {
          "content": "<string>",
          "score": 123,
          "document_id": "<string>",
          "chunk_number": 123,
          "metadata": {},
          "content_type": "<string>",
          "filename": "<string>",
          "download_url": "<string>",
          "is_padding": true
        }
      ],
      "total_chunks": 123
    }
  ],
  "total_results": 123,
  "has_padding": true
}

Headers

authorization
string

Body

application/json

Base retrieve request model

Response

200
application/json

Successful Response

Response that includes both flat results and grouped results for UI