
= Groups

Like users, groups have a simplified interface.

== GETs (reading data)

[caption=]
.Groups API GET functions
[options="autowidth"]
|===
| Resource  | Description

| /groups
| Get a list of groups.

| /groups/\{groupname}
| Get a specific group, given a group name.

| /groups/\{groupname}/users
| Get the users for a group, given a group name.

| /groups/\{groupname}/categories
| Get the categories associated with a group, given a group name.
|===

== POST (adding data)

[caption=]
.Groups API POST function
[options="autowidth"]
|===
| Resource  | Description

| /groups
| Add a new group.
|===

== PUTs (modifying data)

[caption=]
.Groups API PUT functions
[options="autowidth"]
|===
| Resource  | Description

| /groups/\{groupname}
| Update the metadata of a group (for example, change the `comments` field).

| /groups/\{groupname}/users/\{username}
| Add a user to the group, given a group name and username.

| /groups/\{groupname}/categories/\{categoryname}
| Associate a category with the group, given a group name and category name.
|===

== DELETEs (removing data)

[caption=]
.Groups API DELETE functions
[options="autowidth"]
|===
| Resource  | Description

| /groups/\{groupname}
| Delete a group.

| /groups/\{groupname}/users/\{username}
| Remove a user from the group.

| /groups/\{groupname}/categories/\{categoryname}
| Disassociate a category from a group, given a group name and category name.
|===
