# Case File

Retrieve a case file. A case is automatically created with each search and groups related searches on an entity together.

## Get Case File

### Request

```
GET https://api.revolutio.systems/casefile/{caseId}
```

**Headers**

| Header          | Value              |
| --------------- | ------------------ |
| `Authorization` | `Bearer <idToken>` |

**Path Parameters**

| Parameter | Type   | Description                                   |
| --------- | ------ | --------------------------------------------- |
| `caseId`  | string | The case ID (returned in the search response) |

### Response

{% tabs %}
{% tab title="200 OK" %}

```json
{
  "_id": "xyz789caseId",
  "createdAt": "2025-01-15T10:30:00.000Z",
  "userId": "user-uid",
  "searches": [
    {
      "_id": "abc123searchId",
      "caseId": "xyz789caseId",
      "createdAt": "2025-01-15T10:30:00.000Z",
      "searchInputs": {
        "identifier": "12345678",
        "jurisdiction": "GB"
      },
      "status": "COMPLETED",
      "updatedAt": "2025-01-15T10:30:05.000Z",
      "result": {
        "_id": "entity-uuid",
        "legalName": "EXAMPLE LTD",
        "companyStatus": "Active",
        "countryOfRegistration": "GB",
        "addresses": [...],
        "identifiers": [...],
        "relationships": [...]
      }
    }
  ]
}
```

| Field       | Type   | Description                                                         |
| ----------- | ------ | ------------------------------------------------------------------- |
| `_id`       | string | Case ID                                                             |
| `createdAt` | string | ISO 8601 timestamp                                                  |
| `userId`    | string | The user who created the case                                       |
| `searches`  | array  | Array of [Search](#search-object) objects associated with this case |

**Search Object**

| Field          | Type                                                              | Description                         |
| -------------- | ----------------------------------------------------------------- | ----------------------------------- |
| `_id`          | string                                                            | Search ID                           |
| `caseId`       | string                                                            | Parent case ID                      |
| `searchInputs` | object                                                            | The original search parameters      |
| `status`       | string                                                            | `PENDING`, `COMPLETED`, or `FAILED` |
| `result`       | [Entity](broken://pages/4e33f6a9287ef4ce31640f92f56a31fab0d4202e) | The search result (when completed)  |
| `createdAt`    | string                                                            | ISO 8601 timestamp                  |
| `updatedAt`    | string                                                            | ISO 8601 timestamp                  |
| {% endtab %}   |                                                                   |                                     |

{% tab title="400 Bad Request" %}

```json
{
  "error": "Missing caseId"
}
```

{% endtab %}

{% tab title="404 Not Found" %}

```json
{
  "error": "Case not found"
}
```

{% endtab %}
{% endtabs %}

### Example (cURL)

```bash
curl -s https://api.revolutio.systems/casefile/xyz789caseId \
  -H "Authorization: Bearer $TOKEN" | jq .
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://equinoxe-systems.gitbook.io/revolutio-api/case-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
