> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-caio-pizzol-docs-ai-core-preset.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# sections.setPageSetup

> Set page size/orientation properties for a section.

## Summary

Set page size/orientation properties for a section.

* Operation ID: `sections.setPageSetup`
* API member path: `editor.doc.sections.setPageSetup(...)`
* 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 size and orientation already match the requested values.

## Input fields

### Variant 1 (target.kind="section")

| Field              | Type           | Required | Description           |
| ------------------ | -------------- | -------- | --------------------- |
| `target`           | SectionAddress | yes      | SectionAddress        |
| `target.kind`      | `"section"`    | yes      | Constant: `"section"` |
| `target.sectionId` | string         | yes      |                       |
| `width`            | number         | yes      |                       |

### Variant 2 (target.kind="section")

| Field              | Type           | Required | Description           |
| ------------------ | -------------- | -------- | --------------------- |
| `height`           | number         | yes      |                       |
| `target`           | SectionAddress | yes      | SectionAddress        |
| `target.kind`      | `"section"`    | yes      | Constant: `"section"` |
| `target.sectionId` | string         | yes      |                       |

### Variant 3 (target.kind="section")

| Field              | Type           | Required | Description                 |
| ------------------ | -------------- | -------- | --------------------------- |
| `orientation`      | enum           | yes      | `"portrait"`, `"landscape"` |
| `target`           | SectionAddress | yes      | SectionAddress              |
| `target.kind`      | `"section"`    | yes      | Constant: `"section"`       |
| `target.sectionId` | string         | yes      |                             |

### Variant 4 (target.kind="section")

| Field              | Type           | Required | Description           |
| ------------------ | -------------- | -------- | --------------------- |
| `paperSize`        | string         | yes      |                       |
| `target`           | SectionAddress | yes      | SectionAddress        |
| `target.kind`      | `"section"`    | yes      | Constant: `"section"` |
| `target.sectionId` | string         | yes      |                       |

### Example request

```json theme={null}
{
  "target": {
    "kind": "section",
    "sectionId": "example"
  },
  "width": 12.5
}
```

## Output fields

### Variant 1 (success=true)

| 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

```json theme={null}
{
  "section": {
    "kind": "section",
    "sectionId": "example"
  },
  "success": true
}
```

## Pre-apply throws

* `TARGET_NOT_FOUND`
* `INVALID_TARGET`
* `INVALID_INPUT`
* `CAPABILITY_UNAVAILABLE`
* `INTERNAL_ERROR`

## Non-applied failure codes

* `NO_OP`
* `INVALID_TARGET`
* `CAPABILITY_UNAVAILABLE`

## Raw schemas

<Accordion title="Raw input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "oneOf": [
      {
        "required": [
          "target",
          "width"
        ]
      },
      {
        "required": [
          "target",
          "height"
        ]
      },
      {
        "required": [
          "target",
          "orientation"
        ]
      },
      {
        "required": [
          "target",
          "paperSize"
        ]
      }
    ],
    "properties": {
      "height": {
        "minimum": 0,
        "type": "number"
      },
      "orientation": {
        "enum": [
          "portrait",
          "landscape"
        ]
      },
      "paperSize": {
        "minLength": 1,
        "type": "string"
      },
      "target": {
        "$ref": "#/$defs/SectionAddress"
      },
      "width": {
        "minimum": 0,
        "type": "number"
      }
    },
    "required": [
      "target"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw output schema">
  ```json theme={null}
  {
    "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"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="Raw success schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "section": {
        "$ref": "#/$defs/SectionAddress"
      },
      "success": {
        "const": true
      }
    },
    "required": [
      "success",
      "section"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw failure schema">
  ```json theme={null}
  {
    "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"
  }
  ```
</Accordion>
