---
title: "createPage"
canonical: "https://support.appfire.com/space/PSCONF/15306091/createPage"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | createPage(spaceKey, parentId, pageTitle, pageContent) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Creates an issue based on the provided arguments.

Creates an issue based on the provided arguments.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | spaceKey | String | Yes | Key of space to create the new page in. |
> | parentId | Number | Yes | The ID of the parent page. If the page is at the root level (top level) the parent page should be the spaces home page. |
> | pageTitle | String | Yes | Title of the new page. |
> | pageContent | String | Yes | Content to be displayed on the new page. |

## Return Type

**number **

The page ID of the newly created page.

## Examples

### Example 1

```javascript
string spaceKey = "PSCONF";
number parentPageId = 11801;
string pageTitle = "New Page";
string pageContent = "<p>This page was created by Power Scripts!<p>";
number newPage = createPage(spaceKey, parentPageId, pageTitle, pageContent);
%newPage%.labels += "new";
```

### Example 2

```javascript
number homePage = getPage("PSCONF", "Power Scripts for Confluence Home");
number newPage = createPage(%homePage%.space, %homePage%.id, "New Page", %homePage%.content);
%newPage%.labels += "new";
```

## See also

> Macro (contentbylabel)