# Court Check Multiple

`POST /court_check_multiple`

- Live: `POST https://gdapi.globaldata.net.au/api/v2/court_check_multiple`
- Sandbox: `POST https://sandbox-gdapi.globaldata.net.au/api/v2/court_check_multiple`

This is a bulk version of the court check endpoint that allows multiple checks to be performed in a single request.

This endpoint accepts up to 20 requests in the `requests` array and applies shared settings (`report`, `listing`, pagination and optional `start_date`) to each item.

The types of searches that can be performed are the same as the single court check endpoint:
- Summary - This returns the number of records and type that can be found against the individual or company.
- Detailed - This returns the details of the records that can be found against the individual or company.

## Sandbox environment

When performing a court check in the sandbox environment, the following record will return a match:

### Name Searches:

| First Name | Last Name | State |
|:-----------|:----------|:-----:|
| Michael    | Raymond   |  VIC  |

### Company Searches:

| Company    | State |
|:-----------|:-----:|
| Samplemart |  VIC  |

These samples can be queried with criminal, civil or both record listings.

## Request body

The details of the entities to search for.

| Field | Type | Description |
|-------|------|-------------|
| `report` | string | The type of report to generate. Enum: `summary`, `detail` Example: `summary` |
| `listing` | string | The type of court records to search for. Enum: `civil`, `criminal`, `all` Example: `all` |
| `max_results` | integer [1..50] | The maximum number of results to return. Example: `10` |
| `first_result` | integer | Specifies the first result to be returned. Example: `1` |
| `start_date` | string | Optional earliest court date in `Y-m-d` format. Example: `2024-01-01` |
| `requests` | array of objects [1..20 items] | The list of court checks to perform. |
| `requests[].check_id` | string | Optional client reference returned in the matching result item. Example: `check_123` |
| `requests[].type` | string | The type of entity to search for. Enum: `name`, `company` Example: `name` |
| `requests[].name_first` | string [max 50 characters] | Required for `type=name` with `report=summary`. Example: `Michael` |
| `requests[].name_middle` | string [max 50 characters] | Optional middle name for `type=name`. An empty string will filter results to those with no middle name, while omitting this field or null will not filter based on middle name. Example: `` |
| `requests[].name_last` | string [max 50 characters] | Required for `type=name` with `report=summary`. Example: `Raymond` |
| `requests[].name_full` | string [max 50 characters] | Required for `type=name` with `report=detail`, unless `name_full_unstructured` is supplied instead. Must be formatted as "Last name, First name Middle name". Example: `RAYMOND, MICHAEL` |
| `requests[].name_full_unstructured` | string [max 50 characters] | An alternative to `name_full` for `type=name` with `report=detail`. Accepts the name in its natural order, "First name Middle name Last name", and makes a best effort attempt to split it into the first, middle and last name for you. Cannot be used together with `name_full`, `name_first`, `name_middle` or `name_last`, and cannot be used with `report=summary` or `type=company`. If the name cannot be split into at least a first and a last name, the value you supplied is used as `name_full` instead, and the usual name requirements for a detail report still apply to it. Example: `Michael Raymond` |
| `requests[].company` | string [max 512 characters] | Required for `type=company`. Example: `Acme Services Pty Ltd` |
| `requests[].state` | string | Optional state scope for the request item. Enum: `NSW`, `VIC`, `QLD`, `WA`, `SA`, `TAS`, `ACT`, `NT`, `FED` Example: `NSW` |

**Sample request**

```json
{
    "report": "summary",
    "listing": "all",
    "max_results": 10,
    "first_result": 1,
    "start_date": "2024-01-01",
    "requests": [
        {
            "check_id": "check_123",
            "type": "name",
            "name_first": "Michael",
            "name_middle": "",
            "name_last": "Raymond",
            "name_full": "RAYMOND, MICHAEL",
            "name_full_unstructured": "Michael Raymond",
            "company": "Acme Services Pty Ltd",
            "state": "NSW"
        }
    ]
}
```

## Responses

### 200 Successful response

Content type: `application/json`

| Field | Type | Description |
|-------|------|-------------|
| `message` | string | A message indicating the result of the request. Example: `Ok` |
| `function` | string | The function that was called. Example: `court_check_multiple` |
| `api_reference` | string (uuid) | A unique identifier for this request. Example: `fe4291ca-d831-4760-96df-c9cb03b3cd95` |
| `results` | array of objects | Result item for each request object. |
| `results[].check_id` | string or null | Echoed check id from the request item. Example: `check_123` |
| `results[].records` | array of objects | The returned court records for this request item. |
| `results[].total_records_available` | integer | Total records available for this request item. Example: `0` |
| `results[].error` | string | Present when an item-level error occurs. |

**Sample response**

```json
{
    "message": "Ok",
    "function": "court_check_multiple",
    "api_reference": "fe4291ca-d831-4760-96df-c9cb03b3cd95",
    "results": [
        {
            "check_id": "check_123",
            "records": [],
            "total_records_available": 0,
            "error": "string"
        }
    ]
}
```

Standard error responses: 400, 401, 402, 403, 429, 5XX (see [Common error responses](/docs/reference/general/common-error-responses.md))

