> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getdial.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getdial.ai/_mcp/server.

# List groups

GET https://api.getdial.ai/api/v1/groups

The group conversations your lines belong to.

A group is a conversation that isn't a phone number, so Dial gives it an
ID of its own; you address it with `groupId` on Send a message and
filter for it on List messages. Groups exist on WhatsApp lines today.

**`name` may be `null`, which is not an error.** Participants rename
groups, so Dial stores no copy of the subject — it is read live from the
line that holds the conversation. A line that can't answer in time
yields `name: null` for its groups rather than failing the request, so
one unreachable line never hides another line's groups.

Your line must already be a member: Dial can send into a group your
number was added to, but cannot create one, join one, or accept an
invite link.

There is no join event — a group your line was just added to shows up as
a new entry here.


Reference: https://docs.getdial.ai/api-reference/rest-api/messages/list-groups

## Authentication

- `Authorization` header (bearer token, required) — Your Dial API key, sent as `Authorization: Bearer sk_live_...`

## Response

### 200

Groups, oldest first.

- `groups` (list of object, optional)
  - `id` (string, required) — The group's Dial ID. Never the channel's own group identifier, which is opaque, unroutable, and does not cross this boundary.
  - `name` (string, required, nullable) — The group's current name, or null when no line could report it. Not stored: participants rename groups, so a saved subject would be a cache with nothing to invalidate it. It is read live from the line holding the conversation, and a line that cannot answer in time yields null here rather than failing the whole listing.
  - `createdAt` (datetime, required) — When Dial first learned of this group — your line being added to it, or the first message that named it. Not when the group itself was created.

## Examples

**Response**

```json
{
  "groups": [
    {
      "id": "grp_123",
      "name": "Planning bday party",
      "createdAt": "2024-01-15T09:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.getdial.ai/api/v1/groups"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.getdial.ai/api/v1/groups';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getdial.ai/api/v1/groups"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.getdial.ai/api/v1/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getdial.ai/api/v1/groups")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getdial.ai/api/v1/groups', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.getdial.ai/api/v1/groups");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getdial.ai/api/v1/groups")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```