# listSpaceFolder

One folder's files and folders only (a root when `folderId` is omitted). Team's templates, forms, contracts, tables are never listed here: count them with listContentTemplates, listForms, listContractTemplates, listWorkflowTables before saying what Team or Library holds; an empty Team root is not an empty Team. Folders first, then files, by name; each item has `abilities`, `fileType`, size, owner, creator and `path`. Items you cannot see are not returned.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "listSpaceFolder", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `spaceId`: `ID!` (required)
- `folderId`: `ID`

## Response (data, an example)

```json
{
  "spacesQuery": {
    "folder": {
      "space": {
        "id": "<ID>",
        "kind": "TEAM",
        "name": "…"
      },
      "folder": {
        "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"
      },
      "items": [
        {
          "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" \
  -d '{
    "operationId": "listSpaceFolder",
    "variables": {
      "spaceId": "<spaceId>"
    }
  }'
```
