# avatar_groups

Returns a list of a resident’s Second Life groups.

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("avatar_groups", [
  "avatar", "cd93067e-7c4e-41c0-ba91-be01f4bafe35"
]);
```

```snippet http-api-variables-OmJyUigTgO
```


:::info
**Note:** This API command applies only to **Standard bots**.

:::

```snippet http-api-input-basic-parameters-5FcVlaJbq0 action="avatar_groups"
```

```snippet http-api-input-q5yvAagqsZ
avatar     | yes      | The UUID of the avatar whose groups to fetch
skipnames  | optional | Skip groups whose names **contain** this substring (case-insensitive)
matchnames | optional | Return only groups whose names **contain** this substring (case-insensitive)
matchuuid  | optional | Return only the group with this specific UUID
```

```snippet http-api-output-JAwUcmg7i7
total  | The total number of resident’s groups (not affected by filters)
groups | The list of groups (filtered if `skip*` or `match*` parameters used). Contains UUIDs and group names separated by newline (`\n`)
```

### Example Output Format

```
UUID1 Group Name 1
UUID2 Group Name 2
...
```


---

# Usage Comments

### Working with large lists

The **LSL** `**llHTTPRequest()**` function limits response size to **2048 bytes (1024 Unicode characters)**.  
If the resident has many groups, use filters to reduce output size:

* `skipnames` — ignore groups containing this substring
* `matchnames` — include only groups containing this substring
* `matchuuid` — return a specific group by UUID

### Limits

This command is rate-limited due to Second Life asset server load:  
**Maximum 5 requests per 30 seconds.**


---

# Examples

### Example 1 — Get all groups

```
https://www.mysmartbots.com/api/bot.html?action=avatar_groups&botname=BarKeeeper%20Resident&avatar=cd93067e-7c4e-41c0-ba91-be01f4bafe35
```

**Response:**

```
0b4a7c17-4e2b-bc96-34c1-4cb6e67a9fd2 SLBiz2Life - Advertisers Support
0b65a122-8f77-64fe-5b2a-225d4c490d9c SmartBots: group invitation bots
0e6ce87d-d86e-9225-9e0f-cea9fb24313e Capital Exchange Stock Market
0ec6f039-1a39-339c-3c68-e31ed2dc703f Earn2Life.com Discount Shops
24dcd8e6-3406-1518-b9ba-8653c1be09eb Earn2Life.com partnership
41ff4c6b-e3c0-a2b9-f53b-797e78532374 Earn2Life - earn L$500-1000 a day
4fbbee90-b278-e1b9-0ec9-251da2390c6c Earn2Life.com Investors (EARN)
5c63bbff-7064-0849-e8a7-25dff3d1765f Earn2Life.com Training Group
9e325390-c5e0-de09-3921-1501d34f9b38 Earn2Life Pay4Observe Support
c63983a8-f9b6-cb4b-6cdd-87da2f679a8e SmartBots Investors (BOTS)
cee972ee-e1af-3da5-6846-36b89a041fa4 SmartBots Franchise
```

### Example 2 — Filter by name (“earn2life”)

```
https://www.mysmartbots.com/api/bot.html?action=avatar_groups&botname=BarKeeeper%20Resident&avatar=cd93067e-7c4e-41c0-ba91-be01f4bafe35&matchnames=earn2life
```

**Response:**

```
0ec6f039-1a39-339c-3c68-e31ed2dc703f Earn2Life.com Discount Shops
24dcd8e6-3406-1518-b9ba-8653c1be09eb Earn2Life.com partnership
41ff4c6b-e3c0-a2b9-f53b-797e78532374 Earn2Life - earn L$500-1000 a day
4fbbee90-b278-e1b9-0ec9-251da2390c6c Earn2Life.com Investors (EARN)
5c63bbff-7064-0849-e8a7-25dff3d1765f Earn2Life.com Training Group
9e325390-c5e0-de09-3921-1501d34f9b38 Earn2Life Pay4Observe Support
```