You can use the `monday.api` software development kit (SDK) method to query the GraphQL API seamlessly on behalf of the connected user or by using an API token. Scopes will be based on the permissions of the logged-in user and the scopes you have configured in your app.

Our GraphQL API exposes methods to get board data, create items, notify people, and much more. Check out our <a href ="" target="_blank">API documentation</a> for more information.

## Parameters

  • `query`: A GraphQL query, can be either a query (retrieval operation) or a mutation (creation/update/deletion operation). Placeholders may be used, which will be substituted by the variables object passed within the options.

  • `options`:

`apiVersion`The <a href="" target="_blank">API version</a> to send the request toNoIf not included, the request will use the current stable version.
`token`Access token for the APIOnly on serverIf not set, it will use the credentials of the current user (client only).
`variables`An object containing GraphQL query variablesNo

Instead of passing the API token to the api() method on each request, you can set the API token once using:


## Returns

A `Promise` that will be `resolved` to the API response.

If there was an unhandled GraphQL error in the API, a `Promise` will be `rejected` with an Error. In case of handled errors from GraphQL API (response with the 200 status), a `Promise` will be `resolved` with the API response.

You can check the list of GraphQL API errors <a href="" target="_blank">here</a>.

## Examples

### Client-side query that fetches the ID and name of users within the account that the connected user can view

### Server-side query that fetches all the names of users in the account

### Mutation that sends a notification to user `user_id`, which will take the user to `item_id` after clicking

Join our developer community!

We've created a <a href="" target="_blank"> community</a> 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! 😎