# createSpaceFolder

Create a folder at a root (My files or Team; `folderId` omitted) or inside a folder you can edit. A name already used there gets " (2)". Pass `creationKey` (any unique string) to make a retry return the folder it already made.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "createSpaceFolder", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `input`: `CreateSpaceFolderInput!` (required)
  - `spaceId`: `ID!` (required)
  - `folderId`: `ID`
  - `name`: `String!` (required)
  - `creationKey`: `String`. Makes a retried create return the folder it already made.

## Response (data, an example)

```json
{
  "spacesMutation": {
    "createFolder": {
      "id": "<ID>",
      "spaceId": "<ID>",
      "spaceName": "…",
      "parentId": "<ID>",
      "kind": "FOLDER",
      "name": "…",
      "description": "…",
      "fileType": "…",
      "sizeBytes": 0,
      "accessMode": "INHERIT",
      "systemLocked": true,
      "viewerRole": "VIEWER",
      "abilities": {
        "addChildren": true,
        "edit": true,
        "move": true,
        "trash": true,
        "share": true
      },
      "owner": {
        "id": "<ID>",
        "name": "…"
      },
      "createdBy": {
        "kind": "PERSON",
        "label": "…"
      },
      "childCount": 0,
      "shareCount": 0,
      "currentVersion": {
        "id": "<ID>",
        "versionNumber": 0
      },
      "path": [
        {
          "id": "<ID>",
          "name": "…"
        }
      ],
      "updatedAt": "2026-01-01T00:00:00.000Z",
      "trashedAt": "2026-01-01T00:00:00.000Z"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "createSpaceFolder",
    "variables": {
      "input": {
        "spaceId": "<spaceId>",
        "name": "<String>"
      }
    }
  }'
```
