Get documents

Reads one document by its primary key.

GET /v1/index/indexes/{uid}/documents/{id}

Addresshttps://api.hanzo.ai/v1/index/indexes/{uid}/documents/{id}
MethodGET
Operationget_index_indexes_by_uid_documents_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

Reads one document by its primary key.

Answers the stored document exactly as it was written — this surface keeps documents whole rather than projecting them, so what comes back is what went in. A primary key this index does not hold answers 404 carrying the dialect's document_not_found; an index this org does not hold answers index_not_found, and the two are different facts a client acts on differently.

Request

2 fields.

FieldInTypeRequiredDescription
uidpathstringyes
idpathstringyes

Response

StatusBodyMeaning
200ok
defaultproblem-detailsrefused

200 body — 1 field.

FieldInTypeAlwaysDescription
(body)bodyanyyes

Failure carries the platform error shape — see Errors.

Examples

hanzo index indexes documents get <uid> <id>
import { Configuration, IndexApi } from 'hanzoai';

const api = new IndexApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getIndexIndexesByUidDocumentsById({ uid: 'uid', id: 'id' });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import IndexApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = IndexApi(client).get_index_indexes_by_uid_documents_by_id(uid='uid', id='id')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.IndexAPI.GetIndexIndexesByUidDocumentsById(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, index_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = index_api::get_index_indexes_by_uid_documents_by_id(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.IndexApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new IndexApi(client).getIndexIndexesByUidDocumentsById();
curl https://api.hanzo.ai/v1/index/indexes/<uid>/documents/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches index through the index tool, which names its 14 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_index_health"
         }
       }
     }'

Index API · All Hanzo APIs · Interactive reference

Was this page useful?