> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mastermindcms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PageManagementServiceImpl

> Calling public service methods through the REST API: pageManagementServiceImpl

<ResponseField name="beanId" type="string">
  The Spring bean identifier containing the service being called.

  pageManagementServiceImpl
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Bean scope. Use PROTOTYPE for service calls.
</ResponseField>

<ResponseField name="functionName" type="string">
  The public service method name shown in the signature below.
</ResponseField>

<ResponseField name="args" type="object[]">
  The method argument array. Each argument is passed as an object with index 0, 1, and so on; the value must match the Java parameter type.
</ResponseField>

## Headers

```http theme={null}
POST /api/v1/bean/request
Content-Type: application/json
Lang-Context: en
Site-Context: my-site
Authorization: Bearer <token>
```

Send `Lang-Context` and `Site-Context` with every request. For protected methods, send the JWT in the `Authorization` header as `Bearer <token>`.

**Access:** ADMIN. **Bearer Token:** required.

* GUEST — unauthenticated users; only whitelist services are available.
* USER — authentication is required; methods with USER checks are available.
* ADMIN — full access to public methods of all services.
* If a method checks a role internally, GUEST may receive null.

## Methods

<ResponseField name="createPage" type="String">
  | Argument      | Type                            | Description                 |
  | ------------- | ------------------------------- | --------------------------- |
  | `pageRequest` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### createPage

  Example JSON request object:

  ```json theme={null}
  {
      "id":  null,
      "imageUrl":  null,
      "pageUrl":  null,
      "containerType":  null,
      "categoriesId":  null,
      "content":  null,
      "releaseDate":  null,
      "published":  false,
      "imageUrlRemove":  false,
      "metaInfo":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "pageManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "createPage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="deletePage" type="void">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `pageId` | `String` | Passed through `args[0].0`. |

  ### deletePage

  ```json theme={null}
  {
    "beanId": "pageManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "deletePage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="deletePages" type="void">
  | Argument  | Type                | Description                 |
  | --------- | ------------------- | --------------------------- |
  | `pageIds` | `ArrayList<String>` | Passed through `args[0].0`. |

  ### deletePages

  ```json theme={null}
  {
    "beanId": "pageManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "deletePages",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="updatePage" type="void">
  | Argument      | Type                            | Description                 |
  | ------------- | ------------------------------- | --------------------------- |
  | `pageRequest` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### updatePage

  Example JSON request object:

  ```json theme={null}
  {
      "id":  null,
      "imageUrl":  null,
      "pageUrl":  null,
      "containerType":  null,
      "categoriesId":  null,
      "content":  null,
      "releaseDate":  null,
      "published":  false,
      "imageUrlRemove":  false,
      "metaInfo":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "pageManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "updatePage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="duplicatePage" type="void">
  | Argument      | Type                            | Description                 |
  | ------------- | ------------------------------- | --------------------------- |
  | `copyRequest` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### duplicatePage

  Example JSON request object:

  ```json theme={null}
  {
      "fromId":  null,
      "toId":  null,
      "translate":  false,
      "emailTemplate":  false,
      "pageUrl":  null,
      "request":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "pageManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "duplicatePage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="copyPage" type="void">
  | Argument      | Type                            | Description                 |
  | ------------- | ------------------------------- | --------------------------- |
  | `copyRequest` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### copyPage

  Example JSON request object:

  ```json theme={null}
  {
      "fromId":  null,
      "toId":  null,
      "translate":  false,
      "emailTemplate":  false,
      "pageUrl":  null,
      "request":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "pageManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "copyPage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="publishToUrl" type="void">
  | Argument       | Type                            | Description                 |
  | -------------- | ------------------------------- | --------------------------- |
  | `routeRequest` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### publishToUrl

  Example JSON request object:

  ```json theme={null}
  {
      "pageName":  null,
      "pageRoot":  null,
      "containerId":  null,
      "containerType":  null,
      "copyTo":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "pageManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "publishToUrl",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>
