# sections.setPageBorders

> Set page border configuration for a section.



- Member path: `doc.sections.setPageBorders(…)`
- Mutates document: yes
- Idempotency: `conditional`
- Supports tracked mode: no
- Supports dry run: yes

## Expected result

Returns a SectionMutationResult receipt; reports NO_OP if page border configuration already matches.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "SectionAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "section"
        },
        "sectionId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "sectionId"
      ]
    }
  },
  "type": "object",
  "properties": {
    "target": {
      "$ref": "#/$defs/SectionAddress"
    },
    "borders": {
      "type": "object",
      "properties": {
        "display": {
          "enum": [
            "allPages",
            "firstPage",
            "notFirstPage"
          ]
        },
        "offsetFrom": {
          "enum": [
            "page",
            "text"
          ]
        },
        "zOrder": {
          "enum": [
            "front",
            "back"
          ]
        },
        "top": {
          "type": "object",
          "properties": {
            "style": {
              "type": "string"
            },
            "size": {
              "type": "number",
              "minimum": 0
            },
            "space": {
              "type": "number",
              "minimum": 0
            },
            "color": {
              "type": "string"
            },
            "shadow": {
              "type": "boolean"
            },
            "frame": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "oneOf": [
            {
              "required": [
                "style"
              ]
            },
            {
              "required": [
                "size"
              ]
            },
            {
              "required": [
                "space"
              ]
            },
            {
              "required": [
                "color"
              ]
            },
            {
              "required": [
                "shadow"
              ]
            },
            {
              "required": [
                "frame"
              ]
            }
          ]
        },
        "right": {
          "type": "object",
          "properties": {
            "style": {
              "type": "string"
            },
            "size": {
              "type": "number",
              "minimum": 0
            },
            "space": {
              "type": "number",
              "minimum": 0
            },
            "color": {
              "type": "string"
            },
            "shadow": {
              "type": "boolean"
            },
            "frame": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "oneOf": [
            {
              "required": [
                "style"
              ]
            },
            {
              "required": [
                "size"
              ]
            },
            {
              "required": [
                "space"
              ]
            },
            {
              "required": [
                "color"
              ]
            },
            {
              "required": [
                "shadow"
              ]
            },
            {
              "required": [
                "frame"
              ]
            }
          ]
        },
        "bottom": {
          "type": "object",
          "properties": {
            "style": {
              "type": "string"
            },
            "size": {
              "type": "number",
              "minimum": 0
            },
            "space": {
              "type": "number",
              "minimum": 0
            },
            "color": {
              "type": "string"
            },
            "shadow": {
              "type": "boolean"
            },
            "frame": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "oneOf": [
            {
              "required": [
                "style"
              ]
            },
            {
              "required": [
                "size"
              ]
            },
            {
              "required": [
                "space"
              ]
            },
            {
              "required": [
                "color"
              ]
            },
            {
              "required": [
                "shadow"
              ]
            },
            {
              "required": [
                "frame"
              ]
            }
          ]
        },
        "left": {
          "type": "object",
          "properties": {
            "style": {
              "type": "string"
            },
            "size": {
              "type": "number",
              "minimum": 0
            },
            "space": {
              "type": "number",
              "minimum": 0
            },
            "color": {
              "type": "string"
            },
            "shadow": {
              "type": "boolean"
            },
            "frame": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "oneOf": [
            {
              "required": [
                "style"
              ]
            },
            {
              "required": [
                "size"
              ]
            },
            {
              "required": [
                "space"
              ]
            },
            {
              "required": [
                "color"
              ]
            },
            {
              "required": [
                "shadow"
              ]
            },
            {
              "required": [
                "frame"
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "display"
          ]
        },
        {
          "required": [
            "offsetFrom"
          ]
        },
        {
          "required": [
            "zOrder"
          ]
        },
        {
          "required": [
            "top"
          ]
        },
        {
          "required": [
            "right"
          ]
        },
        {
          "required": [
            "bottom"
          ]
        },
        {
          "required": [
            "left"
          ]
        }
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "target",
    "borders"
  ]
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "SectionAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "section"
        },
        "sectionId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "sectionId"
      ]
    }
  },
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "section": {
          "$ref": "#/$defs/SectionAddress"
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "section"
      ]
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "const": false
        },
        "failure": {
          "type": "object",
          "properties": {
            "code": {
              "enum": [
                "NO_OP",
                "INVALID_TARGET",
                "CAPABILITY_UNAVAILABLE"
              ]
            },
            "message": {
              "type": "string"
            },
            "details": {}
          },
          "additionalProperties": false,
          "required": [
            "code",
            "message"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "failure"
      ]
    }
  ]
}
```

## Pre-apply throws

- `TARGET_NOT_FOUND`
- `INVALID_TARGET`
- `INVALID_INPUT`
- `CAPABILITY_UNAVAILABLE`
- `INTERNAL_ERROR`

## Non-applied receipt codes

- `NO_OP`
- `INVALID_TARGET`
- `CAPABILITY_UNAVAILABLE`

