headerFooters.pageNumbers.set

Atomically add a section's page numbers or change them: move them between header and footer, realign them, show or hide them on the first page, and set the number style and start. Available on v2-backed sessions only; v1-backed sessions currently return `CAPABILITY_UNAVAILABLE`.

mutates documentdry runconditional
doc.headerFooters.pageNumbers.set(…)

Expected result

Returns the numbered header/footer parts and whether the section uses a distinct first page; PRECONDITION_FAILED with reason page-number-has-content when a moved or hidden number shares its paragraph with other text or fields.

Inputs

sectionSectionAddressrequired
Fields
kind"section"required
sectionIdstringrequired
kind"header" | "footer"required
4 additional input fields
alignment"left" | "center" | "right"
showOnFirstPageboolean
format"decimal" | "lowerLetter" | "upperLetter" | "lowerRoman" | "upperRoman" | "numberInDash" | "hebrew1" | "hebrew2"
startinteger | null
Variant 1

No fields.

Variant 2

No fields.

Result

Output fields
true
successtruerequired
sectionSectionAddressrequired
Fields
kind"section"required
sectionIdstringrequired
kind"header" | "footer"required
partsobject[]required
titlePagebooleanrequired
false
successfalserequired
failureobjectrequired
Fields
code"TARGET_NOT_FOUND" | "PRECONDITION_FAILED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR"required
messagestringrequired
detailsunknown

Failures

Pre-apply throws

  • INVALID_INPUT
  • INVALID_TARGET
  • CAPABILITY_UNAVAILABLE
1 more codes
  • INTERNAL_ERROR

Non-applied receipt codes

  • TARGET_NOT_FOUND
  • PRECONDITION_FAILED
  • CAPABILITY_UNAVAILABLE
1 more codes
  • INTERNAL_ERROR

Raw schemas

Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.

View raw JSON schemas