# createFolder

Create a folder on one surface (`scope`: CONTACT for the Contacts sidebar's lists and filters, PROPERTY, PIPELINE_ITEM (never the retired DEAL), FORM, …; workflow folders are createWorkflowFolder, Library ones createSpaceFolder), at the top level or nested inside another folder of the same surface (`parentId`, from listFolders). `personal: true` puts it in your own tree, else it is shared with the team; a child takes its parent's side. A name a sibling already has is refused, and so is nesting past the surface's depth or a personal folder where it has none (the error says which). Returns the new folder's id; file things into it with moveItemsToFolder.

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

## Variables

- `scope`: `FolderScope!` (required, one of `PROPERTY`, `CONTACT`, `PIPELINE_ITEM`, `DEAL`, `OWNER`, `ENTITY`, `PERSON`, `USER`, `ORGANIZATION`, `LIBRARY`, `WORKFLOW`, `FORM`, `INBOX_VIEW`, `CALENDAR_VIEW`, `TASKS_VIEW`). The surface a folder appears on. The first nine are 1:1 with `FilterType`: a folder there holds that surface's saved filters, and on PROPERTY / CONTACT its lists as well. Scope is the SURFACE, not the item kind. INBOX_VIEW: The Inbox's saved views. CALENDAR_VIEW: The Calendar's saved views. TASKS_VIEW: The Tasks page's saved views.
- `name`: `String!` (required)
- `parentId`: `ID`
- `personal`: `Boolean`

## Response (data, an example)

```json
{
  "folderMutation": {
    "createFolder": {
      "id": "<ID>",
      "name": "…",
      "scope": "PROPERTY",
      "parentId": "<ID>",
      "ownerUserId": "<ID>"
    }
  }
}
```

## 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": "createFolder",
    "variables": {
      "scope": "PROPERTY",
      "name": "<String>"
    }
  }'
```
