Last updated Aug 7, 2023

Create group

This tutorial will help you to:

  • Create a group in the organization's directory.
  • Create a collection of users that you can use to easily manage permissions, content access, notification schemes, and roles.

The creation of new groups using existing group names is not permitted.

Before you begin

To complete this tutorial, you need the following:

Steps to create group

Illustration showing the steps create group

1. Get API Key and Organization ID

The Create group script uses an API key as a Bearer access token. It also uses the Organization ID field as a path parameter.

Screen to copy the API Key and Organization ID

To create an API key and get the Organization ID:

  1. Go to Atlassian Administration. Select your organization if you have more than one.
  2. Select Settings > API keys.
  3. Select Create API key on the top right.
  4. Enter a name that you’ll remember to identify the API key.
  5. By default, the key expires one week from today. If you’d like to change the expiration date, pick a new date value under Expires on. You’re unable to select a date longer than a year from the date of creation.
  6. Select Create to save the API key.
  7. Copy the values of Organization ID and API key fields by selecting the copy button. Make sure you store these values in a safe place, as we won't show them to you again.
  8. Select Done. The key will appear in your list of API keys.

Learn more about the API keys.

2. Create group

Use the API key and Organization ID from the previous steps to create group: POST /v1/orgs/{orgId}/directory/groups. Name the group and add a description.

curl --request POST \
  --url '{orgId}/directory/groups' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "description": "<string>"

Make your first request and get started with the Create group API and get more information on error codes.

Rate this page: