Skip to content
Rigel docs
Open Rigel

Rename a tag

tasks.tag.rename

POST/api/v1/households/{household_id}/commands/tasks.tag.rename

  • Command
  • Rigel runs it
  • Applies offline

Renames a tag everywhere it's used. Fails with tag_not_found, or name_taken when another tag already has the name ignoring case (move its tasks with tasks.task.set_tags, then remove one).

Parameters#

Rename a tag: 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.

Rename a tag: request body fields
FieldDescription
tag_idstringrequired

A tag ID, such as tag_01JC0000000000000000000000.

namestringrequired

A tag's name, as written, 1–50 characters, without "#": "errands". Matched ignoring case.

at most 50 characters

Response#

200 The command was applied.

Rename a tag: 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.

Rename a tag: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404tag_not_foundA tag that isn't there.
404not_foundThe household doesn't exist, or you aren't a member of it.
409name_takenAnother tag's name ignoring case.
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.

Renames the tag

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

{
  "tag_id": "tag_01JC0000000000000000000001",
  "name": "chores"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0T1BMDJP6RW4B2M6H

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

A different case of its own name is allowed

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

{
  "tag_id": "tag_01JC0000000000000000000001",
  "name": "Errands"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06NKR19JZD0W4R3AC

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

Its own name again writes nothing

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

{
  "tag_id": "tag_01JC0000000000000000000001",
  "name": "errands"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0SEKHDW8XWD011GNE

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

Another tag's name ignoring case

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

{
  "tag_id": "tag_01JC0000000000000000000001",
  "name": "outSIDE"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0KS7PB4317KN3JD1Y

{
  "error": {
    "code": "name_taken",
    "message": "Another tag already has that name. No changes were applied.",
    "details": {
      "tag_id": "tag_01JC0000000000000000000002"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0KS7PB4317KN3JD1Y"
  }
}

A tag that isn't there

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

{
  "tag_id": "tag_01JC0000000000000000000001",
  "name": "chores"
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09Z7R45RSKW4FC5C3

{
  "error": {
    "code": "tag_not_found",
    "message": "That tag isn't there any more. No changes were applied.",
    "details": {
      "tag_id": "tag_01JC0000000000000000000001"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R09Z7R45RSKW4FC5C3"
  }
}

Rename a tag

It changes everywhere the tag is used.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.tag.rename' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CT6GP2R1R632MATKBBX9' \
  -d '{
  "tag_id": "tag_01M6V9CT2W0CCE5JSQRR9GSCT6",
  "name": "yard"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.tag.rename", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CT6GP2R1R632MATKBBX9",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    tag_id: "tag_01M6V9CT2W0CCE5JSQRR9GSCT6",
    name: "yard",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.tag.rename HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT6GP2R1R632MATKBBX9

{
  "tag_id": "tag_01M6V9CT2W0CCE5JSQRR9GSCT6",
  "name": "yard"
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT6GY932E3NMF9NT8V78

{
  "result": {},
  "version": 256
}

Rename a tag to a name that's taken

Names are unique ignoring case. Move the tasks with tasks.task.set_tags, then remove one.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.tag.rename' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CT6JDREGP341YS14EVF7' \
  -d '{
  "tag_id": "tag_01M6V9CT2HYP2JXTPT7T98VN41",
  "name": "Chores"
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.tag.rename", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CT6JDREGP341YS14EVF7",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    tag_id: "tag_01M6V9CT2HYP2JXTPT7T98VN41",
    name: "Chores",
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.tag.rename HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT6JDREGP341YS14EVF7

{
  "tag_id": "tag_01M6V9CT2HYP2JXTPT7T98VN41",
  "name": "Chores"
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CT6JRC9SBF4V1B5AMRR3

{
  "error": {
    "code": "name_taken",
    "message": "Another tag already has that name. No changes were applied.",
    "details": {
      "tag_id": "tag_01M6V9CT2QMBNSDQ82KK1PJ6AV"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01M6V9CT6JRC9SBF4V1B5AMRR3"
  }
}

For Rigel#

Rigel's tool for this command is tasks_tag_rename. 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