POST /groups

Create a new group.

This request is idempotent if the group name being created is the same for the same company.

If a group with the same name already exists for the company, a Conflict - 409 status code will be returned, indicating that the group name is already in use.

curl -XPOST \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer your_api_token_here" \
  https://api.invisiblecollector.com/groups  \
  --data '{
    "name": "New Group Name"
  }'
require "net/https"
require "uri"
require "json"

uri = URI.parse("https://api.invisiblecollector.com/groups")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer your_api_token_here'
request.body = { name: "New Group Name" }.to_json

response = http.request(request)
import com.ic.invisiblecollector.IcApiFacade;
import com.ic.invisiblecollector.model.Group;

IcApiFacade apiFacade = new IcApiFacade("your_api_token_here");
Group newGroup = new Group();
newGroup.setName("New Group Name");
Group createdGroup = apiFacade.createGroup(newGroup);
using InvisibleCollectorLib;
using InvisibleCollectorLib.Model;

var ic = new InvisibleCollector("your_api_token_here");
var newGroup = new Group() {
  Name = "New Group Name"
};
Group createdGroup = await ic.CreateGroupAsync(newGroup);
iC, err := ic.NewInvisibleCollector("your_api_token_here", ic.InvisibleCollectorUri)

group := ic.MakeGroup("New Group Name")

var channel = make(chan ic.GroupPair)
go iC.CreateGroup(channel, group)
p := <-channel

fmt.Println(p.Group)

This request can receive the following JSON data:

{
  "name": "New Group Name"
}

The response will be a JSON object representing the created group:

{
  "id": "group_id",
  "name": "New Group Name"
}

Endpoint

POST https://api.invisiblecollector.com/groups

Request body

Attribute Type Mandatory Default Description
name string yes N/A The name of the group to be created.

Response body

Attribute Type Description
id string The unique identifier of the created group.
name string The name of the created group.

Errors

This endpoint may return the following errors

HTTP Code Description
401 Unauthorized - Invalid credentials were supplied.
409 Conflict - A group with the same name already exists for the company.
422 Unprocessable Entity - The request body is syntactically correct but not a valid group JSON object or fails validation checks.