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

Summary

Create a new independent header/footer part, optionally cloned from an existing part.
  • Operation ID: headerFooters.parts.create
  • API member path: editor.doc.headerFooters.parts.create(...)
  • Mutates document: yes
  • Idempotency: non-idempotent
  • Supports tracked mode: no
  • Supports dry run: yes
  • Deterministic target resolution: yes

Expected result

Returns a HeaderFooterPartsMutationResult with the new refId/partPath on success, INVALID_TARGET failure when sourceRefId is invalid or mismatched.

Input fields

FieldTypeRequiredDescription
kindenumyes"header", "footer"
sourceRefIdstringno

Example request

{
  "kind": "header",
  "sourceRefId": "example"
}

Output fields

Variant 1 (success=true)

FieldTypeRequiredDescription
partPathstringyes
refIdstringyes
successtrueyesConstant: true

Variant 2 (success=false)

FieldTypeRequiredDescription
failureobjectyes
failure.codeenumyes"INVALID_TARGET"
failure.detailsanyno
failure.messagestringyes
successfalseyesConstant: false

Example response

{
  "partPath": "example",
  "refId": "example",
  "success": true
}

Pre-apply throws

  • INVALID_TARGET
  • INVALID_INPUT
  • CAPABILITY_UNAVAILABLE
  • INTERNAL_ERROR

Non-applied failure codes

  • INVALID_TARGET

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "kind": {
      "enum": [
        "header",
        "footer"
      ]
    },
    "sourceRefId": {
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "kind"
  ],
  "type": "object"
}
{
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "partPath": {
          "type": "string"
        },
        "refId": {
          "type": "string"
        },
        "success": {
          "const": true
        }
      },
      "required": [
        "success",
        "refId",
        "partPath"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "failure": {
          "additionalProperties": false,
          "properties": {
            "code": {
              "enum": [
                "INVALID_TARGET"
              ]
            },
            "details": {},
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object"
        },
        "success": {
          "const": false
        }
      },
      "required": [
        "success",
        "failure"
      ],
      "type": "object"
    }
  ]
}
{
  "additionalProperties": false,
  "properties": {
    "partPath": {
      "type": "string"
    },
    "refId": {
      "type": "string"
    },
    "success": {
      "const": true
    }
  },
  "required": [
    "success",
    "refId",
    "partPath"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "INVALID_TARGET"
          ]
        },
        "details": {},
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}