Actions40
- Create Bullets Request Actions
- Create Document Request Actions
- Create Headers & Footers Request Actions
- Create Images Request Actions
- Create Named Ranges Request Actions
- Create Tables Request Actions
- Create Tabs Request Actions
- Create Text Request Actions
- Send Request Actions
Create Headers & Footers Request → Create Header
AI-generatedSummary
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: ""}