Query complexity defines the cost of each operation you make. This cost helps determine an account's API usage based on our rate limiting. Complexity API rate limits are based on the complexity of an app's queries in a given period. There are a few limits to keep in mind:

  • Single queries are limited to 5,000,000 complexity points
  • All queries made through API tokens must not exceed 10,000,000 points per minute, per account (1M for trial and free accounts)
  • For apps only, reads and writes are each limited to 5,000,000 complexity points per minute
  • The create_board, duplicate_board, and duplicate_group mutations have additional limits

As a developer working with monday.com, it is important to familiarize yourself with the complexity API so you know the costs of each query you make. This document will walk you through the available queries to read the complexity object via the API.

Queries

Querying complexity will return the complexity cost of your queries or mutations. This method does not accept any arguments and returns a JSON object.

You can only query complexity directly at the root, so it can't be nested within another query.

query {
    complexity {
        before
        query
        after
      	reset_in_x_seconds
    }
  boards (ids: 1234567890) {
    items {
      id
      name
    }
  }
}

mutation {
  complexity {
    query
    before
    after
  }
  create_item(board_id:1234567890, item_name:"test item") {
    id
  }
}
let query = "query { complexity { before query after reset_in_x_seconds } boards (ids: 1234567890) { id	name } } }";
let mutation = "mutation { complexity { query before after } create_item(board_id: 1234567890, item_name: \"test\") { id }}";

fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY_HERE'
   },
   body: JSON.stringify({
     query : query
   })
  })
   .then(res => res.json())
   .then(res => console.log(JSON.stringify(res, null, 2)));


fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY_HERE'
   },
   body: JSON.stringify({
     query : mutation
   })
  })
   .then(res => res.json())
   .then(res => console.log(JSON.stringify(res, null, 2)));

Fields

You can use the following field(s) to specify what information your complexity query will return.

FieldDescription
after Int!The remaining complexity after the query's execution.
before Int!The remaining complexity before the query's execution.
query Int!This specific query's complexity.
reset_in_x_seconds Int!The length of time (in seconds) before the complexity budget resets.

📘

Join our developer community!

We've created a community specifically for our devs where you can search through previous topics to find solutions, ask new questions, hear about new features and updates, and learn tips and tricks from other devs. Come join in on the fun! 😎