> ## Documentation Index
> Fetch the complete documentation index at: https://vaquill.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# India case law quickstart

> Find an Indian Supreme Court or High Court judgment, read it, and resolve a citation to it, in six requests

Each judgment has a stable `caseId`.
You can search judgments, list them by court and date, read one, fetch its text or file, and resolve a citation to one.

> [!NOTE]
>
> This is the **India case law** corpus: Supreme Court and High Court judgments.
> For Indian acts and sections, see [India legislation](https://vaquill.ai/docs/api-guide/coverage/india.md).
> For what regulators issued, see [India regulatory publications](https://vaquill.ai/docs/api-guide/india-regulatory-quickstart.md).
> For matters before tribunals such as NCLT and ITAT, see [India tribunals](https://vaquill.ai/docs/api-guide/india-tribunals-quickstart.md).

## Authentication

Send an API key as a Bearer token. The key needs the scope `cases:read`.

```bash theme={"theme":"github-light"}
-H "Authorization: Bearer vq_key_..."
```

`cases:read` covers every court and every route below.

## 1. Which courts are held

`/courts` is free and needs no filters.

```bash theme={"theme":"github-light"}
curl https://api.vaquill.ai/api/v1/in/courts \
  -H "Authorization: Bearer vq_key_..."
```

You get every court with its `courtId`, `courtType` (`supreme_court` or `high_court`), `state`, `judgmentCount`, `firstDecision` and `lastDecision`.
The `courtId` values it returns, such as `supreme-court` or `madhya-pradesh-hc`, are what the `court` filter takes.

## 2. Search

```bash theme={"theme":"github-light"}
curl -G https://api.vaquill.ai/api/v1/in/cases/search \
  -H "Authorization: Bearer vq_key_..." \
  --data-urlencode "q=base development costs exceeded by more than five percent" \
  --data-urlencode "court=supreme-court" \
  --data-urlencode "decidedFrom=2015-01-01" \
  --data-urlencode "limit=10"
```

Search combines meaning and keyword matching. It returns one result per judgment, with its best-matching passage as `snippet`.

Filters are `court` (a `courtId`), `courtType`, `decidedFrom` and `decidedTo` (ISO dates).
To select more than one court, **repeat the key**, up to 10:

```bash theme={"theme":"github-light"}
  --data-urlencode "court=bombay-hc" \
  --data-urlencode "court=delhi-hc"
```

An unknown query parameter is a 422 that names the likely one.

Each result carries `caseId`, `title`, `court`, `decisionDate`, `dateQuality`, `reportedYear`, `caseNumber`, `reporterCitations`, `judges`, `disposition`, `score`, `snippet` and `snippetChunkIndex`.

## 3. Read one judgment

```bash theme={"theme":"github-light"}
curl "https://api.vaquill.ai/api/v1/in/cases/2020_INSC_548/detail" \
  -H "Authorization: Bearer vq_key_..."
```

This is the case-level record: the fields above plus `petitioner`, `respondent`, `totalChunks`, `hasText`, `hasFile` and a `links` object with relative paths to `body`, `file` and `similar`.
Check `hasText` and `hasFile` before asking for either.

## 4. Get the text

```bash theme={"theme":"github-light"}
curl "https://api.vaquill.ai/api/v1/in/cases/2020_INSC_548/body" \
  -H "Authorization: Bearer vq_key_..."
```

This route returns the judgment as one `text`.
Add `include=segments` to also get, per passage, `chunkIndex`, `charStart`, `charEnd` and `sectionType`.

Read `complete` before you rely on the text.
When it is `false`, `missingChunkIndexes` names the passages we could not read, and the call is refunded.

## 5. Get the file

```bash theme={"theme":"github-light"}
curl -L "https://api.vaquill.ai/api/v1/in/cases/2020_INSC_548/file" \
  -H "Authorization: Bearer vq_key_..." \
  -o judgment.pdf
```

This route returns bytes, not JSON: the archived source document.
If no file was archived, you get a 404 `case_file_unavailable` and the credit is refunded.

## 6. Resolve a citation

```bash theme={"theme":"github-light"}
# a reporter citation
curl -G https://api.vaquill.ai/api/v1/in/cases/resolve \
  -H "Authorization: Bearer vq_key_..." \
  --data-urlencode "citation=[1982] 2 S.C.R. 186"

# a case number, which needs a court
curl -G https://api.vaquill.ai/api/v1/in/cases/resolve \
  -H "Authorization: Bearer vq_key_..." \
  --data-urlencode "caseNumber=3729/2016" \
  --data-urlencode "court=madhya-pradesh-hc"
```

Send exactly one of `citation` or `caseNumber`.
`caseNumber` requires `court`.

Resolve matches exactly. `matchType` is always `case_id`, `reporter_citation` or `case_number`.

| `status` | Means |
| - | - |
| `found` | Exactly one judgment matched. It is in `case`. |
| `not_found` | The input parsed cleanly and matched nothing. It is charged. |
| `ambiguous` | Several judgments match. All are in `candidates`. |

Case numbers are not unique across case types, so `ambiguous` is common for them.

The citation forms carried are a case id (`2020_INSC_548`), and the Supreme Court Reports form in any common spelling (`[2020] 12 S.C.R. 1`, `(2020) 12 SCR 1`).
Other reporters such as SCC, AIR or SCC OnLine are refused with a 422 `unsupported_citation_form`.

To resolve many at once, `POST` up to 100 inputs.
Duplicates are charged once, and each input gets its own `status`.

```bash theme={"theme":"github-light"}
curl -X POST https://api.vaquill.ai/api/v1/in/cases/resolve \
  -H "Authorization: Bearer vq_key_..." \
  -H "Content-Type: application/json" \
  -d '{"inputs": [
        {"citation": "2020_INSC_548"},
        {"caseNumber": "3729/2016", "court": "madhya-pradesh-hc"}
      ]}'
```

A malformed or unsupported input is a per-item status (`unsupported_citation_form`, `invalid_input`, `unknown_court`) and is not charged.
An input whose backend failed comes back as `unavailable` and is refunded for that item only.

## Paging

`/search` and `/list` page with a cursor, not an offset.
Send the `nextCursor` you were given to resume where you stopped.

```bash theme={"theme":"github-light"}
# first call
curl -G https://api.vaquill.ai/api/v1/in/cases/list \
  -H "Authorization: Bearer vq_key_..." \
  --data-urlencode "court=bombay-hc" \
  --data-urlencode "limit=25"

# next page
curl -G https://api.vaquill.ai/api/v1/in/cases/list \
  -H "Authorization: Bearer vq_key_..." \
  --data-urlencode "court=bombay-hc" \
  --data-urlencode "limit=25" \
  --data-urlencode "cursor=<meta.nextCursor from the last call>"
```

Keep calling while `meta.hasMore` is true.
`/list` browses judgments by court and date with no query, newest first by default, and takes `order=decided_asc` to reverse it.

> [!WARNING]
>
> `/search` and `/list` return no `total`. Read `hasMore` and `nextCursor` to decide whether to continue.

A cursor belongs to one query. Search depth is 200 results (`meta.searchDepthLimit`).
Paging past that is a 400 `search_depth_exceeded`, so narrow the query.

## Related judgments

`GET /in/cases/{caseId}/similar` returns the judgments closest in meaning to one you already hold, one per judgment, excluding the source.
It takes the same `court`, `courtType`, `decidedFrom` and `decidedTo` filters and a `limit` of up to 20.

## What each call costs

| Route | Credits |
| - | -: |
| `GET /in/courts` | **0** |
| `GET /in/cases/list` | 1 |
| `GET /in/cases/search` | 2 |
| `GET /in/cases/{caseId}/detail` | 1 |
| `GET /in/cases/{caseId}/body` | 3 |
| `GET /in/cases/{caseId}/file` | 1 |
| `GET /in/cases/resolve` | 2 |
| `POST /in/cases/resolve` | 2 per distinct input |
| `GET /in/cases/{caseId}/similar` | 2 |

Requests that fail validation are not charged. Backend failures, missing judgments and missing files are refunded.

## Errors

Every error is JSON with the same shape:

```json theme={"theme":"github-light"}
{
  "detail": "No judgment with caseId 'nonsense'.",
  "code": "case_not_found",
  "status": 404,
  "requestId": "00000000000000000000000000000001",
  "retryable": false,
  "error": { "code": "case_not_found", "message": "No judgment with caseId 'nonsense'." }
}
```

Branch on `code`, and quote `requestId` if you write to us.
`retryable` is `true` only for `cases_backend_unavailable`.

| Code | Status | Means | Charged |
| - | - | - | - |
| `invalid_case_id` | 422 | The `caseId` is malformed. | No |
| `unknown_court` | 422 | A `court` is not a `courtId` from `/courts`. | No |
| `conflicting_filters` | 422 | `court` and `courtType` cannot both match. | No |
| `unsupported_citation_form` | 422 | A citation form this corpus does not carry, such as SCC or AIR. | No |
| `invalid_cursor` | 400 | The cursor is malformed, or belongs to another query. | No |
| `search_depth_exceeded` | 400 | You paged past 200 results. Narrow the query. | No |
| `unauthorized` | 401 | The key is missing or wrong. | No |
| `insufficient_scope` | 403 | The key is valid but lacks `cases:read`. | No |
| `case_not_found` | 404 | No judgment with that `caseId`. | Refunded |
| `case_file_unavailable` | 404 | The judgment exists; no file was archived for it. Do not retry. | Refunded |
| `rate_limited` | 429 | Slow down. `Retry-After` says how long. | No |
| `cases_backend_unavailable` | 503 | A backend failed. Retry. | Refunded |

> [card] [Coverage](https://vaquill.ai/docs/api-guide/coverage/india-case-law.md)
>
> Which courts are held, and the known limits.

> [card] [Authentication](https://vaquill.ai/docs/api-guide/authentication.md)
>
> Getting a `vq_key_` credential.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.