Monday Com
Integrate with Monday.com GraphQL API for managing boards, items, columns,
You are an expert in Monday.com API integration using its GraphQL API v2. You build work management automations that handle boards, items, column values, subitems, and real-time webhook notifications with proper complexity budgeting. ## Key Points - **Not stringifying column_values JSON**: The `column_values` parameter expects a JSON string, not an object. Forgetting `JSON.stringify` causes silent failures. - **Querying all column_values without filtering by ID**: Fetching every column on every item explodes complexity cost. Always pass `ids` to `column_values`. - **Ignoring complexity in responses**: Every response includes complexity data. Monitor it to avoid hitting the per-minute budget and getting throttled. - **Using item IDs as numbers**: Monday.com IDs are strings in GraphQL. Passing numeric types causes type errors in mutations. - Automating project board management and item creation from external triggers - Syncing Monday.com boards with other project management or CRM systems - Building dashboards that aggregate status and progress across multiple boards - Processing webhook events to trigger downstream workflows on item changes - Bulk-updating column values across items based on external data sources ## Quick Example ```bash npm install graphql-request graphql ``` ``` MONDAY_API_TOKEN=your_api_token_here ```
skilldb get crm-services-skills/Monday ComFull skill: 171 linesMonday.com API Integration
You are an expert in Monday.com API integration using its GraphQL API v2. You build work management automations that handle boards, items, column values, subitems, and real-time webhook notifications with proper complexity budgeting.
Core Philosophy
Complexity Budget Management
Every Monday.com API call has a complexity cost. Your account gets a per-minute complexity budget (typically 10,000,000). Always request only the fields you need, use pagination, and monitor the complexity field in responses to avoid hitting limits.
Column Values Are JSON
Monday.com stores column values as JSON strings with type-specific schemas. A status column value is {"index": 1}, a date is {"date": "2024-01-15"}. Always parse and construct column values according to their column type.
Mutations Over REST
Monday.com is GraphQL-only. There is no REST API. All writes use mutations. Structure mutations to batch multiple changes in a single request using change_multiple_column_values instead of individual column mutations.
Setup
npm install graphql-request graphql
MONDAY_API_TOKEN=your_api_token_here
Initialize the client:
import { GraphQLClient } from "graphql-request";
const monday = new GraphQLClient("https://api.monday.com/v2", {
headers: { Authorization: process.env.MONDAY_API_TOKEN! },
});
Key Patterns
Do: Request only needed fields and use pagination
const query = `query ($boardId: ID!, $cursor: String) {
boards(ids: [$boardId]) {
items_page(limit: 50, cursor: $cursor) {
cursor
items {
id
name
column_values(ids: ["status", "date4", "person"]) {
id
text
value
}
}
}
}
}`;
Not: Fetching all columns and all items without pagination
// WRONG - massive complexity cost, may timeout
const bad = `query { boards(ids: [12345]) { items { column_values { id text value } } } }`;
Do: Use change_multiple_column_values for batch updates
const mutation = `mutation ($boardId: ID!, $itemId: ID!, $values: JSON!) {
change_multiple_column_values(
board_id: $boardId
item_id: $itemId
column_values: $values
) { id }
}`;
await monday.request(mutation, {
boardId: "123456",
itemId: "789",
values: JSON.stringify({ status: { index: 2 }, date4: { date: "2024-06-01" } }),
});
Common Patterns
Create Item with Column Values
async function createItem(
boardId: string,
groupId: string,
itemName: string,
columnValues: Record<string, unknown>
) {
const mutation = `mutation ($boardId: ID!, $groupId: String!, $name: String!, $values: JSON!) {
create_item(board_id: $boardId, group_id: $groupId, item_name: $name, column_values: $values) {
id
name
}
}`;
const result = await monday.request<{ create_item: { id: string; name: string } }>(mutation, {
boardId,
groupId,
name: itemName,
values: JSON.stringify(columnValues),
});
return result.create_item;
}
Paginate All Board Items
async function getAllItems(boardId: string, columnIds: string[]) {
const allItems: any[] = [];
let cursor: string | null = null;
do {
const query = `query ($boardId: ID!, $cursor: String, $colIds: [String!]) {
boards(ids: [$boardId]) {
items_page(limit: 100, cursor: $cursor) {
cursor
items { id name column_values(ids: $colIds) { id text value } }
}
}
}`;
const result = await monday.request<any>(query, { boardId, cursor, colIds: columnIds });
const page = result.boards[0].items_page;
allItems.push(...page.items);
cursor = page.cursor;
} while (cursor);
return allItems;
}
Register a Webhook
async function createWebhook(boardId: string, url: string, event: string) {
const mutation = `mutation ($boardId: ID!, $url: String!, $event: WebhookEventType!) {
create_webhook(board_id: $boardId, url: $url, event: $event) { id }
}`;
return monday.request(mutation, { boardId, url, event });
}
Add an Update (Comment) to an Item
async function addUpdate(itemId: string, body: string) {
const mutation = `mutation ($itemId: ID!, $body: String!) {
create_update(item_id: $itemId, body: $body) { id }
}`;
return monday.request(mutation, { itemId, body });
}
Anti-Patterns
- Not stringifying column_values JSON: The
column_valuesparameter expects a JSON string, not an object. ForgettingJSON.stringifycauses silent failures. - Querying all column_values without filtering by ID: Fetching every column on every item explodes complexity cost. Always pass
idstocolumn_values. - Ignoring complexity in responses: Every response includes complexity data. Monitor it to avoid hitting the per-minute budget and getting throttled.
- Using item IDs as numbers: Monday.com IDs are strings in GraphQL. Passing numeric types causes type errors in mutations.
When to Use
- Automating project board management and item creation from external triggers
- Syncing Monday.com boards with other project management or CRM systems
- Building dashboards that aggregate status and progress across multiple boards
- Processing webhook events to trigger downstream workflows on item changes
- Bulk-updating column values across items based on external data sources
Install this skill directly: skilldb add crm-services-skills
Related Skills
Airtable
Integrate with Airtable API for managing bases, tables, records, views,
Attio
Integrate with Attio CRM API for managing objects, records, lists, notes,
Close Crm
Integrate with Close CRM API for managing leads, contacts, activities,
Folk
Integrate with Folk CRM API for managing contacts, pipelines, groups,
Hubspot
Integrate with HubSpot CRM API for managing contacts, deals, companies,
Pipedrive
Integrate with Pipedrive CRM API for managing deals, persons, organizations,