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

# Reject Comment

Use this API to reject one comment of a check, with one of the four [reject reasons](https://velt.dev/docs/api-reference/rest-apis/v2/agents/checks/overview.md#reject-reasons). It writes the same shape as the Velt SDK's [`rejectSuggestion()`](https://velt.dev/docs/api-reference/sdk/api/api-methods#rejectsuggestion): the comment's `suggestion.status` becomes `rejected`, with `suggestion.rejectReason` (the person's words when given, else the reason), `suggestion.resolvedBy` and `suggestion.resolvedAt`, and the annotation becomes a regular comment.

The comment's status does not change: an Open comment stays Open, with its pin, and a Resolved one stays Resolved. A resolve that was waiting for its verify rescan stops waiting. Like the SDK, it rejects only a suggestion that is still pending (or a comment with no suggestion) that no scan verified: an accepted suggestion is refused with `CHECKS_SUGGESTION_SETTLED`, a verified comment with `CHECKS_ALREADY_VERIFIED`. A comment rejected only by [Exclude Check](https://velt.dev/docs/api-reference/rest-apis/v2/agents/checks/exclude.md) takes the person's reject instead. A rejected comment counts nowhere: not in the check's open count, never makes a check failing, and not in the score. When an agent finds the same problem again, the comment stays rejected as it is: no scan reopens, resolves, verifies or rewrites it.

Reject is idempotent: a comment that is already rejected is left as it is.

The comment must be an agent comment. A person's comment is refused, attached to a check or not: [detach](https://velt.dev/docs/api-reference/rest-apis/v2/agents/checks/comments/detach.md) it instead.

# Endpoint

`POST https://api.velt.dev/v2/agents/checks/comments/reject`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

1 to 512 characters. The organization of the project.

**documentId** `string` *required*

1 to 512 characters. The document of the project.

**annotationId** `string` *required*

The comment annotation id. 1 to 512 characters, no `/`, and not `.` or `..`.

**reason** `string` *required*

`"wrong"`, `"not_important"`, `"not_applicable"` or `"cannot_tell"`.

**userId** `string` *required*

1 to 512 characters. Recorded as the person who rejected the comment.

**feedbackReason** `string`

At most 2,000 characters. The person's own words, stored as `suggestion.rejectReason` and sent with the reason to the agent's feedback.

The schema uses `.strict()`: unknown fields are rejected.

## **Example Requests**

```JSON theme={null}
{
  "data": {
    "organizationId": "org_acme",
    "documentId": "acme-marketing-site",
    "annotationId": "K7mQ2xR9vB4wLdT1sYpN",
    "reason": "not_applicable",
    "userId": "user_sam",
    "feedbackReason": "This link is behind a login on purpose."
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Comment rejected",
    "data": {
      "rejected": true
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "Only an agent comment can be resolved, rejected or reopened here",
    "status": "FAILED_PRECONDITION",
    "details": {
      "reason": "CHECKS_NOT_AGENT_COMMENT"
    }
  }
}
```

**Errors:** `INVALID_ARGUMENT` (a body outside the schema: a missing `annotationId` or `userId`, a `reason` outside the four (`excluded`, which a row can show, is the engine's own and refused here), a `feedbackReason` over 2,000 characters, or an unknown field) / `NOT_FOUND` with `CHECKS_COMMENT_NOT_FOUND` (no such comment in the project) / `FAILED_PRECONDITION` with `CHECKS_NOT_AGENT_COMMENT` (a person's comment), `CHECKS_SUGGESTION_SETTLED` (an accepted suggestion) or `CHECKS_ALREADY_VERIFIED` (a comment a scan verified).

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Comment rejected",
    "data": {
      "rejected": true
    }
  }
}
```


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