# Accept, dismiss, or restore a suggested test (/docs/api/voice-agents/agent-tests/updateAgentTestSuggestion)

> For the complete documentation index, see [llms.txt](https://docs.tandemcx.ai/llms.txt). Any page on this site can be fetched as Markdown by appending `.md` to its URL.

`PATCH /v1/agent-media/agents/{agentId}/test-suggestions/{sugId}`

Accept, dismiss, or restore a suggested test

Set the suggestion's `status`. Any status may be set, so a dismissed or accepted suggestion goes back to `pending` the same way. Setting `accepted` does not create a test; save the suggestion's `test` with `createAgentTest`.

## Request

**Base URL:** `https://api.tandemcx.ai`

**Authentication:** `Authorization: Bearer <token>` — A Tandem bearer token. Requests are scoped to the organization the token belongs to; no organization header is required.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agentId` | string | Yes | The agent's unique ID. |
| `sugId` | string | Yes | The suggested test's unique ID. |

### Body (`application/json`) — required

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | enum: `pending` \| `accepted` \| `dismissed` | Yes | — |

## Responses

### 200 — The updated suggestion.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `suggestion` | object | No | A test suggested from the agent's reviewed conversations. |
| `suggestion.sugId` | string | No | — |
| `suggestion.agentId` | string | No | — |
| `suggestion.title` | string | No | — |
| `suggestion.reason` | string | No | Why the test is worth adding. |
| `suggestion.evidence` | array of object | No | The conversation lines the suggestion is based on. |
| `suggestion.evidence[].conversationId` | string | No | — |
| `suggestion.evidence[].quote` | string | No | — |
| `suggestion.test` | object | No | A draft test body, not yet validated. `createAgentTest` validates it when it is saved. |
| `suggestion.recId` | string | No | The recommendation this test guards, when the suggestion was made after a recommendation was applied. |
| `suggestion.origin` | enum: `recommend` | No | `recommend` when the suggestion came from `recommendAgentTests`. Absent when coaching suggested it. |
| `suggestion.status` | enum: `pending` \| `accepted` \| `dismissed` | No | — |
| `suggestion.createdAt` | string (date-time) | No | — |
| `suggestion.updatedAt` | string (date-time) | No | — |

### 400 — `error` is `invalid_status` for a missing or unknown `status`, `invalid_sugId` for a malformed suggestion id, or `invalid_agentId` for a malformed path.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | No | A stable machine-readable code. |
| `message` | string | No | A human-readable explanation, safe to show to an end user. Present on errors an operator can act on; browser clients display this field in preference to a generic fallback. |
| `limit` | integer | No | Present on some errors (e.g. `prompt_too_long`) that reject a value against a fixed bound: the bound itself. |
| `length` | integer | No | Present on some errors (e.g. `prompt_too_long`) that reject a value against a fixed bound: the measured size of the rejected value. |
| `reason` | string | No | Present on some errors (e.g. `invalid_avatar_image`) that have more than one cause: which one applied. |

### 401 — Missing, malformed, or expired bearer token.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | No | A stable machine-readable code. |
| `message` | string | No | A human-readable explanation, safe to show to an end user. Present on errors an operator can act on; browser clients display this field in preference to a generic fallback. |
| `limit` | integer | No | Present on some errors (e.g. `prompt_too_long`) that reject a value against a fixed bound: the bound itself. |
| `length` | integer | No | Present on some errors (e.g. `prompt_too_long`) that reject a value against a fixed bound: the measured size of the rejected value. |
| `reason` | string | No | Present on some errors (e.g. `invalid_avatar_image`) that have more than one cause: which one applied. |

### 404 — `error` is `not_found`: the resource does not exist.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | No | A stable machine-readable code. |
| `message` | string | No | A human-readable explanation, safe to show to an end user. Present on errors an operator can act on; browser clients display this field in preference to a generic fallback. |
| `limit` | integer | No | Present on some errors (e.g. `prompt_too_long`) that reject a value against a fixed bound: the bound itself. |
| `length` | integer | No | Present on some errors (e.g. `prompt_too_long`) that reject a value against a fixed bound: the measured size of the rejected value. |
| `reason` | string | No | Present on some errors (e.g. `invalid_avatar_image`) that have more than one cause: which one applied. |
