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

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | admCreateSpace(spaceKey, spaceName, spaceDescription, user) | **Package** |  |
> | **Alias** | admCreateSpace(cSpaceType) | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Creates a new space, optionally offering support for the category of the space.

Creates a new space, optionally offering support for the category of the space.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | space key | String | Yes | Key of new space. Required if not using CSpace as the parameter. |
> | space name | String | Yes | Name of new space. Required if not using CSpace as the parameter. |
> | space description | String | Yes | Description for the new space. Required if not using CSpace as the parameter. |
> | user | String | Yes | User who will be listed as the space creator. Required if not using CSpace as the parameter. |

### Or

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | space type | **[CSpace](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15303915)** | Yes | Predefined structure that defines the new space. |

## Return Type

**Boolean (true/false)**

Returns true if the key and name aren't already used by another space.

## Examples

### Example 1

```javascript
string spaceKey = "TST";
string spaceName = "New Test Space";
string spaceDescription = "New space create by Power Scripts";
string user = "admin";

return admCreateSpace(spaceKey, spaceName, spaceDescription, user);
```

### Example 2

```javascript
CSpace newSpace;
newSpace.key = "TST";
newSpace.name = "New Test Space";
newSpace.description = "New space create by Power Scripts";
newSpace.creator = "admin";
return admCreateSpace(newSpace);
```

## See also

> Macro (contentbylabel)