Skip to content
Skip to Content
Coder Docs

Create group for organization

POST
/api/v2/organizations/{organization}/groups

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

organization*string

Organization ID

Request Body

Create group request

application/json
  1. body
avatar_url?string
display_name?string
name*string
quota_allowance?integer

Response Body

Created

application/json
  1. response
avatar_url?string
Formaturi
display_name?string
id?string
Formatuuid
members?array<>
name?string
organization_display_name?string
organization_id?string
Formatuuid
organization_name?string
quota_allowance?integer
source?codersdk.GroupSource
Value in"user""oidc"
total_member_count?integer

How many members are in this group. Shows the total count, even if the user is not authorized to read group member details. May be greater than len(Group.Members).

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/organizations/{organization}/groups" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "name": "string"}'
Example Response201
{  "avatar_url": "http://example.com",  "display_name": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "members": [    {      "avatar_url": "http://example.com",      "created_at": "2019-08-24T14:15:22Z",      "email": "[email protected]",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "is_service_account": true,      "last_seen_at": "2019-08-24T14:15:22Z",      "login_type": "",      "name": "string",      "status": "active",      "theme_preference": "string",      "updated_at": "2019-08-24T14:15:22Z",      "username": "string"    }  ],  "name": "string",  "organization_display_name": "string",  "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",  "organization_name": "string",  "quota_allowance": 0,  "source": "user",  "total_member_count": 0}