Skip to main content
ElevenLabs Documentation Docs
current

Search documentation

Type to search this documentation.

On this pageOverview

List Templates

GET https://api.elevenlabs.io/v1/flows/templates

List the published flows templates in your workspace, together with each runnable version's inputs and outputs. Use the ids here as template_id / version_id on POST /v1/flows/templates/{template_id}/runs. Versions built on models that are not available to you through the API are left out, so versions is empty when none of a template's published versions is runnable through this API. Templates shared with you by link, or published to Explore from another workspace, are not listed but can still be fetched and run by 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

  • cursor (string, optional, nullable) — Pagination cursor: the next_cursor value of the previous page's response. Omit it for the first page.
  • page_size (integer, optional, default: 10) — How many templates to return per page. Lower than the run list's ceiling because each row expands its versions' input and output schemas.
  • versions_per_template (integer, optional, default: 3) — How many of each template's published versions to return, newest first. has_more_versions tells you when a template has more.
  • search (string, optional, nullable) — Only return templates whose name or description contains this text.

200

Successful Response

  • templates (list of TemplateSummary, required) — The templates on this page, most recently updated first. A page can hold fewer than page_size templates, or none at all, because templates you cannot run are filtered out after the page is read — keep paging while has_more is true.
  • next_cursor (string, required, nullable) — Pass as cursor to fetch the next page. null when there is no further page.
  • has_more (boolean, required) — Whether more templates exist beyond this page.

Validation Error

  • detail (list of ValidationError, optional)

Types

TemplateSummary

A template the caller can run, and its runnable versions.

  • id (string, required) — Pass as template_id on POST /v1/flows/templates/{template_id}/runs.
  • name (string, required) — The template's name.
  • versions (list of TemplateVersion, required) — The published versions this caller can run, newest first. A version whose graph uses a model that is not available to you through the API is left out, as is one whose stored snapshot is gone; either way the list can be empty while the template still has versions the ElevenLabs app can run.
  • has_more_versions (boolean, required) — Whether this template has further published versions beyond the versions_per_template returned here. Fetch GET /v1/flows/templates/{template_id} with a larger versions_per_template to see more of them.
  • description (string, optional, nullable) — The template's description, if it has one.

ValidationError

  • loc (list of ValidationErrorLocItems, required)
  • msg (string, required)
  • type (string, required)

TemplateVersion

A published snapshot of a template, and the ports it runs with.

  • version_id (string, required) — Pass as version_id on POST /v1/flows/templates/{template_id}/runs to pin a run to this snapshot.
  • published_at_unix (integer, required) — When this version was published, as a Unix timestamp in seconds.
  • is_latest (boolean, required) — Whether this is the version a run gets when version_id is omitted or set to latest.
  • inputs (list of TemplatePort, required) — The inputs this version accepts, in canvas order. Every input is required on a run.
  • outputs (list of TemplatePort, required) — The outputs this version produces, in canvas order.

ValidationErrorLocItems

TemplatePort

One input or output port of a published template version.

  • id (string, required) — The port id. Input ids are the keys of the inputs map on POST /v1/flows/templates/{template_id}/runs; output ids are the keys of the outputs map on the run response.
  • content_schema (ContentSchema, required) — What this port accepts or produces, as a ContentSchema. Its title is the port's display name and its description is the help text the template author wrote. For an input, its type decides what value is accepted: string takes a bare string or a generation reference, voice takes a voice reference, and image/video/audio take an asset, generation or inline_base64 reference. number, integer and boolean take a JSON value of that type. An array input takes a JSON array with one value per element, each admissible for its items. object inputs cannot be bound through this API yet. A string schema may carry an enum of the only values accepted. For an output, its type decides which Template<Kind>Output shape the run response holds under the port id.

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

TypeScript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

async function main() {
    const client = new ElevenLabsClient();
    await client.flows.templates.list({});
}
main();
Python
from elevenlabs import ElevenLabs

client = ElevenLabs()

client.flows.templates.list()
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();
C#
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()
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu