# Retrieve Company Risk Report

`GET /company_risk/{api_reference}`

- Live: `GET https://gdapi.globaldata.net.au/api/v2/company_risk/{api_reference}`
- Sandbox: `GET https://sandbox-gdapi.globaldata.net.au/api/v2/company_risk/{api_reference}`

Polls the status of a company risk report that was queued via `POST /company_risk`. Provide the `api_reference`
returned from the original request to determine whether the report is ready, download the JSON payload, or stream a
PDF copy. This retrieval call is not billable and can be repeated until the report is ready.

- While the report is still compiling the API responds with HTTP `202`. Keep polling with an exponential backoff.
- Once ready, the endpoint returns HTTP `200` with the full JSON report plus the `company_risk_show`
  `api_reference` for auditing.
- Append `?pdf=true` to stream a formatted PDF copy of the same report. When `pdf=true`, the response body is a PDF
  (`application/pdf`) instead of JSON.
- The service polls upstream data for up to 30 seconds; if no report is available at that point you will receive a
  `202` response. Continue polling with the same `api_reference`.
- A report can only be retrieved for 24 hours after the original `POST /company_risk` request. Once that window has
  passed the endpoint responds with HTTP `410` and you need to submit a new report request.

## Sandbox usage

Use the sandbox company identifiers listed under `POST /company_risk` to create a request, then poll this endpoint
with the returned `api_reference`. Marble Kookaburra Interiors Pty Ltd (`ABN 84655375652`, `ACN 655375652`) is
configured to return a `202` on the first poll so you can test retry logic.

## Parameters

| Name | In | Type | Description |
|------|----|------|-------------|
| `api_reference` | path | string (uuid) | **Required.** The audit reference returned when the report was queued via `POST /company_risk`. Example: `fe4291ca-d831-4760-96df-c9cb03b3cd95` |
| `pdf` | query | boolean | When set to `true`, returns the report as a PDF document instead of JSON. Omit (or send `false`) to receive the JSON payload. Default: `false` |

## Responses

### 200 Report is ready. Returns JSON by default or a PDF when `pdf=true`.

Content type: `application/json`, `application/pdf`

| Field | Type | Description |
|-------|------|-------------|
| `message` | string | Always `Ok` when the report payload is returned. Example: `Ok` |
| `function` | string | Name of the API function that handled the request. Example: `company_risk_show` |
| `api_reference` | string (uuid) | Audit reference for **this** retrieval call (not the original queue reference). Example: `7cbb094c-0f27-42f4-9f36-9cf0b2f6d5ff` |
| `report` | object (dynamic) | Full company risk report payload. |

**Sample response**

```json
{
    "message": "Ok",
    "function": "company_risk_show",
    "api_reference": "7cbb094c-0f27-42f4-9f36-9cf0b2f6d5ff",
    "report": {
        "id": "7e6b9b1f-3f02-4c8c-8c45-5b1a9a2ce222",
        "entity_type": "company",
        "entity": {
            "abn": "84655375652",
            "acn": "655375652",
            "name": "MARBLE KOOKABURRA INTERIORS PTY LTD"
        },
        "cases": [
            {
                "case_number": "C-2025-0918",
                "case_type": "Goods and services",
                "court_name": "VIC CAT"
            }
        ]
    }
}
```

Also available as a PDF (application/pdf)

### 202 Report is still being prepared (returned when no data is available after the 30‑second polling window).

Content type: `application/json`

| Field | Type | Description |
|-------|------|-------------|
| `message` | string | Status message indicating the report is not ready yet. Example: `Report is still being processed. Please try again later.` |

**Sample response**

```json
{
    "message": "Report is still being processed. Please try again later."
}
```

### 404 No report was found for the provided `api_reference`, or it belongs to another account/environment.

Content type: `application/json`

| Field | Type | Description |
|-------|------|-------------|
| `message` | string | Error message describing that the record could not be located. Example: `Not Found.` |

**Sample response**

```json
{
    "message": "Not Found."
}
```

### 410 The report can no longer be retrieved. Reports are only available for retrieval for 24 hours after the original `POST /company_risk` request. Submit a new report request to obtain a current report.

Content type: `application/json`

| Field | Type | Description |
|-------|------|-------------|
| `message` | string | Error message describing that the report has expired. Example: `This report has expired. Please request a new one` |

**Sample response**

```json
{
    "message": "This report has expired. Please request a new one"
}
```

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

