Learn how to read, create, update, and delete favorites using the platform API
On the monday.com platform, you can create favorites for your preferred and most frequently used boards, dashboards, and docs. The favorite objects then appear in a separate Favorites section of the left-side menu for quick, easy access.
 
Queries
You can use the favorites query to retrieve a user's favorites data via the API.
- Returns metadata for a list of favorites
- Can only be queried at the root; cannot be nested within another query
query {
  favorites {
    accountId
    createdAt
    folderId
    hierarchyListData {
      id
      type
    }
    id
    object {
      id
      type
    }
    position
    updatedAt
  }
}{
  "data": {
    "favorites": [
      {
        "accountId": 9876543210,
        "createdAt": null,
        "folderId": null,
        "hierarchyListData": {
          "id": "123456",
          "type": "PersonalList"
        },
        "id": "98765",
        "object": {
          "id": "11223344",
          "type": "Overview"
        },
        "position": 65500,
        "updatedAt": null
      },
      {
        "accountId": 9876543210,
        "createdAt": null,
        "folderId": null,
        "hierarchyListData": {
          "id": "123456",
          "type": "PersonalList"
        },
        "id": "12345",
        "object": {
          "id": "44332211",
          "type": "Board"
        },
        "position": 65400,
        "updatedAt": null
      }
    ]
  },
  "extensions": {
    "request_id": "YOUR_REQUEST_ID"
  }
}Fields
You can use the following fields to specify what information your favorites query will return. Some fields support their own subfields.
| Field | Description | Supported Subfields | 
|---|---|---|
| accountId  | The ID of the account the favorite object belongs to. | |
| createdAt  | The timestamp when the favorite object was created. | |
| folderId  | The unique identifier of the folder the favorite object is in (if applicable). | |
| hierarchyListData  | The type and unique identifier of the list. | id  | 
| id  | The favorite object's unique identifier. | |
| object  | The type and unique identifier of the favorite object. | id  | 
| position  | The favorite object's position within its list or folder. | |
| updatedAt  | The timestamp when the favorite object was last updated. | 
Mutations
The API allows you to create, update, and delete favorites using the following mutations. These operations let you programmatically control a favorite's full lifecycle.
Create favorite
The create_favoritemutation creates a new favorite via the API. It returns the CreateFavoriteResultType type which allows you to specify which fields to return in the mutation response.
mutation {
  create_favorite(
    input: {
      name: "Tasks"
      object: {
        id: 1234567890
        type: Board
      }
      newPosition: {
        prevObject: {
          id: 9876543210
          type: Overview
        }
      }
    }
  ) {
    favorites {
      position
      id
    }
  }
}{
  "data": {
    "create_favorite": {
      "favorites": {
        "position": 12345,
        "id": "98765"
      }
    }
  },
  "extensions": {
    "request_id": "YOUR_REQUEST_ID"
  }
}Arguments
You can use the following argument to define the new favorite's characteristics.
| Argument | Description | Supported Fields | 
|---|---|---|
| input  | The new favorite's name, position, identifier, and type. | object  | 
Update favorite position
The update_favorite_positionmutation updates a favorite's position via the API. It returns the UpdateFavoriteResultType type which allows you to specify which fields to return in the mutation response.
mutation {
  update_favorite_position(
    input: {
      object: {
        id: 1234567890
        type: Board
      }
      newPosition: {
        nextObject: {
          id: 9876543210
          type: Overview
        }
      }
    }
  ) {
    favorites {
      position
      id
      hierarchyListData {
        id
        type
      }
    }
  }
}{
  "data": {
    "update_favorite_position": {
      "favorites": {
        "position": 54321,
        "id": "98765",
        "hierarchyListData": {
          "id": "123456",
          "type": "PersonalList"
        }
      }
    }
  },
  "extensions": {
    "request_id": "YOUR_REQUEST_ID"
  }
}Arguments
You can use the following argument to specify the favorite's updated position.
| Argument | Description | Supported Fields | 
|---|---|---|
| The updated favorite's position and type. | object  | 
Delete favorite
The delete_favoritemutation deletes a favorite via the API. It returns the DeleteFavoriteInputResultType type which allows you to specify which fields to return in the mutation response.
mutation {
  delete_favorite(
    input: {
      object: {
        id: 1234567890
        type: Board
      }
    }
  ) {
    success
  }
}{
  "data": {
    "delete_favorite": {
      "success": true
    }
  },
  "extensions": {
    "request_id": "YOUR_REQUEST_ID"
  }
}Arguments
You can use the following argument to specify which favorite to delete.
| Argument | Description | Supported Fields | 
|---|---|---|
| input DeleteFavoriteInput! | The deleted favorite's input. | object HierarchyObjectIDInputType! | 
