Get tasks

Checks a write task, which has already finished.

GET /v1/index/tasks/{uid}

Addresshttps://api.hanzo.ai/v1/index/tasks/{uid}
MethodGET
Operationget_index_tasks_by_uid
AuthAuthorization: Bearer $HANZO_API_KEY

Checks a write task, which has already finished.

Always reports succeeded. Writes here are applied to SQLite before their EnqueuedTask is returned, so a client polling waitForTask resolves on its first call rather than waiting for a queue that was never there. The three timestamps are the same instant for the same reason.

It requires a validated principal but reads no tenant data: the task id it echoes was minted by this process and names nothing about any org.

Request

1 field.

FieldInTypeRequiredDescription
uidpathintegeryes

Response

StatusBodyMeaning
200index.indexTaskok
defaultproblem-detailsrefused

200 body — 6 fields.

FieldInTypeAlwaysDescription
enqueuedAtbodystring—EnqueuedAt, StartedAt and FinishedAt are the same instant: the write was applied before its task id was minted.
finishedAtbodystring—FinishedAt is when the write completed.
startedAtbodystring—StartedAt is when the write began.
statusbodystring—Status is always succeeded.
typebodystring—Type names the kind of write, for a client that inspects it.
uidbodyinteger (int64)—UID echoes the task id that was asked about.

Failure carries the platform error shape — see Errors.

Examples

hanzo index tasks get 1
import { Configuration, IndexApi } from 'hanzoai';

const api = new IndexApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getIndexTasksByUid({ uid: 'uid' });
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_tasks_by_uid(uid='uid')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.IndexAPI.GetIndexTasksByUid(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_tasks_by_uid(&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).getIndexTasksByUid();
curl https://api.hanzo.ai/v1/index/tasks/1 \
  -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?