# group_list_roles

Returns a list of roles within a specific group that the bot has access to.

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("group_list_roles", [
  "groupuuid", "0b65a122-8f77-64fe-5b2a-225d4c490d9c"
]);
```

# Variables

The following table shows input values (you send them with the API call) and returned output values.

## Input basic parameters

| Variable | Required | Description |
|----------|----------|-------------|
| action   | yes      | = group_list_roles |
| apikey   | yes      | Your personal [developer's API key](/doc/developers-api-key-tw8bQj4LSJ) |
| botname  | yes      | Your bot’s SL login |
| secret   | yes      | [Bot access code](https://www.mysmartbots.com/docs/Bot_access_code) of your bot |
| dataType | optional | Set to `"json"` to get JSON reply instead of URL-encoded string |
| custom   | optional | Custom data (string) to be passed back to caller script. Returned in the HTTP response |

## Input

| Variable | Required | Description |
|----------|----------|-------------|
| groupuuid | yes      | The UUID of the group to list roles for |

## Output

*(To be received in* `http_response` *LSL event — see* [*docs for details*](/doc/doing-http-api-calls-c6FSEMF7bP)*)*

| Variable | Description |
|----------|-------------|
| result   | `OK`— command completed successfully<br>`FAIL` — command failed |
| resulttext | Detailed reason for the failure |
| custom   | The value from the input `"custom"` parameter |
| roles    | List of role UUIDs and names, separated by newline (`\n`) |

# Example

**Raw response (URL-encoded):**

```
roles=044ad014-7298-eb70-0945-85d6df01f154%3BOwners%0A10d7e54f-7c52-8f0e-7ad8-7e0059664cd0%3BSmartBots%0Aaebb8d51-c3b6-74cb-cc66-9c30584b5542%3BAlive%20Bots%0Aaef5b7a6-f0c4-b847-5953-1d490f0b3485%3BSupport%20Bot%0Aeaa86b3b-1408-fb4f-3118-7dadabf65fec%3BPersonal%20bot%0A00000000-0000-0000-0000-000000000000%3BEveryone
```

**After URL-decoding:**

```
044ad014-7298-eb70-0945-85d6df01f154;Owners
10d7e54f-7c52-8f0e-7ad8-7e0059664cd0;SmartBots
aebb8d51-c3b6-74cb-cc66-9c30584b5542;Alive Bots
aef5b7a6-f0c4-b847-5953-1d490f0b3485;Support Bot
eaa86b3b-1408-fb4f-3118-7dadabf65fec;Personal bot
00000000-0000-0000-0000-000000000000;Everyone
```

Each line contains:

```
<Role UUID> ; <Role Name>
```

# Notes

* Only **Standard bots** support this command.
* Use this command to retrieve the **roles and their UUIDs** within a group.
* Useful for commands like [`activate_role`](#) or group role management automation.