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

# createSpacesCollection

> Create a Spaces Collection (or reuse an existing one with the same name) and optionally move existing Spaces into it.

**Required scope:** `host:write:network_spaces`



**mutation** `createSpacesCollection(input: CreateSpacesCollectionInput!): CreateSpacesCollectionPayload`

## Arguments

**`input`**: `CreateSpacesCollectionInput!` (required)

Parameters for CreateSpacesCollection

## Returns

`CreateSpacesCollectionPayload`

**`clientMutationId`**: `String`

A unique identifier for the client performing the mutation.

---

**`errors`**: `[String!]!`

---

**`nearMatches`**: `[SpacesCollection!]!`

Collections whose name resembles the requested one without matching it exactly
(e.g. a dropped emoji), present when this call created spacesCollection next
to one or more of these rather than erroring. Empty when no collection
resembled the requested name, and always empty when spaceTitles names a Space
to move, because that call rejects a resembling name instead of creating beside it.

---

**`newlyCreated`**: `Boolean`

True when this call created the collection rather than reusing an existing one. Null when no collection was resolved.

---

**`spacesCollection`**: `SpacesCollection`

## Examples

```graphql Mutation
mutation CreateSpacesCollection($input: CreateSpacesCollectionInput!) {
  createSpacesCollection(input: $input) {
    clientMutationId
    errors
    nearMatches {
      avatarUrls
      createdAt
      description
      explorable
      galleryGroups {
        canDelete
        galleryPage
        galleryType
        id
        isEnabled
        label
      }
      id
    }
    newlyCreated
    spacesCollection {
      avatarUrls
      createdAt
      description
      explorable
      galleryGroups {
        canDelete
        galleryPage
        galleryType
        id
        isEnabled
        label
      }
      id
    }
  }
}
```

```json Variables
{
  "input": {
    "name": "string"
  }
}
```

```json Response
{
  "data": {
    "createSpacesCollection": {
      "clientMutationId": "string",
      "errors": [
        "string"
      ],
      "nearMatches": [
        {
          "avatarUrls": [
            "string"
          ],
          "createdAt": "value",
          "description": "string",
          "explorable": true,
          "galleryGroups": [
            {
              "canDelete": true,
              "galleryPage": "DISCOVERY",
              "galleryType": "BUNDLES",
              "id": "id",
              "isEnabled": true,
              "label": "string"
            }
          ],
          "id": "id"
        }
      ],
      "newlyCreated": true,
      "spacesCollection": {
        "avatarUrls": [
          "string"
        ],
        "createdAt": "value",
        "description": "string",
        "explorable": true,
        "galleryGroups": [
          {
            "canDelete": true,
            "galleryPage": "DISCOVERY",
            "galleryType": "BUNDLES",
            "id": "id",
            "isEnabled": true,
            "label": "string"
          }
        ],
        "id": "id"
      }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.