gitbeaker/docs/groups.md
2017-11-25 20:39:11 -05:00

3.7 KiB

Groups API

Groups

List all groups

Get a list of visible Groups for authenticated user. When accessed without authentication, only public Groups are returned.

let groups = GitlabAPI.groups.all();

Parameters: List all Groups

Extra Parameters

Argument Description Type Required Default
max_pages Limits the amount of pages returned Number No All pages

List all groups subgroups

Get a list of visible Groups for authenticated user. When accessed without authentication, only public Groups are returned.

let groups = GitlabAPI.groups.allSubgroups(groupId, { //params });

Parameters: List all Groups

Extra Parameters

Argument Description Type Required Default
max_pages Limits the amount of pages returned Number No All pages

Get a single group

Get a specific group. This endpoint can be accessed without authentication if the group is publicly accessible.

// From a group ID
let groupA = GitlabAPI.groups.show(21);

// From a Groups url
let groupB = GitlabAPI.groups.show('diaspora/diaspora');

Parameters: Get a single group

Create a group

Creates a new group owned by the authenticated user.

let groupA = GitlabAPI.groups.create({
  // params
});

Parameters: Create a group

Edit a group

Creates a new group owned by the specified user. Available only for admins.

let groupA = GitlabAPI.groups.edit(groupId, {
  // params
});

Parameters: Edit a group

Remove a group

Removes a group including all associated resources (issues, merge requests etc.)

GitlabAPI.groups.remove(groupId);

Parameters: Remove a group

Search for a group

Searches for a group and returns a group including all associated resources (issues, merge requests etc.)

GitlabAPI.groups.search(query);

Parameters: Search for a group