Create a Group

You can use this API request to create a new group.

/services/v2/group.json

You can use the following parameters in your create a group request:

Body: any field of the body parameter can be used.
Other options: wrap

🚧

Permissions & Notes:

  • You must have the Edit users and groups permission under Site Administration Roles in the Advanced Editor.

  • The location response header will contain the URL for the newly created group.

  • You can specify the data describing the group you are posting, both in the body of the request, or as a request parameter, with the same names as the fields in the body.

    • When you send data in the body of the request, the format should match the URL extension, or the value of the site's HTTP request header content-type.
    • If you specify data values for the same field, both on the request body and as a request or query parameters, the value of the parameters takes precedence over the value in the body.
  • We added this request in version 1.6.3.

Sample Request

A POST create a group request to create a group ("Marketing") with a description ("Marketing Dept.") to https://apidocs.cloud.answerhub.com using a human-readable username and password (answerhub/test123) would look like this:

curl 
-u "answerhub:test123" 
-H "Accept: application/json" 
-H "Content-type: application/json" 
-X POST 
-d '{"name":"Marketing","description":"Marketing Dept."}' "https://apidocs.cloud.answerhub.com/services/v2/group.json" -v

In the example above, there will be a new group called "Marketing" with a description of "Marketing Dept" in the admin console.

Expected Response

Successful Response:

  • HTTP Status 201 - Created
Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!