How to use API key in AJAX call?

Dear @JQ331

Yes, I did a quick check for you (as a reference) and logged into a test forum as a staff member and pulled the staff group, and got the expected results:

JSON object for staff group by staff member
{
  "group": {
    "id": 3,
    "automatic": true,
    "name": "staff",
    "display_name": "staff",
    "user_count": 1,
    "mentionable_level": 0,
    "messageable_level": 0,
    "visibility_level": 1,
    "automatic_membership_email_domains": null,
    "primary_group": false,
    "title": null,
    "grant_trust_level": null,
    "incoming_email": null,
    "has_messages": false,
    "flair_url": null,
    "flair_bg_color": null,
    "flair_color": null,
    "bio_raw": null,
    "bio_cooked": null,
    "bio_excerpt": null,
    "public_admission": false,
    "public_exit": false,
    "allow_membership_requests": false,
    "full_name": null,
    "default_notification_level": 3,
    "membership_request_template": null,
    "is_group_user": true,
    "is_group_owner": true,
    "members_visibility_level": 0,
    "can_see_members": true,
    "publish_read_state": false,
    "is_group_owner_display": false,
    "mentionable": false,
    "messageable": false
  },
  "extras": {
    "visible_group_names": [
      "admins",
      "moderators",
      "staff",
      "trust_level_0",
      "trust_level_1",
      "trust_level_2",
      "trust_level_3",
      "trust_level_4"
    ]
  }
}

… and I also tried doing the same logged out, and got the expected result:

{"errors":["You are not permitted to view the requested resource."],"error_type":"invalid_access"}

So, this means, or so it seems to me, that all is working as it should.

FYI @JQ331, I did not need an API key for this action as a logged in user (from the browser).

    "is_group_owner": true,