Skip to main content
PATCH
/
agents
/
tasks
/
comments
/
{comment_id}
Update Task Comment
curl --request PATCH \
  --url https://api.example.com/agents/tasks/comments/{comment_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "body": "<string>"
}
'
import requests

url = "https://api.example.com/agents/tasks/comments/{comment_id}"

payload = { "body": "<string>" }
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({body: JSON.stringify('<string>')})
};

fetch('https://api.example.com/agents/tasks/comments/{comment_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.example.com/agents/tasks/comments/{comment_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'body' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/agents/tasks/comments/{comment_id}"

	payload := strings.NewReader("{\n  \"body\": \"<string>\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.example.com/agents/tasks/comments/{comment_id}")
  .header("Content-Type", "application/json")
  .body("{\n  \"body\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/agents/tasks/comments/{comment_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"body\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "task_id": "<string>",
  "body": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "author_user_id": "<string>",
  "author_instance_id": "<string>",
  "author_agent_type_id": "<string>",
  "edited": false
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Path Parameters

comment_id
string
required

Body

application/json

Request body for editing a task comment.

Attributes: body: New markdown body to replace the existing one.

body
string
required

Response

Successful Response

A markdown comment on a task.

Comments live inside each organization's SurrealDB namespace — the namespace is the organization boundary, so no per-record organization_id field is carried on the row.

Comments are first-class graph nodes connected to tasks via has_comment edges. Authorship is recorded as graph edges as well: user comments use authored_by_user and agent comments persist a dual authored_by_instance plus authored_by_type pair so that type-level attribution survives instance garbage collection.

Attributes: id: SurrealDB record ID (populated by database). task_id: Task this comment belongs to. body: Markdown body of the comment. author_type: Whether the author is a user or an agent. author_user_id: User ID when author_type is user. author_instance_id: Agent instance ID when author_type is agent. author_agent_type_id: Agent type ID when author_type is agent. edited: True after at least one update.

task_id
string
required
body
string
required
author_type
enum<string>
required

Source of a task comment.

Available options:
user,
agent
created_at
string<date-time>
updated_at
string<date-time>
id
string | null
author_user_id
string | null
author_instance_id
string | null
author_agent_type_id
string | null
edited
boolean
default:false