> 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/{template_id}

एक flows टेम्पलेट पाएं, साथ ही हर चलाए जा सकने वाले वर्ज़न के इनपुट और आउटपुट भी। जब इस API से कोई प्रकाशित वर्ज़न चलाने योग्य नहीं होता, तो `versions` खाली रहता है। यह आपके द्वारा खोले जा सकने वाले किसी भी टेम्पलेट के लिए काम करता है, जिसमें लिंक से आपके साथ शेयर किए गए या किसी अन्य वर्कस्पेस से Explore में प्रकाशित टेम्पलेट भी शामिल हैं, जिन्हें `GET /v1/flows/templates` सूचीबद्ध नहीं करता।

Reference: https://elevenlabs.io/docs/api-reference/flows/templates/get

## 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

- `template_id` (string, required) — टेम्प्लेट की ID, जैसा ElevenLabs ऐप में या `GET /v1/flows/templates` द्वारा दिखाया गया है।

### Query parameters

- `versions_per_template` (integer, optional, default: 10) — हर टेम्प्लेट के कितने पब्लिश किए गए वर्शन लौटाने हैं, नए वर्शन पहले। `has_more_versions` बताता है कि टेम्प्लेट के और वर्शन हैं या नहीं।

## Response

### 200

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

- `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) — टेम्पलेट का विवरण, अगर उपलब्ध हो।

## Errors

### 422 Unprocessable Entity Error

वैलिडेशन एरर

- `detail` (list of ValidationError, optional)

## Types

### 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) — इस वर्ज़न द्वारा कैनवास क्रम में बनाए गए आउटपुट्स।

### ValidationError

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

### 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` शेप को रखा जाएगा।

### ValidationErrorLocItems

### 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
{
  "id": "tmpl_abc123",
  "name": "Product shot",
  "versions": [
    {
      "version_id": "ver_01hxyz",
      "published_at_unix": 1,
      "is_latest": true,
      "inputs": [
        {
          "id": "prompt",
          "content_schema": {
            "type": "string",
            "description": "string",
            "enum": [
              "string"
            ],
            "title": "string"
          }
        }
      ],
      "outputs": [
        {
          "id": "prompt",
          "content_schema": {
            "type": "string",
            "description": "string",
            "enum": [
              "string"
            ],
            "title": "string"
          }
        }
      ]
    }
  ],
  "has_more_versions": true,
  "description": "string"
}
```

**SDK Code**

```python
import requests

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

response = requests.get(url)

print(response.json())
```

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

	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/template_id")

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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