> 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/flows/templates

अपने वर्कस्पेस में प्रकाशित फ़्लो टेम्पलेट की सूची दिखाता है, साथ ही हर चलाए जा सकने वाले वर्ज़न के इनपुट और आउटपुट भी। यहां की id को `POST /v1/flows/templates/{template_id}/runs` पर `template_id` / `version_id` के रूप में इस्तेमाल करें। ऐसे मॉडल पर बने वर्ज़न जो API के ज़रिए आपके लिए उपलब्ध नहीं हैं, शामिल नहीं होते; इसलिए अगर किसी टेम्पलेट का कोई भी प्रकाशित वर्ज़न इस API से चलाने योग्य नहीं है, तो `versions` खाली होता है। लिंक के ज़रिए आपके साथ शेयर किए गए या किसी दूसरे वर्कस्पेस से Explore में प्रकाशित टेम्पलेट सूची में नहीं होते, लेकिन फिर भी उन्हें `template_id` से फ़ेच और चलाया जा सकता है।

Reference: https://elevenlabs.io/docs/api-reference/flows/templates/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

### Query parameters

- `cursor` (string, optional, nullable) — Pagination cursor: पिछले page के response का `next_cursor` मान। पहले page के लिए इसे छोड़ दें।
- `page_size` (integer, optional, default: 10) — हर पेज पर कितने टेम्प्लेट लौटाने हैं। रन सूची की सीमा से कम, क्योंकि हर रो अपने वर्शन के इनपुट और आउटपुट स्कीमा को विस्तृत करती है।
- `versions_per_template` (integer, optional, default: 3) — हर टेम्प्लेट के कितने पब्लिश किए गए वर्शन लौटाने हैं, नए वर्शन पहले। `has_more_versions` बताता है कि टेम्प्लेट के और वर्शन हैं या नहीं।
- `search` (string, optional, nullable) — केवल वे templates लौटाएं जिनके नाम या description में यह text हो।

## Response

### 200

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

- `templates` (list of TemplateSummary, required) — इस पेज के टेम्पलेट, जिनमें सबसे हाल में अपडेट किए गए पहले हैं। किसी पेज पर `page_size` से कम टेम्पलेट या कोई भी टेम्पलेट नहीं हो सकता, क्योंकि जो टेम्पलेट आप नहीं चला सकते, वे पेज पढ़े जाने के बाद फ़िल्टर हो जाते हैं — `has_more` true रहने तक पेजिंग जारी रखें।
- `next_cursor` (string, required, nullable) — अगला page पाने के लिए `cursor` के रूप में पास करें। आगे कोई page न होने पर `null`।
- `has_more` (boolean, required) — क्या इस पेज के बाद और templates मौजूद हैं।

## Errors

### 422 Unprocessable Entity Error

वैलिडेशन एरर

- `detail` (list of ValidationError, optional)

## Types

### TemplateSummary

एक टेम्पलेट जिसे कॉलर चला सकता है, और इसके चलाने योग्य संस्करण।

- `id` (string, required) — `POST /v1/flows/templates/{template_id}/runs` पर `template_id` के रूप में पास करें।
- `name` (string, required) — टेम्पलेट का नाम।
- `versions` (list of TemplateVersion, required) — वे प्रकाशित वर्ज़न जिन्हें यह कॉलर चला सकता है, सबसे नए पहले। जिस वर्ज़न का ग्राफ़ ऐसा मॉडल इस्तेमाल करता है जो API के ज़रिए आपके लिए उपलब्ध नहीं है, उसे छोड़ दिया जाता है; इसी तरह वह वर्ज़न भी, जिसका स्टोर किया हुआ स्नैपशॉट हट चुका है। दोनों स्थितियों में सूची खाली हो सकती है, जबकि टेम्पलेट में ऐसे वर्ज़न हो सकते हैं जिन्हें ElevenLabs ऐप चला सकता है।
- `has_more_versions` (boolean, required) — क्या इस टेम्पलेट के यहाँ लौटाए गए `versions_per_template` से आगे और प्रकाशित वर्ज़न हैं। अधिक देखने के लिए `GET /v1/flows/templates/{template_id}` को बड़े `versions_per_template` के साथ प्राप्त करें।
- `description` (string, optional, nullable) — टेम्पलेट का विवरण, अगर उपलब्ध हो।

### ValidationError

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

### TemplateVersion

टेम्पलेट का प्रकाशित स्नैपशॉट और वे पोर्ट्स जिनके साथ यह चलता है।

- `version_id` (string, required) — किसी run को इस snapshot से pin करने के लिए `POST /v1/flows/templates/{template_id}/runs` पर `version_id` के रूप में पास करें।
- `published_at_unix` (integer, required) — यह वर्शन कब प्रकाशित किया गया था, सेकंड में Unix timestamp के रूप में।
- `is_latest` (boolean, required) — क्या `version_id` छोड़ देने या उसे `latest` पर सेट करने पर रन को यही वर्ज़न मिलता है।
- `inputs` (list of TemplatePort, required) — यह वर्शन जिन इनपुट को स्वीकार करता है, canvas क्रम में। रन में हर इनपुट ज़रूरी है।
- `outputs` (list of TemplatePort, required) — इस वर्ज़न द्वारा कैनवास क्रम में बनाए गए आउटपुट्स।

### ValidationErrorLocItems

### TemplatePort

प्रकाशित template version का एक input या output port।

- `id` (string, required) — पोर्ट id। इनपुट ids, `POST /v1/flows/templates/{template_id}/runs` पर `inputs` मैप की कुंजियां हैं; आउटपुट ids, रन रिस्पॉन्स में `outputs` मैप की कुंजियां हैं।
- `content_schema` (ContentSchema, required) — `ContentSchema` के रूप में, यह पोर्ट क्या स्वीकार करता है या बनाता है। इसका `title` पोर्ट का डिस्प्ले नाम है और इसका `description` टेम्पलेट लेखक का लिखा हुआ हेल्प टेक्स्ट है। इनपुट के लिए, इसका `type` तय करता है कि कौन-सी वैल्यू स्वीकार होगी: `string` एक साधारण स्ट्रिंग या `generation` रेफ़रेंस लेता है, `voice` एक `voice` रेफ़रेंस लेता है, और `image`/`video`/`audio` एक `asset`, `generation` या `inline_base64` रेफ़रेंस लेते हैं। `number`, `integer` और `boolean` उस टाइप की JSON वैल्यू लेते हैं। `array` इनपुट एक JSON array लेता है, जिसमें हर एलिमेंट के लिए एक वैल्यू होती है और हर वैल्यू उसके `items` के लिए मान्य होती है। `object` इनपुट को अभी इस API के ज़रिए बाइंड नहीं किया जा सकता। एक `string` schema में केवल स्वीकार्य वैल्यूज़ का `enum` हो सकता है। आउटपुट के लिए, इसका `type` तय करता है कि रन रिस्पॉन्स में पोर्ट id के तहत किस `Template<Kind>Output` शेप को रखा जाएगा।

### ContentSchema

- `type`: `array` (ArraySchema)
  - `items` (ContentSchema, required)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `audio` (AudioSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `boolean` (BooleanSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `image` (ImageSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `integer` (IntegerSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `number` (NumberSchema)
  - `description` (string, optional, nullable)
  - `enum` (list of double, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `object` (ObjectSchema)
  - `description` (string, optional, nullable)
  - `properties` (map from string to ContentSchema, optional)
  - `required` (list of string, optional)
  - `title` (string, optional, nullable)
- `type`: `string` (StringSchema)
  - `description` (string, optional, nullable)
  - `enum` (list of string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `video` (VideoSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `voice` (VoiceSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)

## Examples

**Response**

```json
{
  "templates": [
    {
      "id": "tmpl_abc123",
      "name": "Product shot",
      "versions": [
        {
          "version_id": "ver_01hxyz",
          "published_at_unix": 1739721600,
          "is_latest": true,
          "inputs": [
            {
              "id": "prompt",
              "content_schema": {
                "type": "string",
                "title": "Prompt"
              }
            },
            {
              "id": "reference",
              "content_schema": {
                "type": "image",
                "description": "A clean product photo on any background.",
                "title": "Product photo"
              }
            }
          ],
          "outputs": [
            {
              "id": "product_still",
              "content_schema": {
                "type": "image",
                "title": "Final image"
              }
            }
          ]
        }
      ],
      "has_more_versions": false,
      "description": "Drop in a product photo, get a studio shot."
    }
  ],
  "next_cursor": "cGFnZXwx",
  "has_more": true
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/flows/templates"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/flows/templates';
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/flows/templates"

	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/flows/templates")

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/flows/templates")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/flows/templates');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/flows/templates");
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/flows/templates")! 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()
```