This tutorial will help you to:
The creation of new groups using existing group names is not permitted.
To complete this tutorial, you need the following:
The Create group script uses an API key as a Bearer access token. It also uses the Organization ID field as a path parameter.

To create an API key and get the Organization ID:
Learn more about the API keys.
The v2 APIs are directory-aware, so you need a directoryId as a path parameter. Use the API key and Organization ID from the previous step with the Get directories endpoint to get the directoryId: GET /admin/v2/orgs/{orgId}/directories
1 2curl --request GET \ --url 'https://api.atlassian.com/admin/v2/orgs/{orgId}/directories' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
Search the results to find the correct directoryId.
Learn more about the Get directories API.
Use the directoryId, API key and Organization ID from the previous steps to create group: POST /v2/orgs/{orgId}/directories/{directoryId}/groups. Name the group and add a description.
1 2curl --request POST \ --url 'https://api.atlassian.com/admin/v2/orgs/{orgId}/directories/{directoryId}/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: