# PUT /v4/organizations/{organizationId}/user-groups/{userGroupId}/roles

_Merkl API_

### Path parameters

- `organizationId` (string) _(required)_
- `userGroupId` (string) _(required)_

## Request body

**`application/json`**
```json
{
  "type": "object",
  "properties": {
    "roleIds": {
      "maxItems": 128,
      "uniqueItems": true,
      "type": "array",
      "items": {
        "pattern": "^[a-z][a-z0-9_]*$",
        "maxLength": 128,
        "type": "string"
      }
    },
    "assignments": {
      "maxItems": 128,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "roleId": {
            "pattern": "^[a-z][a-z0-9_]*$",
            "maxLength": 128,
            "type": "string"
          },
          "campaignGroupId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "roleId"
        ]
      }
    }
  }
}
```
**`application/x-www-form-urlencoded`**
```json
{
  "type": "object",
  "properties": {
    "roleIds": {
      "maxItems": 128,
      "uniqueItems": true,
      "type": "array",
      "items": {
        "pattern": "^[a-z][a-z0-9_]*$",
        "maxLength": 128,
        "type": "string"
      }
    },
    "assignments": {
      "maxItems": 128,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "roleId": {
            "pattern": "^[a-z][a-z0-9_]*$",
            "maxLength": 128,
            "type": "string"
          },
          "campaignGroupId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "roleId"
        ]
      }
    }
  }
}
```
**`multipart/form-data`**
```json
{
  "type": "object",
  "properties": {
    "roleIds": {
      "maxItems": 128,
      "uniqueItems": true,
      "type": "array",
      "items": {
        "pattern": "^[a-z][a-z0-9_]*$",
        "maxLength": 128,
        "type": "string"
      }
    },
    "assignments": {
      "maxItems": 128,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "roleId": {
            "pattern": "^[a-z][a-z0-9_]*$",
            "maxLength": 128,
            "type": "string"
          },
          "campaignGroupId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "roleId"
        ]
      }
    }
  }
}
```

## Example request

```bash
curl -X PUT "https://api.merkl.xyz//v4/organizations/{organizationId}/user-groups/{userGroupId}/roles" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```