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

Summary

Insert a bibliography block at a target location.
  • Operation ID: citations.bibliography.insert
  • API member path: editor.doc.citations.bibliography.insert(...)
  • Mutates document: yes
  • Idempotency: non-idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a BibliographyMutationResult indicating success with the bibliography address or a failure.

Input fields

FieldTypeRequiredDescription
atobject(kind=“documentStart”) \object(kind=“documentEnd”) \object(kind=“before”) \object(kind=“after”)yesOne of: object(kind=“documentStart”), object(kind=“documentEnd”), object(kind=“before”), object(kind=“after”)
stylestringno

Example request

{
  "at": {
    "kind": "documentStart"
  },
  "style": "example"
}

Output fields

Variant 1 (bibliography.kind=“block”)

FieldTypeRequiredDescription
bibliographyobject(kind=“block”)yes
bibliography.kind"block"yesConstant: "block"
bibliography.nodeIdstringyes
bibliography.nodeType"bibliography"yesConstant: "bibliography"
successtrueyesConstant: true

Variant 2 (success=false)

FieldTypeRequiredDescription
failureobjectyes
failure.codestringyes
failure.detailsanyno
failure.messagestringyes
successfalseyesConstant: false

Example response

{
  "bibliography": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "bibliography"
  },
  "success": true
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • INVALID_TARGET
  • INVALID_INPUT
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "at": {
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "documentStart"
            }
          },
          "required": [
            "kind"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "documentEnd"
            }
          },
          "required": [
            "kind"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "before"
            },
            "target": {
              "$ref": "#/$defs/BlockNodeAddress"
            }
          },
          "required": [
            "kind",
            "target"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "after"
            },
            "target": {
              "$ref": "#/$defs/BlockNodeAddress"
            }
          },
          "required": [
            "kind",
            "target"
          ],
          "type": "object"
        }
      ]
    },
    "style": {
      "type": "string"
    }
  },
  "required": [
    "at"
  ],
  "type": "object"
}
{
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "bibliography": {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "block"
            },
            "nodeId": {
              "type": "string"
            },
            "nodeType": {
              "const": "bibliography"
            }
          },
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ],
          "type": "object"
        },
        "success": {
          "const": true
        }
      },
      "required": [
        "success",
        "bibliography"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "failure": {
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "details": {},
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object"
        },
        "success": {
          "const": false
        }
      },
      "required": [
        "success",
        "failure"
      ],
      "type": "object"
    }
  ]
}
{
  "additionalProperties": false,
  "properties": {
    "bibliography": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "block"
        },
        "nodeId": {
          "type": "string"
        },
        "nodeType": {
          "const": "bibliography"
        }
      },
      "required": [
        "kind",
        "nodeType",
        "nodeId"
      ],
      "type": "object"
    },
    "success": {
      "const": true
    }
  },
  "required": [
    "success",
    "bibliography"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "details": {},
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}