Flows
Templates

List 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.

get/v1/flows/templates

Query parameters

cursorstring nullable

Pagination cursor: the next_cursor value of the previous page's response. Omit it for the first page.

Pagination cursor: the next_cursor value of the previous page's response. Omit it for the first page.

page_sizeinteger

How many templates to return per page. Lower than the run list's ceiling because each row expands its versions' input and output schemas.

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_templateinteger

How many of each template's published versions to return, newest first. has_more_versions tells you when a template has more.

How many of each template's published versions to return, newest first. has_more_versions tells you when a template has more.

searchstring nullable

Only return templates whose name or description contains this text.

Only return templates whose name or description contains this text.

Headers

xi-api-keystring nullable

Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

Response

Successful Response

next_cursorstring nullable required

Pass as cursor to fetch the next page. null when there is no further page.

has_moreboolean required

Whether more templates exist beyond this page.

Example response

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

Changes

Changed in 1 of the 49 revisions of this API.1