---
title: "SetGroupMembers"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: EZGH Cloud organizations and IAM › groups

`PUT /v1/organizations/{orgId}/groups/{groupId}/members`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie
- `oauth`, http, header `Authorization`

## Path parameters

- `SetGroupMembers.path.orgId` (string, required)
- `SetGroupMembers.path.groupId` (string, required)

## Header parameters

- `SetGroupMembers.header.if-match` (string, optional)

## Request body

_Required._

- `SetGroupMembers.members` (array<object>, required)
  - `SetGroupMembers.members.type` (string, required)
    - one of `"user"`, `"bot"`
  - `SetGroupMembers.members.id` (string, required)

## Example request

```json
{
  "members": [
    {
      "type": "user",
      "id": "string"
    }
  ]
}
```

## Code samples

### cURL

```curl
curl --request PUT \
  --url https://orgs.ezghcloud.com/v1/organizations/string/groups/string/members \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "members": [
    {
      "type": "user",
      "id": "string"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://orgs.ezghcloud.com/v1/organizations/string/groups/string/members';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({members: [{type: 'user', id: 'string'}]})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://orgs.ezghcloud.com/v1/organizations/string/groups/string/members"

payload = { "members": [
        {
            "type": "user",
            "id": "string"
        }
    ] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Success

#### Example

```json
{
  "members": [
    {
      "type": "user",
      "id": "string"
    }
  ]
}
```

- `SetGroupMembers.response.200.members` (array<object>, required)
  - `SetGroupMembers.response.200.members.type` (string, required)
    - one of `"user"`, `"bot"`
  - `SetGroupMembers.response.200.members.id` (string, required)

### 400

InvalidRequest

#### Example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `SetGroupMembers.response.400.error` (object, required)
  - `SetGroupMembers.response.400.error.code` (string, required)
    - one of `"invalid_request"`
  - `SetGroupMembers.response.400.error.message` (string, required)
  - `SetGroupMembers.response.400.error.issues` (array<object>, optional)
    - `SetGroupMembers.response.400.error.issues.path` (string, required)
    - `SetGroupMembers.response.400.error.issues.message` (string, required)

### 401

Unauthenticated

#### Example

```json
{
  "error": {
    "code": "unauthenticated",
    "message": "string"
  }
}
```

- `SetGroupMembers.response.401.error` (object, required)
  - `SetGroupMembers.response.401.error.code` (string, required)
    - one of `"unauthenticated"`
  - `SetGroupMembers.response.401.error.message` (string, required)

### 403

AccessDenied | ForbiddenOrigin

#### Example

```json
{
  "error": {
    "code": "access_denied",
    "message": "string"
  }
}
```

Any of:

- [AccessDeniedEncoded](/orgs-api/schemas/AccessDeniedEncoded/)
- [ForbiddenOriginEncoded](/orgs-api/schemas/ForbiddenOriginEncoded/)

### 404

NotFound

#### Example

```json
{
  "error": {
    "code": "not_found",
    "message": "string"
  }
}
```

- `SetGroupMembers.response.404.error` (object, required)
  - `SetGroupMembers.response.404.error.code` (string, required)
    - one of `"not_found"`
  - `SetGroupMembers.response.404.error.message` (string, required)

### 409

ManagedByScim

#### Example

```json
{
  "error": {
    "code": "managed_by_scim",
    "message": "string"
  }
}
```

- `SetGroupMembers.response.409.error` (object, required)
  - `SetGroupMembers.response.409.error.code` (string, required)
    - one of `"managed_by_scim"`
  - `SetGroupMembers.response.409.error.message` (string, required)

### 412

PreconditionFailed

#### Example

```json
{
  "error": {
    "code": "precondition_failed",
    "message": "string"
  }
}
```

- `SetGroupMembers.response.412.error` (object, required)
  - `SetGroupMembers.response.412.error.code` (string, required)
    - one of `"precondition_failed"`
  - `SetGroupMembers.response.412.error.message` (string, required)

### 429

TooManyRequests

#### Example

```json
{
  "error": {
    "code": "too_many_requests",
    "message": "string"
  }
}
```

- `SetGroupMembers.response.429.error` (object, required)
  - `SetGroupMembers.response.429.error.code` (string, required)
    - one of `"too_many_requests"`
  - `SetGroupMembers.response.429.error.message` (string, required)

### 500

InternalError

#### Example

```json
{
  "error": {
    "code": "internal_error",
    "message": "string"
  }
}
```

- `SetGroupMembers.response.500.error` (object, required)
  - `SetGroupMembers.response.500.error.code` (string, required)
    - one of `"internal_error"`
  - `SetGroupMembers.response.500.error.message` (string, required)

### 503

Unavailable

#### Example

```json
{
  "error": {
    "code": "unavailable",
    "message": "string"
  }
}
```

- `SetGroupMembers.response.503.error` (object, required)
  - `SetGroupMembers.response.503.error.code` (string, required)
    - one of `"unavailable"`
  - `SetGroupMembers.response.503.error.message` (string, required)


Source: https://docs.ezghcloud.com/orgs-api/groups/SetGroupMembers/index.md
