# KYB Case Management

### Managing KYB Verification Cases

This guide covers how to retrieve, update, and manage KYB cases, including document management, UBO invitations, business search, and case approval/rejection.

## Retrieve Case Information

### Get Case by ID

Retrieve detailed information about a specific KYB case.

#### Endpoint

* **Method**: `GET`
* **URL**: `/kyb/case/{id}`
* **Authentication**: Required (x-api-key header)

#### Example Request

```bash
curl -X GET https://api.voveid.com/kyb/case/65f1a2b3c4d5e6f7g8h9i0j1 \
  -H "x-api-key: YOUR_API_KEY"
```

#### Example Response

```json
{
  "id": "65f1a2b3c4d5e6f7g8h9i0j1",
  "businessName": "Acme Corporation",
  "refId": "unique-business-ref-12345",
  "status": "IN_PROGRESS",
  "flow": {
    "id": "64a1b2c3d4e5f6g7h8i9j0k1",
    "name": "UK Business Verification",
    "country": "GB",
    "configuration": {...}
  },
  "formData": {
    "registrationNumber": "12345678",
    "country": "GB",
    "city": "London",
    "address": "123 Business Street"
  },
  "documents": [
    {
      "id": "doc-123",
      "documentType": "CERTIFICATE_OF_INCORPORATION",
      "fileName": "certificate.pdf",
      "uploadedAt": "2024-01-15T11:00:00.000Z",
      "analysis": {
        "extracted": {...},
        "confidence": 0.95
      }
    }
  ],
  "ubos": [
    {
      "refId": "ubo-john-doe",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@example.com",
      "status": "COMPLETED",
      "ownership": 50
    }
  ],
  "businessSearch": {
    "verified": true,
    "data": {...}
  },
  "websiteAnalysis": {
    "status": "COMPLETED",
    "risk": "LOW",
    "data": {...}
  },
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T14:30:00.000Z",
  "submittedAt": "2024-01-15T14:30:00.000Z"
}
```

### List All Cases

Retrieve a paginated list of all KYB cases with filtering options.

#### Endpoint

* **Method**: `GET`
* **URL**: `/kyb/case`
* **Authentication**: Required (x-api-key header)

#### Query Parameters

| Parameter   | Type   | Description                                                                   |
| ----------- | ------ | ----------------------------------------------------------------------------- |
| `page`      | number | Page number (default: 1)                                                      |
| `limit`     | number | Items per page (default: 10)                                                  |
| `status`    | string | Filter by status: NOT\_STARTED, IN\_PROGRESS, IN\_REVIEW, COMPLETED, REJECTED |
| `search`    | string | Search by business name or refId                                              |
| `flowId`    | string | Filter by KYB flow ID                                                         |
| `startDate` | string | Filter cases created after this date (ISO 8601)                               |
| `endDate`   | string | Filter cases created before this date (ISO 8601)                              |

#### Example Request

```bash
curl -X GET "https://api.voveid.com/kyb/case?page=1&limit=20&status=IN_REVIEW" \
  -H "x-api-key: YOUR_API_KEY"
```

#### Example Response

```json
{
  "data": [
    {
      "id": "65f1a2b3c4d5e6f7g8h9i0j1",
      "businessName": "Acme Corporation",
      "refId": "unique-business-ref-12345",
      "status": "IN_REVIEW",
      "createdAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "totalPages": 3
  }
}
```

## Error Responses

### Common Error Codes

#### 400 Bad Request

```json
{
  "statusCode": 400,
  "message": "Invalid case status transition",
  "error": "Cannot change status from COMPLETED to IN_PROGRESS"
}
```

#### 401 Unauthorized

```json
{
  "statusCode": 401,
  "message": "Invalid or expired session token"
}
```

#### 403 Forbidden

```json
{
  "statusCode": 403,
  "message": "Insufficient permissions to perform this action"
}
```

#### 404 Not Found

```json
{
  "statusCode": 404,
  "message": "KYB case not found"
}
```

## Related Documentation

* [KYB Overview](/docs/kyb-know-your-business/kyb-overview.md) - Understand the KYB verification flow
* [Create KYB Case](/docs/kyb-know-your-business/kyb-create-case.md) - Learn how to create cases
* [KYB Webhooks](/docs/kyb-know-your-business/kyb-webhooks.md) - Set up real-time notifications

<br>


---

# 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://docs.voveid.com/docs/kyb-know-your-business/kyb-case-management.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.
