Skip to content
Rigel docs
Open Rigel

Change what a comment says

tasks.comment.edit

POST/api/v1/households/{household_id}/commands/tasks.comment.edit

  • Command
  • Rigel runs it
  • Applies offline

Rewrites a comment. Only its author can: a person their own, Rigel its own. Newly mentioned people are notified. Fails with comment_not_found or not_comment_author.

Parameters#

Change what a comment says: parameters
FieldDescription
household_idpathstringrequired

The household's ID.

Idempotency-Keyheaderstringoptional

The command's ID. Reuse it when retrying the same command.

Request body#

JSON, as application/json.

Change what a comment says: request body fields
FieldDescription
comment_idstringrequired

A task comment ID, such as tcm_01JC0000000000000000000000.

bodystringrequired

The comment, in Markdown, as written, up to 10,000 characters. Mention people as @ and their name ("@Ada which color?"); they are notified.

at most 10,000 characters

Response#

200 The command was applied.

Change what a comment says: response fields
FieldDescription
resultobjectrequired

What the command returned, such as the IDs it created.

versionintegerrequired

The household version after the command.

Errors#

Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.

Change what a comment says: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404comment_not_foundA comment that isn't there.
404not_foundThe household doesn't exist, or you aren't a member of it.
409not_comment_author
  • Someone else's comment.
  • A person can't change Rigel's comment.
  • Someone with no person can't change a person's comment.
409idempotency_key_reusedThe Idempotency-Key was already used for a different command.

Examples#

These are real. Each scenario is one of the command's test cases, run on a household when this site was built, and the response is what the API returned.

The author rewrites the text; the same mentions change nothing else

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "@Ben which color?"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "@Ben which color?",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "@Ben which color?"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0QSAJD4FZSPFVHKY8

{
  "result": {},
  "version": 1
}

A new mention: they watch and are notified

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Which color, @Ben?"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "Which color, @Ben?",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Which color, @Ben?"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0P2KGPAB9EG53RGZY

{
  "result": {},
  "version": 1
}

A dropped mention is removed and nobody is notified

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Color?"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "Color?",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Color?"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0PPPDZ472X8YGR7T8

{
  "result": {},
  "version": 1
}

Swapping one mention for another

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "@Nia color?"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "@Nia color?",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "@Nia color?"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R01CZ8CHKSJPF2NF4Y

{
  "result": {},
  "version": 1
}

Someone else's comment

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "Changed",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R08GJVGT8F092HBG8C

{
  "error": {
    "code": "not_comment_author",
    "message": "Only the person who wrote a comment can change it. No changes were applied.",
    "details": {
      "comment_id": "tcm_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R08GJVGT8F092HBG8C"
  }
}

A person can't change Rigel's comment

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "Changed",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0NT2WRQA5C3WY2401

{
  "error": {
    "code": "not_comment_author",
    "message": "Only the person who wrote a comment can change it. No changes were applied.",
    "details": {
      "comment_id": "tcm_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0NT2WRQA5C3WY2401"
  }
}

Someone with no person can't change a person's comment

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "Changed",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0RY7HR5DXN7Z5D5PM

{
  "error": {
    "code": "not_comment_author",
    "message": "Only the person who wrote a comment can change it. No changes were applied.",
    "details": {
      "comment_id": "tcm_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0RY7HR5DXN7Z5D5PM"
  }
}

A comment that isn't there

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01JC0000000000000000000001",
    body: "Changed",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "comment_id": "tcm_01JC0000000000000000000001",
  "body": "Changed"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0B7YRP35RH1VHB69J

{
  "error": {
    "code": "comment_not_found",
    "message": "That comment isn't there any more. No changes were applied.",
    "details": {
      "comment_id": "tcm_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0B7YRP35RH1VHB69J"
  }
}

Change a comment

Only its author can. People it newly mentions are notified.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.comment.edit' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CT4FZCM48Y2E24SJC0Z3' \
  -d '{
  "comment_id": "tcm_01M6V9CT4814NB9500SCWV3MXS",
  "body": "Oak. @Ben Okafor, the carpenter can hold the quote until Friday."
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.comment.edit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CT4FZCM48Y2E24SJC0Z3",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    comment_id: "tcm_01M6V9CT4814NB9500SCWV3MXS",
    body: "Oak. @Ben Okafor, the carpenter can hold the quote until Friday.",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.comment.edit HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT4FZCM48Y2E24SJC0Z3

{
  "comment_id": "tcm_01M6V9CT4814NB9500SCWV3MXS",
  "body": "Oak. @Ben Okafor, the carpenter can hold the quote until Friday."
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT4F57ARD9YWWHWX5RTA

{
  "result": {},
  "version": 252
}

For Rigel#

Rigel's tool for this command is tasks_comment_edit. Rigel runs this on its own, then says what it did. The agent guide has the rest.

Rigel is in early access, and sign-up is by invitation. Open Rigel