> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helpgenie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Brand Integrity

> Run and manage Brand Integrity audits — automated tests that verify your Genie behaves on-brand across a suite of conversation scenarios.

Brand Integrity lets you simulate conversations with a Genie and score the results against expected behaviour. Audits run asynchronously; progress is broadcast over the `brand-tests` realtime channel. Workspace members share access to their owner's test runs.

***

## Actions

### `all`

Returns all **completed** test runs for a specific Genie, each with its results array embedded.

**agentId** `string` *required*

Genie UUID to fetch runs for.

**dateRange** `string`

Filter by recency — e.g. `"7d"`, `"30d"`. Omit or pass `"all"` for no filter.

**adminMode** `boolean`

Admin only — bypass ownership filter.

**userId** `string`

Admin only — target a specific user's data.

**Response**

```json theme={null}
{
  "items": [
    {
      "id": "run-uuid",
      "agent_id": "agent-uuid",
      "status": "completed",
      "run_type": "full_audit",
      "total_tests": 12,
      "progress": 12,
      "started_at": "2024-01-01T00:00:00Z",
      "completed_at": "2024-01-01T00:05:00Z",
      "results": [ /* brand_test_results rows */ ]
    }
  ]
}
```

***

### `get`

Returns a single test run by ID with its full results array.

**Parameters**

| Field | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Test run UUID (passed as request ID) |

**Response**

```json theme={null}
{
  "testRun": {
    "id": "run-uuid",
    "agent_id": "agent-uuid",
    "status": "completed",
    "results": [ /* brand_test_results rows */ ]
  }
}
```

***

### `list`

Paginated list of test runs across one or more Genies, optionally filtered by status.

**agentId** `string`

Filter to a single Genie.

**agentIds** `string[]`

Filter to multiple Genies. Ignored when `agentId` is set.

**dateRange** `string`

Filter by recency — e.g. `"7d"`, `"30d"`, `"all"`.

**statusFilter** `string` (default: all)

`"all"`, `"passed"`, or `"failed"`.

**runTypes** `string[]`

Only return runs of these types: `"standard"`, `"manual"`, `"full_audit"`, `"handoff_check"`, `"transfer_check"`.

**excludeRunTypes** `string[]`

Leave out runs of these types. Ignored when `runTypes` is given.

**page** `number` (default: 1)

Page number.

**pageSize** `number` (default: 20)

Results per page. Maximum 100.

**adminMode** `boolean`

Admin only — bypass ownership filter.

**userId** `string`

Admin only — target a specific user's data.

**Response**

```json theme={null}
{
  "items": [ /* test runs with embedded results */ ],
  "totalCount": 42,
  "page": 1,
  "pageSize": 20
}
```

***

### `list-results`

Returns all individual test results for a specific run.

**Parameters**

| Field | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Test run UUID |

**Response**

```json theme={null}
{
  "items": [ /* brand_test_results rows, ordered by created_at asc */ ]
}
```

***

### `list-scenarios`

Returns all custom (non-predefined) test scenarios belonging to the authenticated user or workspace.

**Parameters** — none

**Response**

```json theme={null}
{
  "items": [
    {
      "id": "scenario-uuid",
      "name": "Refund Policy Check",
      "description": "Verifies agent handles refund requests correctly",
      "testPrompts": ["I want a refund", "My order never arrived"],
      "isCustom": true,
      "userId": "user-uuid",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ]
}
```

***

### `create-scenario`

Creates a custom test scenario.

**name** `string` *required*

Scenario name.

**testPrompts** `string[]` *required*

Non-empty array of user prompts to simulate in the test.

**description** `string`

Optional description.

**category** `string` (default: custom)

Category label.

**Response** — `201`

```json theme={null}
{
  "scenario": {
    "id": "scenario-uuid",
    "name": "Refund Policy Check",
    "testPrompts": ["I want a refund"],
    "isCustom": true,
    "createdAt": "2024-01-01T00:00:00Z"
  }
}
```

***

### `delete-scenario`

Deletes a custom scenario. Only the owner (or an admin) can delete.

**Parameters**

| Field | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Scenario UUID |

**Response**

```json theme={null}
{ "success": true }
```

***

### `get-audit-scenarios`

Returns AI-generated scenarios that were created for a specific audit run.

**Parameters**

| Field | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Audit run ID (numeric, passed as request ID) |

**Response**

```json theme={null}
{
  "items": [ /* brand_test_scenarios rows ordered by severity asc */ ]
}
```

***

### `save-manual-test`

Saves a manually recorded conversation as a completed test run. Useful for logging quick-test sessions from the UI.

**agentId** `string` *required*

Genie UUID.

**transcript** `array` *required*

Non-empty array of conversation turn objects.

**elevenlabsConversationId** `string`

Voice provider conversation ID for the recorded session.

**durationSeconds** `number`

Duration of the conversation in seconds.

**Response** — `201`

```json theme={null}
{
  "testRun": { /* brand_test_runs row */ }
}
```

***

### `run-full-audit`

Kicks off a full automated Brand Integrity audit for a Genie. Creates a test run in `generating` state, then asynchronously generates scenarios and executes them. Returns immediately with the `testRunId` — subscribe to the `brand-tests` Realtime channel for progress updates.

The Genie must have a voice configured.

**agentId** `string` *required*

Genie UUID to audit.

**regenerate** `boolean`

Force regeneration of scenarios even if they already exist for this Genie.

**scenariosPerCategory** `object`

Per-category scenario counts keyed by category ID, e.g. `{ "pricing": 5 }`. Values are clamped to 1–20; categories you leave out keep their default count.

**Response** — `201`

```json theme={null}
{
  "testRunId": "run-uuid"
}
```

***

### `run-handoff-check`

Kicks off a Handoff Check for a Genie's website live handoff. Five website-visitor situations are played against the Genie; each passes when the Genie's decision to start a live handoff matches what the situation called for. Returns immediately with the `testRunId` — subscribe to the `brand-tests` realtime channel for progress updates.

No phone number is dialled; only the Genie's decision is checked. The run fails with a plain message unless live handoff is switched on with a number to call. Phone-call transfers are checked separately by `run-transfer-check`. The run is stored with `run_type: "handoff_check"`, and each result records its verdict under `analysis_result.handoff`.

The Genie must have a voice configured.

**agentId** `string` *required*

Genie UUID to check.

**Response** — `201`

```json theme={null}
{
  "testRunId": "run-uuid"
}
```

Each completed result carries:

```json theme={null}
{
  "analysis_result": {
    "handoff": {
      "expected": true,
      "called": true,
      "tool_name": "requestHumanHandoff",
      "turn_index": 2,
      "clarity": "direct"
    }
  }
}
```

***

### `run-transfer-check`

Kicks off a Transfer Check for a Genie's phone-call transfers. Five phone-caller situations are played against the Genie; each passes when the Genie transfers only when the caller needs a person **and** picks the transfer number the situation called for. Returns immediately with the `testRunId` — subscribe to the `brand-tests` realtime channel for progress updates.

No phone number is dialled. The run fails with a plain message when the Genie has no transfer number configured. The run is stored with `run_type: "transfer_check"`, and each result records its verdict under `analysis_result.transfer`, including the expected destination and the number the Genie dialled.

The Genie must have a voice configured.

**agentId** `string` *required*

Genie UUID to check.

**Response** — `201`

```json theme={null}
{
  "testRunId": "run-uuid"
}
```

Each completed result carries:

```json theme={null}
{
  "analysis_result": {
    "transfer": {
      "expected": true,
      "called": true,
      "tool_name": "transfer_to_number",
      "turn_index": 3,
      "clarity": "direct",
      "expected_number": "+15551234567",
      "expected_label": "Billing",
      "dialled_number": "+15551234567"
    }
  }
}
```

***

### `run-custom-audit`

Runs a custom audit using a specific selection of categories, AI-suggested tests, and/or saved custom scenario IDs. Returns immediately with `testRunId`; execution is asynchronous.

**agentId** `string` *required*

Genie UUID.

**elevenlabsId** `string` *required*

Voice provider agent ID for the Genie (available from the Genie's voice settings).

**categories** `string[]`

Category IDs to include in the audit.

**suggestedTests** `object[]`

Tailored test objects to run. Each item should include `id`, `name`, `description`, `simulatedUserPrompt`, and `evaluationCriteria`.

**customTestIds** `string[]`

Saved custom scenario UUIDs to include.

**Response** — `201`

```json theme={null}
{
  "testRunId": "run-uuid",
  "status": "running"
}
```

***

## Error codes

| Code | Meaning |
| - | - |
| `VALIDATION_ERROR` | Missing or invalid required parameter |
| `NOT_FOUND` | Test run or scenario not found |
| `FORBIDDEN` | You do not own this resource |
| `AGENT_NOT_FOUND` | Genie does not exist |
| `INTERNAL_ERROR` | Unexpected server error |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.