Skip to main content
Alpha: Document API is currently alpha and subject to breaking changes.

Summary

Merge two adjacent list sequences into one.
  • Operation ID: lists.join
  • API member path: editor.doc.lists.join(...)
  • Mutates document: yes
  • Idempotency: conditional
  • Supports tracked mode: no
  • Supports dry run: yes
  • Deterministic target resolution: yes

Expected result

Returns a ListsJoinResult with the resulting listId of the merged sequence.

Input fields

FieldTypeRequiredDescription
directionenumyes"withPrevious", "withNext"
targetListItemAddressyesListItemAddress
target.kind"block"yesConstant: "block"
target.nodeIdstringyes
target.nodeType"listItem"yesConstant: "listItem"

Example request

{
  "direction": "withPrevious",
  "target": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "listItem"
  }
}

Output fields

Variant 1 (success=true)

FieldTypeRequiredDescription
listIdstringyes
successtrueyesConstant: true

Variant 2 (success=false)

FieldTypeRequiredDescription
failureobjectyes
failure.codeenumyes"INVALID_TARGET", "NO_ADJACENT_SEQUENCE", "INCOMPATIBLE_DEFINITIONS", "ALREADY_SAME_SEQUENCE"
failure.detailsanyno
failure.messagestringyes
successfalseyesConstant: false

Example response

{
  "listId": "example",
  "success": true
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_TARGET

Non-applied failure codes

  • INVALID_TARGET
  • NO_ADJACENT_SEQUENCE
  • INCOMPATIBLE_DEFINITIONS
  • ALREADY_SAME_SEQUENCE

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "direction": {
      "enum": [
        "withPrevious",
        "withNext"
      ]
    },
    "target": {
      "$ref": "#/$defs/ListItemAddress"
    }
  },
  "required": [
    "target",
    "direction"
  ],
  "type": "object"
}
{
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "listId": {
          "type": "string"
        },
        "success": {
          "const": true
        }
      },
      "required": [
        "success",
        "listId"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "failure": {
          "additionalProperties": false,
          "properties": {
            "code": {
              "enum": [
                "INVALID_TARGET",
                "NO_ADJACENT_SEQUENCE",
                "INCOMPATIBLE_DEFINITIONS",
                "ALREADY_SAME_SEQUENCE"
              ]
            },
            "details": {},
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object"
        },
        "success": {
          "const": false
        }
      },
      "required": [
        "success",
        "failure"
      ],
      "type": "object"
    }
  ]
}
{
  "additionalProperties": false,
  "properties": {
    "listId": {
      "type": "string"
    },
    "success": {
      "const": true
    }
  },
  "required": [
    "success",
    "listId"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "INVALID_TARGET",
            "NO_ADJACENT_SEQUENCE",
            "INCOMPATIBLE_DEFINITIONS",
            "ALREADY_SAME_SEQUENCE"
          ]
        },
        "details": {},
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}