コンテンツにスキップ

Arrange one folder's **direct** children in name order, writing the tree's stored `sort_order`.

POST
/api/v1/node-groups/{id}/sort
curl --request POST \
--url https://example.com/api/v1/node-groups/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/sort \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "direction": "asc" }'

Subfolders and member nodes are renumbered as one list (ADR-162): under a parent they are siblings, so A→Z means A→Z over everything in the folder and a subfolder can land between two nodes. Folders deeper down are untouched: the operator right-clicked one folder.

🚨 This replaces an order somebody arranged by hand, and nothing keeps the old one. That is the decision (ADR-130 decision 5) rather than an oversight — the command is reached by right-clicking the folder it acts on, which is the same consent a file manager asks for.

⚠️ Not a bulk placement. Doing this by calling PUT /node-groups/{id}/placement once per child would be a partial write with nothing to read back when it fails halfway. One request, one transaction — the same shape POST /nodes/move takes for a multi-node drag, which places the whole batch in a single statement rather than calling the single-node writer N times.

id
required
string format: uuid

Group id

Media typeapplication/json

Which way to order this folder’s children (ADR-130).

object
direction
required

asc = A → Z, desc = Z → A. Required: there is no sensible default for a command whose whole content is the direction, and a missing field would silently pick one.

string
Allowed values: asc desc

The folder’s direct children were renumbered in name order

No valid bearer token

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Role lacks ManageConfig

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

No such group

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

This core has no write side (skeleton mode)

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}