Google Docs Batch Update icon

Google Docs Batch Update

Build and send Google Docs batch update requests

Create Headers & Footers Request → Create Header

AI-generated

Summary

Create a header in a Google Docs document at a specified index

Inputs

  • type (required) — The type of header to create (e.g., unspecified or default)
  • index (required) — Zero‑based index of the header position in UTF‑16 code units
  • additionalLocationFields — Optional fields such as segmentId and tabId that further locate the header

Output shape

an object representing the CreateHeader request (empty if no optional fields are set)

The request may be omitted when all optional fields are missing; it is added to a batch request for execution

Examples

Example 1: Add a default header to the first section of a document

type: DEFAULT, index: 0, additionalLocationFields: {segmentId: "", tabId: ""}

Links

Discussion