Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Set page border configuration for a section.- Operation ID:
sections.setPageBorders - API member path:
editor.doc.sections.setPageBorders(...) - Mutates document:
yes - Idempotency:
conditional - Supports tracked mode:
no - Supports dry run:
yes - Deterministic target resolution:
yes
Expected result
Returns a SectionMutationResult receipt; reports NO_OP if page border configuration already matches.Input fields
| Field | Type | Required | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
borders | any \ | any \ | any \ | any \ | any \ | any \ | any | yes | One of: any, any, any, any, any, any, any |
borders.bottom | any \ | any \ | any \ | any \ | any \ | any | no | One of: any, any, any, any, any, any | |
borders.bottom.color | string | no | |||||||
borders.bottom.frame | boolean | no | |||||||
borders.bottom.shadow | boolean | no | |||||||
borders.bottom.size | number | no | |||||||
borders.bottom.space | number | no | |||||||
borders.bottom.style | string | no | |||||||
borders.display | enum | no | "allPages", "firstPage", "notFirstPage" | ||||||
borders.left | any \ | any \ | any \ | any \ | any \ | any | no | One of: any, any, any, any, any, any | |
borders.left.color | string | no | |||||||
borders.left.frame | boolean | no | |||||||
borders.left.shadow | boolean | no | |||||||
borders.left.size | number | no | |||||||
borders.left.space | number | no | |||||||
borders.left.style | string | no | |||||||
borders.offsetFrom | enum | no | "page", "text" | ||||||
borders.right | any \ | any \ | any \ | any \ | any \ | any | no | One of: any, any, any, any, any, any | |
borders.right.color | string | no | |||||||
borders.right.frame | boolean | no | |||||||
borders.right.shadow | boolean | no | |||||||
borders.right.size | number | no | |||||||
borders.right.space | number | no | |||||||
borders.right.style | string | no | |||||||
borders.top | any \ | any \ | any \ | any \ | any \ | any | no | One of: any, any, any, any, any, any | |
borders.top.color | string | no | |||||||
borders.top.frame | boolean | no | |||||||
borders.top.shadow | boolean | no | |||||||
borders.top.size | number | no | |||||||
borders.top.space | number | no | |||||||
borders.top.style | string | no | |||||||
borders.zOrder | enum | no | "front", "back" | ||||||
target | SectionAddress | yes | SectionAddress | ||||||
target.kind | "section" | yes | Constant: "section" | ||||||
target.sectionId | string | yes |
Example request
{
"borders": {
"display": "allPages",
"offsetFrom": "page",
"zOrder": "front"
},
"target": {
"kind": "section",
"sectionId": "example"
}
}
Output fields
Variant 1 (section.kind=“section”)
| Field | Type | Required | Description |
|---|---|---|---|
section | SectionAddress | yes | SectionAddress |
section.kind | "section" | yes | Constant: "section" |
section.sectionId | string | yes | |
success | true | yes | Constant: true |
Variant 2 (success=false)
| Field | Type | Required | Description |
|---|---|---|---|
failure | object | yes | |
failure.code | enum | yes | "NO_OP", "INVALID_TARGET", "CAPABILITY_UNAVAILABLE" |
failure.details | any | no | |
failure.message | string | yes | |
success | false | yes | Constant: false |
Example response
{
"section": {
"kind": "section",
"sectionId": "example"
},
"success": true
}
Pre-apply throws
TARGET_NOT_FOUNDINVALID_TARGETINVALID_INPUTCAPABILITY_UNAVAILABLEINTERNAL_ERROR
Non-applied failure codes
NO_OPINVALID_TARGETCAPABILITY_UNAVAILABLE
Raw schemas
Raw input schema
Raw input schema
{
"additionalProperties": false,
"properties": {
"borders": {
"additionalProperties": false,
"oneOf": [
{
"required": [
"display"
]
},
{
"required": [
"offsetFrom"
]
},
{
"required": [
"zOrder"
]
},
{
"required": [
"top"
]
},
{
"required": [
"right"
]
},
{
"required": [
"bottom"
]
},
{
"required": [
"left"
]
}
],
"properties": {
"bottom": {
"additionalProperties": false,
"oneOf": [
{
"required": [
"style"
]
},
{
"required": [
"size"
]
},
{
"required": [
"space"
]
},
{
"required": [
"color"
]
},
{
"required": [
"shadow"
]
},
{
"required": [
"frame"
]
}
],
"properties": {
"color": {
"type": "string"
},
"frame": {
"type": "boolean"
},
"shadow": {
"type": "boolean"
},
"size": {
"minimum": 0,
"type": "number"
},
"space": {
"minimum": 0,
"type": "number"
},
"style": {
"type": "string"
}
},
"type": "object"
},
"display": {
"enum": [
"allPages",
"firstPage",
"notFirstPage"
]
},
"left": {
"additionalProperties": false,
"oneOf": [
{
"required": [
"style"
]
},
{
"required": [
"size"
]
},
{
"required": [
"space"
]
},
{
"required": [
"color"
]
},
{
"required": [
"shadow"
]
},
{
"required": [
"frame"
]
}
],
"properties": {
"color": {
"type": "string"
},
"frame": {
"type": "boolean"
},
"shadow": {
"type": "boolean"
},
"size": {
"minimum": 0,
"type": "number"
},
"space": {
"minimum": 0,
"type": "number"
},
"style": {
"type": "string"
}
},
"type": "object"
},
"offsetFrom": {
"enum": [
"page",
"text"
]
},
"right": {
"additionalProperties": false,
"oneOf": [
{
"required": [
"style"
]
},
{
"required": [
"size"
]
},
{
"required": [
"space"
]
},
{
"required": [
"color"
]
},
{
"required": [
"shadow"
]
},
{
"required": [
"frame"
]
}
],
"properties": {
"color": {
"type": "string"
},
"frame": {
"type": "boolean"
},
"shadow": {
"type": "boolean"
},
"size": {
"minimum": 0,
"type": "number"
},
"space": {
"minimum": 0,
"type": "number"
},
"style": {
"type": "string"
}
},
"type": "object"
},
"top": {
"additionalProperties": false,
"oneOf": [
{
"required": [
"style"
]
},
{
"required": [
"size"
]
},
{
"required": [
"space"
]
},
{
"required": [
"color"
]
},
{
"required": [
"shadow"
]
},
{
"required": [
"frame"
]
}
],
"properties": {
"color": {
"type": "string"
},
"frame": {
"type": "boolean"
},
"shadow": {
"type": "boolean"
},
"size": {
"minimum": 0,
"type": "number"
},
"space": {
"minimum": 0,
"type": "number"
},
"style": {
"type": "string"
}
},
"type": "object"
},
"zOrder": {
"enum": [
"front",
"back"
]
}
},
"type": "object"
},
"target": {
"$ref": "#/$defs/SectionAddress"
}
},
"required": [
"target",
"borders"
],
"type": "object"
}
Raw output schema
Raw output schema
{
"oneOf": [
{
"additionalProperties": false,
"properties": {
"section": {
"$ref": "#/$defs/SectionAddress"
},
"success": {
"const": true
}
},
"required": [
"success",
"section"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"failure": {
"additionalProperties": false,
"properties": {
"code": {
"enum": [
"NO_OP",
"INVALID_TARGET",
"CAPABILITY_UNAVAILABLE"
]
},
"details": {},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"success": {
"const": false
}
},
"required": [
"success",
"failure"
],
"type": "object"
}
]
}
Raw success schema
Raw success schema
{
"additionalProperties": false,
"properties": {
"section": {
"$ref": "#/$defs/SectionAddress"
},
"success": {
"const": true
}
},
"required": [
"success",
"section"
],
"type": "object"
}
Raw failure schema
Raw failure schema
{
"additionalProperties": false,
"properties": {
"failure": {
"additionalProperties": false,
"properties": {
"code": {
"enum": [
"NO_OP",
"INVALID_TARGET",
"CAPABILITY_UNAVAILABLE"
]
},
"details": {},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"success": {
"const": false
}
},
"required": [
"success",
"failure"
],
"type": "object"
}

