canonical: https://jentic.com/apis/swaggerhub.hmcts-dts/case-documents-ai-responses-api

# Hmcts Dts Case Documents AI Responses API

Versioned **queries** (user text + normalized prompt + lifecycle status) and **answers** linked to a Case. Clients can fetch: - The latest snapshot for a Case - An **as-of** view at a timestamp for reproducibility - A specific **version** of an answer. The API exposes 12 endpoints.

## For AI agents

Programmatically list canonical queries (id + label), get a canonical query (id + label). Covers 12 operations.

## Scope

Does not handle payments, communications, or crm - use for developer tools only.

## Capabilities

- List canonical queries (id + label)
- Get a canonical query (id + label)
- Set or update the canonical label for a query (idempotent)
- Upsert versioned **query definitions** (no status, no label) effective at a time
- Monitor Case Documents AI Responses API operational status and events

## Use cases

### Developer Tools Operations

Use the Case Documents AI Responses API to perform developer tools operations programmatically. The API provides 12 endpoints covering core functionality including list canonical queries (id + label), get a canonical query (id + label), set or update the canonical label for a query (idempotent).

Example prompt: Call GET /query-catalogue to list canonical queries (id + label)

### Automated Query Catalogue Management

Automate query catalogue operations by combining multiple Case Documents AI Responses API endpoints. Agents can get a canonical query (id + label) and then set or update the canonical label for a query (idempotent) in a single workflow.

Example prompt: Call GET /query-catalogue/{queryId} to get a canonical query (id + label), then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Case Documents AI Responses API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle none tokens manually.

Example prompt: Search Jentic for 'list canonical queries (id + label)', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /query-catalogue | List canonical queries (id + label) |
| GET | /query-catalogue/{queryId} | Get a canonical query (id + label) |
| PUT | /query-catalogue/{queryId}/label | Set or update the canonical label for a query (idempotent) |
| POST | /queries | Upsert versioned **query definitions** (no status, no label) effective at a time |
| GET | /queries | List queries for a Case (as-of view) |
| GET | /queries/{queryId} | Get a single query for a Case (as-of view) |
| GET | /queries/{queryId}/versions | List **definition** version history for a query (no status) |
| GET | /document/{documentId}/content | Download material by document ID |

## Key resources

- **Query Catalogue** — Manage canonical queries metadata (stable labels).
- **Queries** — Manage and read versioned query definitions and per-case status (as-of semantics).
- **Answers** — Read versioned AI answers for queries (latest, as-of, or by version), optionally including the LLM i
- **Ingestion** — Document ingestion progress for a Case (blob upload > knowledge ingested).
- **Document** — Provide document url based on document Id.

## Why Jentic

- **Setup:** Wiring the Case Documents AI Responses API by hand means coding its query-catalogue, queries, and document calls against the service host and handling paging and retries yourself, even though it declares no auth scheme. Through Jentic you install once, import the Case Documents AI Responses API from the API Directory, and your agent calls it.
- **Permission scoping:** This API puts the query id and document id in the URL path (/queries/{queryId}, /document/{documentId}/content), so a rule can pin your agent to one query or document: it can read that query, its versions, or the document content and nothing else. You choose the operations it may call, so writes like labelling a query are not included unless you add them.
- **Credential handling:** This Case Documents AI Responses API declares no credential, so there is nothing to store. If your deployment later requires one, your own Jentic One instance stores it encrypted and injects it at execution time so it never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list canonical queries' or 'get document content by id', and Jentic returns the matching Case Documents AI Responses API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Github** — Alternative developer tools API
- **Gitlab** — Alternative developer tools API

## FAQ

### What authentication does the Case Documents AI Responses API use?

The Case Documents AI Responses API uses no authentication. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I list canonical queries (id + label) with the Case Documents AI Responses API?

Yes. Use the GET /query-catalogue endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Case Documents AI Responses API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I list canonical queries (id + label) through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'list canonical queries (id + label)'. Jentic returns the matching Case Documents AI Responses API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Case Documents AI Responses API have?

The Case Documents AI Responses API exposes 12 endpoints covering query catalogue, queries, answers operations.

### Can I limit what my agent is allowed to do with the Case Documents AI Responses API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use with the Case Documents AI Responses API. Since this API puts the query id and document id in the URL path, such as GET /queries/{queryId} and GET /document/{documentId}/content, you can pin the agent to a single query or document so it only reads that query, its versions, or that document content. You choose the operations it may call, so a write like PUT /query-catalogue/{queryId}/label to set a canonical query label is excluded unless you explicitly add it.
