> For the complete documentation index, see [llms.txt](https://docs.fraudcheck.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fraudcheck.co.za/consumer-service/reference/case-management/reference-api.md).

# Reference API

Lookups for when you need to find something. You don't need any of these to run a case: the [steps in the guide](/consumer-service/reference/case-management.md) are enough.

Every call uses the same base URL and token as the guide:

```http
https://consumer-service-api.fraudcheckonline.co.za/consumer-service
Authorization: Bearer {your_access_token}
```

| Call                                                                               | Use it to                                                  |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [`GET /case-management/entities?reference_id=`](#find-a-subject-by-your-reference) | Find a subject by your own reference                       |
| [`GET /case-management/entities?q=`](#list-subjects)                               | List or search your subjects                               |
| [`GET /case-management/entities/{entity_id}`](#get-a-subject)                      | Get a subject and their cases                              |
| [`GET /case-management/entities/{entity_id}/audit`](#subject-audit-history)        | See everything recorded about a subject, from its creation |
| [`GET /case-management/cases`](#list-cases)                                        | List your cases, filtered by status, subject or workflow   |
| [`GET /case-management/runs?client_reference=`](#list-runs)                        | Find runs by your own run reference                        |
| [`GET /case-management/workflows`](#list-workflows)                                | See which workflows your account can run                   |
| [`GET /case-management/subject-types`](#subject-types)                             | See which `subject_type` values you can send               |

***

## Find a subject by your reference

```http
GET /case-management/entities?reference_id=CUST-1001
```

| Query          | Required | Description                                           |
| -------------- | -------- | ----------------------------------------------------- |
| `reference_id` | Yes      | The `reference_id` you sent when creating the subject |

Same response as [Get a subject](#get-a-subject). An unknown reference is `404`.

***

## List subjects

```http
GET /case-management/entities?q=Smith&limit=100&offset=0
```

| Query    | Default | Description                                                                          |
| -------- | ------- | ------------------------------------------------------------------------------------ |
| `q`      | —       | Matches name, email, ID number or `reference_id`. Leave it out to list every subject |
| `limit`  | `100`   | Page size, 1–500                                                                     |
| `offset` | `0`     | Rows to skip                                                                         |

```json
{
  "entities": [
    {
      "entity_id": "a3f2c1d0-1111-4aaa-8bbb-000000000001",
      "reference_id": "CUST-1001",
      "legal_name": "Jane Smith",
      "entity_type": "natural_person",
      "status": "active",
      "subject_type": "natural_person",
      "email": "jane.smith@example.com",
      "cellphone": "0820000000",
      "id_type": "SA_ID",
      "id_country": "ZA",
      "id_number": "8601015800086",
      "created_at": "2026-10-29T10:00:00+02:00"
    }
  ],
  "total_count": 1
}
```

***

## Get a subject

```http
GET /case-management/entities/{entity_id}
```

```json
{
  "entity_id": "a3f2c1d0-1111-4aaa-8bbb-000000000001",
  "reference_id": "CUST-1001",
  "legal_name": "Jane Smith",
  "entity_type": "natural_person",
  "status": "active",
  "subject_type": "natural_person",
  "email": "jane.smith@example.com",
  "cellphone": "0820000000",
  "identifiers": [
    { "id_type": "SA_ID", "id_country": "ZA", "id_number": "8601015800086", "is_primary": true }
  ],
  "cases": [
    {
      "case_id": "c7e1b2a4-2222-4ccc-8ddd-000000000002",
      "case_type": "onboarding",
      "case_name": "Retail account onboarding",
      "status": "resolved",
      "resolution": "approved",
      "run_count": 2,
      "created_at": "2026-10-29T10:14:01+02:00"
    }
  ]
}
```

`cases` lists every case opened on this subject. Get one with [`GET /case-management/cases/{case_id}`](/consumer-service/reference/case-management.md#the-case).

***

## Subject audit history

```http
GET /case-management/entities/{entity_id}/audit
```

The subject's own audit trail, oldest first. It starts when the subject is created, before it has any case. What happens on a case is recorded on that case.

```json
{
  "entity_id": "a3f2c1d0-1111-4aaa-8bbb-000000000001",
  "events": [
    {
      "event_type": "subject.created",
      "account_id": 10001,
      "user_id": "20002",
      "request_id": "req_7d1f0c2a9b4e4f3a8c6d5e2b1a0f9e8d",
      "source": "client_api",
      "payload": { "subject_type": "natural_person", "reference_id": "CUST-1001" },
      "created_at": "2026-10-29T10:00:00+02:00"
    }
  ]
}
```

| Field                   | Description                                                                           |
| ----------------------- | ------------------------------------------------------------------------------------- |
| `event_type`            | What happened, for example `subject.created`                                          |
| `account_id`, `user_id` | Your account, and the user whose token made the call                                  |
| `request_id`            | The `X-Request-ID` of the call that made the event. Quote it when you contact support |
| `source`                | Where the event came from, for example `client_api`                                   |
| `payload`               | Details of the event                                                                  |

An unknown `entity_id` is `404`.

***

## List cases

```http
GET /case-management/cases?status=in_review&limit=100&offset=0
```

| Query          | Default | Description                                                       |
| -------------- | ------- | ----------------------------------------------------------------- |
| `status`       | —       | `open`, `in_review` or `resolved`                                 |
| `resolution`   | —       | `approved`, `declined` or `withdrawn`                             |
| `case_type`    | —       | `onboarding`, `periodic_review`, `remediation` or `investigation` |
| `entity_id`    | —       | Only this subject's cases                                         |
| `workflow_key` | —       | Only cases with a run of this workflow                            |
| `limit`        | `100`   | Page size, 1–500                                                  |
| `offset`       | `0`     | Rows to skip                                                      |

```json
{
  "cases": [
    {
      "case_id": "c7e1b2a4-2222-4ccc-8ddd-000000000002",
      "case_type": "onboarding",
      "case_name": "Retail account onboarding",
      "status": "in_review",
      "resolution": null,
      "resolved_by": null,
      "resolved_at": null,
      "created_at": "2026-10-29T10:14:01+02:00",
      "updated_at": "2026-10-29T11:02:10+02:00",
      "entity_id": "a3f2c1d0-1111-4aaa-8bbb-000000000001",
      "reference_id": "CUST-1001",
      "legal_name": "Jane Smith",
      "subject_type": "natural_person",
      "run_count": 2,
      "runs_in_progress": 0,
      "runs_in_review": 1,
      "runs_approved": 1,
      "runs_rejected": 0,
      "workflows": ["fraudcheck_address_verification", "fraudcheck_watchlist_verify"]
    }
  ],
  "total_count": 1
}
```

Cases are ordered by latest activity. The run counts include only the runs that count towards the case: superseded and cancelled runs are left out.

***

## List runs

```http
GET /case-management/runs?client_reference=APP-77-ADDR
```

| Query              | Default | Description                                                                                                                                                                     |
| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `client_reference` | —       | The `client_reference` you sent with the run. A subject's `reference_id` doesn't match here: use [Find a subject by your reference](#find-a-subject-by-your-reference) for that |
| `workflow_key`     | —       | Only runs of this workflow                                                                                                                                                      |
| `run_status`       | —       | `waiting_applicant`, `running`, `in_review`, `decided` or `cancelled`                                                                                                           |
| `limit`            | `100`   | Page size, 1–500                                                                                                                                                                |
| `offset`           | `0`     | Rows to skip                                                                                                                                                                    |

```json
{
  "runs": [
    {
      "transaction_id": "0b8a6c21-4444-4abc-8def-000000000004",
      "case_id": "c7e1b2a4-2222-4ccc-8ddd-000000000002",
      "case_type": "onboarding",
      "case_status": "resolved",
      "entity_id": "a3f2c1d0-1111-4aaa-8bbb-000000000001",
      "legal_name": "Jane Smith",
      "workflow_key": "fraudcheck_address_verification",
      "workflow_name": "Address Verification",
      "run_status": "decided",
      "decision": "approved",
      "decided_at": "2026-10-29T12:40:34+02:00",
      "outcome": "ADDRESS_VERIFIED",
      "client_reference": "APP-77-ADDR",
      "created_at": "2026-10-29T10:14:01+02:00",
      "completed_at": "2026-10-29T12:40:34+02:00"
    }
  ],
  "total_count": 1
}
```

Get the full outcome of a run with [`GET /case-management/runs/{transaction_id}/result`](/consumer-service/reference/case-management.md#the-result-of-a-run).

***

## List workflows

```http
GET /case-management/workflows
```

```json
{
  "workflows": [
    {
      "key": "fraudcheck_address_verification",
      "value": "Address Verification",
      "status": "published",
      "version": 1,
      "published_at": "2026-10-08T09:12:00+02:00"
    }
  ]
}
```

`key` is the `workflow_key` you send in a run. Only `published` workflows can be run.

***

## Subject types

```http
GET /case-management/subject-types
```

```json
{
  "supported_subject_types": ["natural_person"]
}
```

The values your workflows accept. A `subject_type` outside this list is refused with `400`.

***

## Errors

| HTTP      | Meaning                                                         | Action                    |
| --------- | --------------------------------------------------------------- | ------------------------- |
| 401       | Token missing or expired                                        | Request a new token       |
| 404       | No such subject or case on your account                         | Check the id or reference |
| 422       | A path or query value has the wrong type, or an id isn't a UUID | Read `detail`             |
| 502 / 504 | The case service didn't respond in time                         | Retry                     |

***

## Changelog

| Date       | Version | Change                                                                                                                                                                                                           |
| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2026-10-30 | v2.1    | New: a subject's audit history, `GET /case-management/entities/{entity_id}/audit`.                                                                                                                               |
| 2026-10-29 | v2.0    | Ids are UUIDs. Find a subject with `?reference_id=` (replaces `/entities/lookup`). New: list cases and list runs by `client_reference`. Subject identity fields are now `id_type`, `id_country` and `id_number`. |
| 2026-10-27 | v1.0    | Helper calls for Case Management, through the Consumer Service base URL.                                                                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fraudcheck.co.za/consumer-service/reference/case-management/reference-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
