Skip to content

Creation of groups with contexts as non-admin user

Administrators are able to create groups and contexts through the usual API, but there are use cases where even non-admin users may want to create a group with linked home context.

This feature needs to be explicitly activated in the configuration:

entrystore.nonadmin.group-context-creation=on|off (default: off)

The request below creates a group and a context. The requesting user is given administrative rights on both the context and the group. The newly created group get write access on the context's resource.

POST {base}/_principals/groups?name=name-group-and-context[&contextId=projectx]

The parameter name determines the name of the newly created group and context.

The optional parameter contextId allows to manually set the ID of the newly created context.

The return values are:

  • 201: Group and context successfully created. Contains the group's URI in the HTTP location header.
  • 403: The requesting user must be logged in.
  • 409: A group or context with the provided name or contextId exists already.
  • 500: Internal server error.