# moveItemsToFolder

File items into a folder (`folderId`), or to the top level (`folderId: null`). `items` are `{ kind, id }`; kind is FILTER, CONTACT_LIST, PROPERTY_LIST, FORM, TEMPLATE, LIBRARY_FILE or WORKFLOW_GROUP. All or nothing: one id not found refuses the whole call. Refused when the folder's surface does not hold that kind. A saved filter's privacy FOLLOWS the folder: into a personal folder makes it private to you, into a shared one shares it with the team, so say so before moving a filter across. Returns how many moved.

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

## Variables

- `items`: `[FolderItemRef!]!` (required). One item, named by what it is and which row it is. Ids are only unique within a kind (`Tag` and `ContactTag` are different tables) so the kind is not decoration, it is half the identity.
  - `kind`: `FoldableKind!` (required, one of `FILTER`, `PROPERTY_LIST`, `CONTACT_LIST`, `TEMPLATE`, `LIBRARY_FILE`, `WORKFLOW_GROUP`, `FORM`). A thing that can live in a folder. One entry per foldable table. Not every kind can do everything: only FILTER can be private (and therefore live in a personal folder), and TEMPLATE has no display order and so cannot be reordered. The server refuses those rather than accepting them silently.
  - `id`: `ID!` (required)
- `folderId`: `ID`

## Response (data, an example)

```json
{
  "folderMutation": {
    "moveItemsToFolder": 0
  }
}
```

## 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": "moveItemsToFolder",
    "variables": {
      "items": [
        {
          "kind": "FILTER",
          "id": "<id>"
        }
      ]
    }
  }'
```
