# Operations (sample payloads)

## Main operations

### Archive board

Archive a board.
**Sample Input**

```json
{
    "args": {
        "board_id": "1234567890"
    },
    "fields": {
        "id": true,
        "name": true,
        "state": true,
        "board_kind": true,
        "description": true,
        "items_count": true,
        "columns": {
            "fields": \{
                "id": true,
                "title": true,
                "type": true
            \}
        },
        "groups": {
            "fields": \{
                "id": true,
                "title": true
            \}
        },
        "owner": {
            "fields": \{
                "id": true,
                "name": true,
                "email": true
            \}
        }
    }
}
```

**Sample Output**

```json
{
    "data": {
        "archive_board": {
            "id": "1234567890",
            "name": "Project X",
            "state": "archived",
            "board_kind": "public",
            "description": "This board tracks all tasks for Project X",
            "items_count": 42,
            "columns": [
                \{
                    "id": "col1",
                    "title": "Status",
                    "type": "status"
                \},
                \{
                    "id": "col2",
                    "title": "Assignee",
                    "type": "person"
                \},
                \{
                    "id": "col3",
                    "title": "Due Date",
                    "type": "date"
                \}
            ],
            "groups": [
                \{
                    "id": "group1",
                    "title": "To Do"
                \},
                \{
                    "id": "group2",
                    "title": "In Progress"
                \},
                \{
                    "id": "group3",
                    "title": "Done"
                \}
            ],
            "owner": \{
                "id": "user123",
                "name": "John Doe",
                "email": "john.doe@example.com"
            \}
        }
    }
}
```

### Archive item

Archive an item.
**Sample Input**

```json
{
    "board_id": "12345678",
    "args": {
        "item_id": "987654321"
    },
    "fields": {
        "id": true,
        "name": true,
        "state": true,
        "subscribers": {
            "fields": \{
                "id": true,
                "name": true,
                "email": true
            \}
        }
    }
}
```

**Sample Output**

```json
{
    "data": {
        "archive_item": {
            "id": "987654321",
            "name": "Project X",
            "state": "archived",
            "subscribers": [
                \{
                    "id": "user_123",
                    "name": "John Doe",
                    "email": "john.doe@example.com"
                \},
                \{
                    "id": "user_456",
                    "name": "Jane Smith",
                    "email": "jane.smith@example.com"
                \}
            ]
        },
        "account_id": 1234567890
    }
}
```

### Create board

Create a new board.
**Sample Input**

```json
{
    "args": \{
        "board_name": "Project Management",
        "board_kind": "$ENUM$:public",
        "description": "A board to manage our team's projects and tasks",
        "workspace_id": "1234567890"
    \},
    "fields": {
        "id": true,
        "name": true,
        "board_kind": true,
        "description": true,
        "state": true,
        "workspace_id": true,
        "columns": {
            "fields": \{
                "id": true,
                "title": true,
                "type": true
            \}
        },
        "groups": {
            "fields": \{
                "id": true,
                "title": true
            \}
        },
        "items_count": true
    }
}
```

**Sample Output**

```json
{
    "data": {
        "create_board": {
            "id": "1234567",
            "name": "Project Management",
            "board_kind": "public",
            "description": "A board to manage our team's projects and tasks",
            "state": "active",
            "workspace_id": "1234567890",
            "columns": [
                \{
                    "id": "text",
                    "title": "Name",
                    "type": "text"
                \},
                \{
                    "id": "status",
                    "title": "Status",
                    "type": "status"
                \},
                \{
                    "id": "date",
                    "title": "Due Date",
                    "type": "date"
                \}
            ],
            "groups": [
                \{
                    "id": "topics",
                    "title": "To Do"
                \},
                \{
                    "id": "group_1234",
                    "title": "In Progress"
                \},
                \{
                    "id": "group_5678",
                    "title": "Done"
                \}
            ],
            "items_count": 0
        }
    }
}
```

### Create column

Create a new column in board.
**Sample Input**

```json
{
    "args": {
        "board_id": "1234567890",
        "title": "Project Status",
        "description": "Current status of the project",
        "column_type": "$ENUM$:status",
        "defaults": "{\"labels\": \{\"0\": \"Not Started\", \"1\": \"In Progress\", \"2\": \"Completed\"\}}",
        "id": "project_status_column",
        "after_column_id": "9876543210"
    },
    "fields": \{
        "archived": true,
        "description": true,
        "id": true,
        "settings_str": true,
        "title": true,
        "type": true,
        "width": true
    \}
}
```

**Sample Output**

```json
{
    "data": {
        "create_column": {
            "settings_str": "{\"labels\": \{\"0\": \"Not Started\", \"1\": \"In Progress\", \"2\": \"Completed\"\}}",
            "title": "Project Status",
            "type": "status",
            "width": "130"
        }
    },
    "account_id": 12345
}
```

### Create group

Create a new group in a specific board.
**Sample Input**

```json
{
    "args": \{
        "board_id": 12345,
        "group_name": "New Project Tasks"
    \},
    "fields": \{
        "archived": true,
        "color": true,
        "deleted": true,
        "id": true,
        "position": true,
        "title": true
    \}
}
```

**Sample Output**

```json
{
    "data": {
        "create_group": \{
            "archived": false,
            "color": "#00FF00",
            "deleted": false,
            "id": "group_123456",
            "position": "1",
            "title": "New Project Tasks"
        \}
    },
    "account_id": 987654
}
```

### Create item

Create a new item.
**Sample Input**

```json
{
    "args": {
        "item_name": "New Task",
        "board_id": "12345678",
        "group_id": "topics",
        "column_values": [
            {
                "column_id": "status",
                "value": {
                    "status": "Working on it"
                }
            },
            {
                "column_id": "date",
                "value": {
                    "date": "2023-05-15"
                }
            },
            {
                "column_id": "person",
                "value": {
                    "people": [
                        \{
                            "id": 1234567,
                            "kind": "person"
                        \}
                    ]
                }
            }
        ]
    },
    "create_labels_if_missing": true
}
```

**Sample Output**

```json
{
    "data": {
        "create_item": {
            "id": "987654321",
            "name": "New Task",
            "created_at": "2023-05-10T14:30:00Z",
            "updated_at": "2023-05-10T14:30:00Z",
            "creator_id": "1234567",
            "state": "active",
            "board": \{
                "id": "12345678",
                "name": "Project Board",
                "board_kind": "public"
            \},
            "group": \{
                "id": "topics",
                "title": "Topics",
                "color": "#037f4c"
            \},
            "column_values": [
                {
                    "id": "status",
                    "text": "Working on it",
                    "value": "\{\"index\":1,\"post_id\":null,\"changed_at\":\"2023-05-10T14:30:00Z\"\}"
                },
                {
                    "id": "date",
                    "text": "2023-05-15",
                    "value": "\{\"date\":\"2023-05-15\",\"changed_at\":\"2023-05-10T14:30:00Z\"\}"
                },
                {
                    "id": "person",
                    "text": "John Doe",
                    "value": "{\"personsAndTeams\":[\{\"id\":1234567,\"kind\":\"person\"\}],\"changed_at\":\"2023-05-10T14:30:00Z\"}"
                }
            ],
            "creator": \{
                "id": "1234567",
                "name": "John Doe",
                "email": "john.doe@example.com"
            \}
        }
    },
    "account_id": 1234567890
}
```

### Create notification

Create a new notification.
**Sample Input**

```json
{
    "args": \{
        "text": "New project update: Design phase completed",
        "user_id": "1234567",
        "target_id": "9876543",
        "target_type": "$ENUM$:Project"
    \},
    "fields": \{
        "id": true,
        "text": true
    \}
}
```

**Sample Output**

```json
{
    "data": {
        "create_notification": \{
            "id": "not_12345",
            "text": "New project update: Design phase completed"
        \}
    },
    "account_id": 987654
}
```

### Create tag

Create a new tag or get it if it already exists.
**Sample Input**

```json
{
    "args": \{
        "tag_name": "High Priority",
        "board_id": "1234567890"
    \},
    "fields": \{
        "color": true,
        "id": true,
        "name": true
    \}
}
```

**Sample Output**

### Create update

Create a new update.
**Sample Input**

```json
{
    "args": \{
        "body": "New task update: Completed the first draft of the project proposal.",
        "item_id": "1234567890"
    \},
    "fields": {
        "body": true,
        "created_at": true,
        "creator": {
            "fields": \{
                "name": true,
                "email": true
            \}
        },
        "id": true,
        "item_id": true,
        "text_body": true
    }
}
```

**Sample Output**

### Delete item

Delete an item.
**Sample Input**
**Sample Output**

### Duplicate group

Duplicate a group.
**Sample Input**

```json
{
    "args": \{
        "board_id": 1234567,
        "group_id": "group_abc123",
        "group_title": "Duplicated Marketing Tasks",
        "add_to_top": true
    \},
    "fields": \{
        "archived": true,
        "color": true,
        "deleted": true,
        "id": true,
        "position": true,
        "title": true
    \}
}
```

**Sample Output**

### Get complexity

Get the complexity data of your queries.
**Sample Input**

```json
{
    "fields": \{
        "after": true,
        "before": true,
        "query": true,
        "reset_in_x_seconds": true
    \}
}
```

**Sample Output**

```json
{
    "data": {
        "complexity": \{
            "after": 4980,
            "before": 5000,
            "query": 20
        \}
    },
    "account_id": 12345678
}
```

### Get current user

Get the connected user's information.
**Sample Input**

```json
{
    "fields": {
        "account": {
            "fields": \{
                "country_code": true,
                "first_day_of_the_week": true,
                "id": true,
                "logo": true,
                "name": true,
                "show_timeline_weekends": true,
                "slug": true
            \}
        },
        "birthday": true,
        "country_code": true,
        "created_at": true,
        "email": true,
        "enabled": true,
        "id": true,
        "is_guest": true,
        "join_date": true,
        "location": true,
        "mobile_phone": true,
        "name": true,
        "phone": true,
        "photo_original": true,
        "photo_thumb": true,
        "title": true,
        "url": true,
        "utc_hours_diff": true
    }
}
```

**Sample Output**

```json
{
    "data": {
        "me": {
            "enabled": true,
            "is_pending": false,
            "join_date": "2023-01-15T09:30:00Z",
            "is_guest": false,
            "photo_thumb": "https://example.com/user_thumb.jpg",
            "created_at": "2023-01-15T09:30:00Z",
            "name": "John Doe",
            "account": \{
                "first_day_of_the_week": "monday",
                "id": "acc_123456",
                "logo": "https://example.com/company_logo.png",
                "name": "Acme Corporation",
                "show_timeline_weekends": true,
                "slug": "acme-corp"
            \},
            "phone": "+1 (555) 123-4567",
            "url": "https://monday.com/users/john.doe",
            "utc_hours_diff": -5,
            "mobile_phone": "+1 (555) 987-6543",
            "location": "New York, NY",
            "country_code": "US",
            "title": "Senior Project Manager",
            "id": "usr_789012",
            "email": "john.doe@example.com",
            "birthday": "1985-06-15",
            "photo_original": "https://example.com/user_original.jpg"
        }
    },
    "account_id": 987654
}
```

### Items page by column values

Search items by multiple columns and values.
**Sample Input**
**Sample Output**

### List boards

Get a collection of boards.
**Sample Input**

```json
{
    "args": \{
        "limit": 10,
        "page": 1,
        "board_kind": "$ENUM$:public",
        "state": "$ENUM$:active",
        "order_by": "$ENUM$:created_at"
    \},
    "fields": {
        "id": true,
        "name": true,
        "description": true,
        "board_kind": true,
        "state": true,
        "items_count": true,
        "columns": {
            "fields": \{
                "id": true,
                "title": true,
                "type": true
            \}
        },
        "groups": {
            "fields": \{
                "id": true,
                "title": true
            \}
        },
        "owner": {
            "fields": \{
                "id": true,
                "name": true,
                "email": true
            \}
        }
    }
}
```

**Sample Output**

### List items

Get a collection of items.
**Sample Input**
**Sample Output**

```json
{
    "data": {
        "items": [
            \{
                "created_at": "2023-05-15T10:30:00Z",
                "creator_id": "user_123456",
                "id": "item_987654",
                "name": "Project A",
                "state": "active"
            \},
            \{
                "created_at": "2023-05-14T15:45:00Z",
                "creator_id": "user_234567",
                "id": "item_876543",
                "name": "Task B",
                "state": "active"
            \},
            \{
                "created_at": "2023-05-13T09:15:00Z",
                "creator_id": "user_345678",
                "id": "item_765432",
                "name": "Meeting C",
                "state": "active"
            \}
        ]
    },
    "account_id": 9876543210
}
```

### List tags

Get a collection of tags.
**Sample Input**

```json
{
    "args": \{
        "ids": [
            "tag1",
            "tag2",
            "tag3"
        ]
    \},
    "fields": \{
        "color": true,
        "id": true,
        "name": true
    \}
}
```

**Sample Output**

```json
{
    "data": {
        "tags": [
            \{
                "name": "Urgent",
                "id": "tag1",
                "color": "#FF0000"
            \},
            \{
                "name": "In Progress",
                "id": "tag2",
                "color": "#FFA500"
            \},
            \{
                "name": "Completed",
                "id": "tag3",
                "color": "#00FF00"
            \}
        ]
    },
    "account_id": 12345
}
```

### List teams

Get a collection of teams.
**Sample Input**
**Sample Output**

```json
{
    "data": {
        "teams": [
            {
                "id": "team_123",
                "name": "Marketing Team",
                "picture_url": "https://example.com/team_123_picture.jpg",
                "users": \{
                    "ids": [
                        "user_1",
                        "user_2",
                        "user_3",
                        "user_4",
                        "user_5"
                    ],
                    "limit": 5,
                    "page": 1
                \}
            },
            {
                "id": "team_456",
                "name": "Development Team",
                "picture_url": "https://example.com/team_456_picture.jpg",
                "users": \{
                    "ids": [
                        "user_6",
                        "user_7",
                        "user_8",
                        "user_9",
                        "user_10"
                    ],
                    "limit": 5,
                    "page": 1
                \}
            }
        ],
        "account_id": 12345
    }
}
```

### List updates

Get a collection of updates.
**Sample Input**

```json
{
    "args": \{
        "limit": 2,
        "page": 1,
        "ids": [
            "12345",
            "67890"
        ]
    \},
    "fields": {
        "body": true,
        "created_at": true,
        "creator": {
            "fields": \{
                "name": true,
                "email": true,
                "photo_thumb": true
            \}
        },
        "id": true,
        "item_id": true,
        "text_body": true,
        "updated_at": true
    }
}
```

**Sample Output**

### List users

Get a collection of users.
**Sample Input**

```json
{
    "args": \{
        "limit": 2,
        "page": 1,
        "kind": "$ENUM$:all",
        "newest_first": true
    \},
    "fields": {
        "id": true,
        "name": true,
        "email": true,
        "title": true,
        "phone": true,
        "location": true,
        "is_admin": true,
        "created_at": true,
        "account": {
            "fields": \{
                "id": true,
                "name": true
            \}
        }
    }
}
```

**Sample Output**

```json
{
    "data": {
        "users": [
            {
                "id": "12345678",
                "name": "John Doe",
                "email": "john.doe@example.com",
                "title": "Senior Developer",
                "phone": "+1 (555) 123-4567",
                "location": "New York, USA",
                "is_admin": true,
                "created_at": "2023-05-15T10:30:00Z",
                "account": \{
                    "id": "987654",
                    "name": "Acme Corporation"
                \}
            },
            {
                "id": "87654321",
                "name": "Jane Smith",
                "email": "jane.smith@example.com",
                "title": "Project Manager",
                "phone": "+1 (555) 987-6543",
                "location": "San Francisco, USA",
                "is_admin": false,
                "created_at": "2023-05-14T14:45:00Z",
                "account": \{
                    "id": "987654",
                    "name": "Acme Corporation"
                \}
            }
        ]
    },
    "account_id": 987654
}
```

### Move item to group

Move an item to a different group.
**Sample Input**

```json
{
    "board_id": "1234567890",
    "args": \{
        "item_id": "9876543210",
        "group_id": "5678901234"
    \},
    "fields": {
        "id": true,
        "name": true,
        "group": {
            "fields": \{
                "id": true,
                "title": true
            \}
        },
        "board": {
            "fields": \{
                "id": true,
                "name": true
            \}
        }
    }
}
```

**Sample Output**

```json
{
    "data": {
        "move_item_to_group": {
            "id": "9876543210",
            "name": "Project X",
            "group": \{
                "id": "5678901234",
                "title": "In Progress"
            \},
            "board": \{
                "id": "1234567890",
                "name": "Development Tasks"
            \}
        }
    },
    "account_id": 12345
}
```

### Update column value

Change an item's column value.
**Sample Input**

```json
{
    "args": {
        "item_id": "1234567890",
        "column_id": "status",
        "board_id": "9876543210",
        "value": {
            "status": {
                "label": "Done"
            }
        },
        "create_labels_if_missing": false
    }
}
```

**Sample Output**

```json
{
    "data": {
        "change_column_value": {
            "id": "1234567890",
            "name": "Task 1",
            "state": "active",
            "board": \{
                "id": "9876543210",
                "name": "Project Board"
            \},
            "group": \{
                "id": "group_123",
                "title": "In Progress"
            \},
            "created_at": "2023-05-15T10:30:00Z",
            "updated_at": "2023-05-15T14:45:00Z",
            "creator_id": "user_456",
            "creator": \{
                "id": "user_456",
                "name": "John Doe",
                "email": "john.doe@example.com"
            \}
        }
    },
    "account_id": 12345
}
```

### Update multiple column values

Changes the column values of a specific item.
**Sample Input**
**Sample Output**

## DDL operations

### List boards (DDL)

**Sample Input**

```json
{}
```

**Sample Output**

```json
[
    \{
        "id": "1234567890",
        "name": "Project Management"
    \},
    \{
        "id": "2345678901",
        "name": "Marketing Campaigns"
    \},
    \{
        "id": "3456789012",
        "name": "Sales Pipeline"
    \},
    \{
        "id": "4567890123",
        "name": "HR Onboarding"
    \},
    \{
        "id": "5678901234",
        "name": "Product Roadmap"
    \}
]
```

### List columns (DDL)

**Sample Input**
**Sample Output**

```json
[
    \{
        "id": "text",
        "title": "Text",
        "type": "text"
    \},
    \{
        "id": "person",
        "title": "Person",
        "type": "person"
    \},
    \{
        "id": "status",
        "title": "Status",
        "type": "status"
    \},
    \{
        "id": "date",
        "title": "Date",
        "type": "date"
    \},
    \{
        "id": "numeric",
        "title": "Number",
        "type": "numeric"
    \},
    \{
        "id": "timeline",
        "title": "Timeline",
        "type": "timeline"
    \},
    \{
        "id": "file",
        "title": "File",
        "type": "file"
    \},
    \{
        "id": "checkbox",
        "title": "Checkbox",
        "type": "checkbox"
    \},
    \{
        "id": "dropdown",
        "title": "Dropdown",
        "type": "dropdown"
    \},
    \{
        "id": "email",
        "title": "Email",
        "type": "email"
    \}
]
```

### List groups (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**

```json
{}
```

**Sample Output**

### List items (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**
**Sample Output**

```json
{
    "items": [
        \{
            "id": "1234567890",
            "name": "Project Alpha",
            "board_id": "987654321"
        \},
        \{
            "id": "2345678901",
            "name": "Task Beta",
            "board_id": "987654321"
        \},
        \{
            "id": "3456789012",
            "name": "Issue Gamma",
            "board_id": "876543210"
        \}
    ]
}
```

### List tags (DDL)

**Sample Input**
**Sample Output**

```json
{
    "data": {
        "tags": [
            \{
                "id": "1234567",
                "name": "Urgent",
                "color": "#FF0000"
            \},
            \{
                "id": "2345678",
                "name": "In Progress",
                "color": "#FFA500"
            \},
            \{
                "id": "3456789",
                "name": "Completed",
                "color": "#008000"
            \},
            \{
                "id": "4567890",
                "name": "Low Priority",
                "color": "#0000FF"
            \}
        ]
    }
}
```

### List teams (DDL)

**Sample Input**
**Sample Output**

### List users (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**

```json
{}
```

**Sample Output**

```json
[
    \{
        "id": 1234567,
        "name": "John Doe",
        "email": "john.doe@example.com",
        "url": "https://monday.com/users/1234567",
        "photo_url": "https://example.com/profile_photos/john_doe.jpg",
        "title": "Project Manager",
        "position": "Team Lead",
        "time_zone_identifier": "America/New_York",
        "phone": "+1 (555) 123-4567",
        "location": "New York, NY",
        "status": "active",
        "birthday": "1985-05-15",
        "is_guest": false,
        "join_date": "2020-01-15T09:00:00Z"
    \},
    \{
        "id": 7654321,
        "name": "Jane Smith",
        "email": "jane.smith@example.com",
        "url": "https://monday.com/users/7654321",
        "photo_url": "https://example.com/profile_photos/jane_smith.jpg",
        "title": "Software Developer",
        "position": "Senior Engineer",
        "time_zone_identifier": "Europe/London",
        "phone": "+44 20 1234 5678",
        "location": "London, UK",
        "status": "active",
        "birthday": "1990-09-22",
        "is_guest": false,
        "join_date": "2019-03-01T10:30:00Z"
    \}
]
```
