> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# एजेंट ब्रांच की सूची दें

GET https://api.elevenlabs.io/v1/convai/agents/{agent_id}/branches

एजेंट की ब्रांचों की सूची लौटाता है

Reference: https://elevenlabs.io/docs/eleven-agents/api-reference/agents/branches/list

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `agent_id` (string, required) — एजेंट की id। यह एजेंट बनाते समय लौटाई जाती है।

### Query parameters

- `include_archived` (boolean, optional, default: false) — क्या archived branches को शामिल करना चाहिए।
- `limit` (integer, optional, default: 100) — ज़्यादा से ज़्यादा कितने नतीजे लौटाए जाने चाहिए
- `include_commit_status` (boolean, optional, default: false) — क्या यह गणना करनी है कि हर ब्रांच main से कितनी अलग हो गई है (commits_ahead/commits_behind)। यह हर ब्रांच के वर्ज़न DAG को देखता है, इसलिए लंबे इतिहास वाले एजेंट पर धीमा होता है और डिफ़ॉल्ट रूप से बंद रहता है, जिससे ये फ़ील्ड null रहते हैं।

## Response

### 200

सफल रिस्पॉन्स

- `results` (list of AgentBranchSummary, required)
- `meta` (ListResponseMeta, optional)

## Errors

### 422 Branches List Request Unprocessable Entity Error

वैलिडेशन एरर

- `detail` (list of ValidationError, optional)

## Types

### AgentBranchSummary

- `id` (string, required)
- `name` (string, required)
- `agent_id` (string, required)
- `description` (string, required)
- `created_at` (integer, required)
- `last_committed_at` (integer, required)
- `is_archived` (boolean, required)
- `protection_status` (enum, optional, default: writer_perms_required)
  - Allowed values: `writer_perms_required`, `admin_perms_required`
- `auto_rebase` (boolean, optional, default: false)
- `access_info` (ResourceAccessInfo, optional) — ब्रांच के लिए एक्सेस जानकारी
- `current_live_percentage` (double, optional, default: 0) — branch पर live traffic का प्रतिशत
- `parent_branch_id` (string, optional) — पैरेंट ब्रांच की ID
- `draft_exists` (boolean, optional, default: false) — क्या branch के लिए कोई draft मौजूद है।
- `draft_created_at` (integer, optional) — Unix सेकंड, जब इस branch पर कॉलर का ड्राफ़्ट पहली बार बनाया गया था, या यदि उनका कोई ड्राफ़्ट नहीं है तो null। last_committed_at से पहले बनाया गया ड्राफ़्ट ऐसे कॉन्फ़िगरेशन के आधार पर लिखा गया था, जिससे branch आगे बढ़ चुका है, इसलिए हो सकता है कि वह मौजूदा कॉन्फ़िगरेशन न दर्शाए।
- `draft_is_behind_tip` (boolean, optional, default: false) — क्या इस branch पर caller का draft, branch के आखिरी commit से पहले बनाया गया था, यानी इसे ऐसी config के आधार पर लिखा गया था जिससे branch आगे बढ़ चुकी है और शायद यह मौजूदा config को न दिखाए।
- `calls_7d` (integer, optional, default: 0) — पिछले 7 दिनों में कॉल की संख्या
- `commits_ahead` (integer, optional) — साझा पूर्वज के आधार पर, इस branch के उन commits की संख्या जो अभी main पर नहीं हैं। गणना न हो पाने पर null (जैसे कोई साझा पूर्वज न हो या branch इतिहास तुलना बजट से अधिक हो)।
- `commits_behind` (integer, optional) — साझा पूर्वज के आधार पर, main के उन commits की संख्या जो अभी इस branch में शामिल नहीं हुए हैं। गणना न हो पाने पर null (जैसे कोई साझा पूर्वज न हो या branch इतिहास तुलना बजट से अधिक हो)।
- `merged_into_branch_id` (string, optional) — उस ब्रांच की ID जिसमें इस ब्रांच का टिप वर्ज़न मर्ज किया गया था, यदि कोई हो

### ListResponseMeta

- `total` (integer, optional)
- `page` (integer, optional)
- `page_size` (integer, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ResourceAccessInfo

- `is_creator` (boolean, required) — क्या अनुरोध करने वाला यूज़र एजेंट का निर्माता है
- `creator_name` (string, required) — एजेंट के निर्माता का नाम
- `creator_email` (string, required) — एजेंट के निर्माता का ईमेल
- `role` (enum, required) — रिक्वेस्ट करने वाले यूज़र की भूमिका
  - Allowed values: `admin`, `editor`, `commenter`, `viewer`
- `anonymous_access_level_override` (enum, optional) — अनाम यूज़र्स के लिए एक्सेस लेवल। यदि None है, तो रिसोर्स सार्वजनिक रूप से शेयर नहीं किया गया है।
  - Allowed values: `admin`, `editor`, `commenter`, `viewer`
- `access_source` (enum, optional) — रिक्वेस्ट करने वाले यूज़र के पास इस रिसोर्स का एक्सेस क्यों है। 'creator' = कॉलर मालिक है। 'explicit' = कॉलर (या उसके किसी वर्कस्पेस ग्रुप) को वर्कस्पेस-व्यापी everyone ग्रुप के अलावा role_to_group_ids में सूचीबद्ध किया गया है। 'workspace_default' = वर्कस्पेस-व्यापी everyone ग्रुप role_to_group_ids में सूचीबद्ध है (एडमिन समेत हर गैर-अनाम वर्कस्पेस सदस्य इस रिसोर्स को देखता है)। 'workspace_admin' = कॉलर वर्कस्पेस एडमिन है और एडमिन सीट ही एक्सेस का *एकमात्र* रास्ता है; यह उन दस्तावेज़ों के लिए आरक्षित है जिन्हें कोई और नहीं देख सकता। इससे UI बता पाता है कि एडमिन-बायपास व्यूअर को वह दस्तावेज़ क्यों दिख रहा है जो उसके साथ स्पष्ट रूप से शेयर नहीं किया गया था।
  - Allowed values: `creator`, `explicit`, `workspace_admin`, `workspace_default`

### ValidationErrorLocItem

## Examples

**Response**

```json
{
  "results": [
    {
      "id": "id",
      "name": "name",
      "agent_id": "agent_id",
      "description": "description",
      "created_at": 1,
      "last_committed_at": 1,
      "is_archived": true,
      "protection_status": "writer_perms_required",
      "auto_rebase": true,
      "access_info": {
        "is_creator": true,
        "creator_name": "John Doe",
        "creator_email": "john.doe@example.com",
        "role": "admin",
        "access_source": "creator"
      },
      "current_live_percentage": 1.1,
      "parent_branch_id": "parent_branch_id",
      "draft_exists": true,
      "draft_created_at": 1,
      "draft_is_behind_tip": true,
      "calls_7d": 1,
      "commits_ahead": 1,
      "commits_behind": 1,
      "merged_into_branch_id": "merged_into_branch_id"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "page_size": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches"

querystring = {"include_archived":"true","include_commit_status":"true","limit":"1"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches?include_archived=true&include_commit_status=true&limit=1';
const options = {method: 'GET'};

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.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches?include_archived=true&include_commit_status=true&limit=1"

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

	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.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches?include_archived=true&include_commit_status=true&limit=1")

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

request = Net::HTTP::Get.new(url)

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.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches?include_archived=true&include_commit_status=true&limit=1")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches?include_archived=true&include_commit_status=true&limit=1');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches?include_archived=true&include_commit_status=true&limit=1");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/branches?include_archived=true&include_commit_status=true&limit=1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```