> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign Admin Roles API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/automation/api-list)</Badge>

To add or remove users or groups from admin roles.

<Note>
  This API requires JWT generated by an application created only from the Admin Console.
</Note>

| Field             | Value                                                                                                                            |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | POST                                                                                                                             |
| **Endpoint**      | `https://{{host}}/api/public/adminroles/assignments/`                                                                            |
| **Content Type**  | `application/json`                                                                                                               |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction/#generating-the-jwt-token). |
| **API Scope**     | App Builder: Not Applicable; Admin Console: Profile Management > Role Management                                                 |

## Path Parameters

| Parameter | Required/Optional | Description                                                                        |
| --------- | ----------------- | ---------------------------------------------------------------------------------- |
| host      | Required          | Environment URL, for example, [https://platform.kore.ai](https://platform.kore.ai) |

## Sample Request

```json theme={null}
curl -X POST 'https://{{host}}/api/public/adminroles/assignments/' \
  -H 'Content-Type: application/json' \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
  -d '[{
        "roleId":"5bre4bb433f78c73f4exxxxx",
        "addUsers":["john.doe@example.com"],
        "removeUsers":[],
        "addGroups": [],
        "removeGroups":[]
    }]'
```

## Body Parameters

| Parameter                       | Required/Optional | Description                                                              |
| ------------------------------- | ----------------- | ------------------------------------------------------------------------ |
| roleId                          | Required          | The admin role ID to assign or remove from users or groups.              |
| addUsers or addOrgUserIds       | Optional          | The list of usernames or org user IDs for whom to assign the admin role. |
| removeUsers or removeOrgUserIds | Optional          | The list of usernames or org user IDs for whom to remove the admin role. |
| addGroups                       | Optional          | The list of group names for whom to assign the admin role.               |
| removeGroups                    | Optional          | The list of usernames for whom to remove the admin role.                 |

## Sample Response

```json theme={null}
[
    {
        "status": "success",
        "roleId": "64b8d1862f377730a77xxxxx"
    }
]
```
