---
title: "Edit a comment"
method: PUT
path: "/v1/issues/{idOrNumber}/comments/{commentId}"
tags: ["Issues"]
---

# Edit a comment

`PUT /v1/issues/{idOrNumber}/comments/{commentId}`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/issues/{idOrNumber}/comments/{commentId}`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Replaces the body of a comment the caller wrote. People only. The history keeps the old text; editing a guidance comment changes the issue's version.

## Path parameters

- `idOrNumber` string, required
- `commentId` string, required

## Request body

- EditIssueCommentRequest: Replaces the body of a comment its author wrote; people only.
  - `body` string, required: The new markdown body.
  - `version` integer: The version the edit was written against; a stale one is rejected with 409 and the current issue. Null edits against whatever is current.

## Response `200`

Comment edited

- IssueComment: A comment on an issue. A guidance comment, which only people write, is advice every later investigation on the issue's entities weighs; any other comment is a plain note.
  - `author` IssueActor: Who made a change to an issue. An agent is named by its own id and the investigation it acted in, never by the service account it authenticated as, since several agents may share one.
    - `agentId` string: The agent, for an agent actor; null otherwise.
    - `id` string: The person's user id, the agent's execution principal (its service account's token subject), or `system` for the server.
    - `investigationId` string: The investigation the agent acted in, for an agent actor; null otherwise.
    - `kind` 'PERSON' | 'AGENT' | 'SYSTEM': A person, an agent, or the server.
  - `body` string: The markdown body.
  - `channel` 'REST' | 'MCP' | 'SYSTEM': How a change reached the server.
  - `createdAt` string, date-time: When it was written.
  - `editedAt` string, date-time: When its author last changed the body, or null.
  - `guidance` boolean: Whether it is guidance, which agents weigh as advice.
  - `guidanceSetAt` string, date-time: When it was marked guidance, or null.
  - `guidanceSetBy` string: The user id of the person who marked it guidance, or null.
  - `id` string: The comment id.
  - `issueId` string: The issue it is on.
  - `lockedFieldProposal` string: The locked field the comment proposes changing, as named in a `FIELD_LOCKED` error (`priority`, `label:cost`), or null.

## Other responses

- `401`: Unauthorized
- `403`: Not a person, not the comment's author, or no permission to edit
- `404`: Issue or comment not found
- `409`: The issue changed since the given version

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
