# client.flow_templates

> The flow_templates methods of the morevoice Python SDK: Starter flows to create a flow from.

Starter flows to create a flow from. These methods are on `client.flow_templates`, where `client` is a `MoreVoice` client (see [the Python SDK](https://docs.morevoice.ai/sdk/python/#connect)). On `AsyncMoreVoice` the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.

## `list()`

**List flow templates.** The starter flows you can create a flow from (`template_id` on POST /v1/flows), with names and descriptions in `language`.

```python
# client.flow_templates
def list(self, *, limit: int | Unset = 20, starting_after: str | Unset = UNSET, ending_before: str | Unset = UNSET, kind: _m.FlowTemplatesListKind | Unset = UNSET, language: _m.FlowTemplatesListLanguage | Unset = UNSET, more_voice_version: str | Unset = UNSET) -> AsyncPage[_m.FlowTemplate]
```

`client.flow_templates.list()` · `await async_client.flow_templates.list()` · `GET /flow_templates` · [API reference](https://docs.morevoice.ai/api/operations/flow_templates_list/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | `integer` | no | How many objects to return, 1–100 (default 20). |
| `starting_after` | `string` | no | A cursor (`next_cursor`) or object ID: return the objects after it (older). |
| `ending_before` | `string` | no | A cursor or object ID: return the objects before it (newer). |
| `kind` | `"voice" \| "agent_script" \| "ivr"` | no | Only templates of this kind. |
| `language` | `"en" \| "he"` | no | The language of names and descriptions (default en). |

### Returns

A page of results (`FlowTemplateList`): `data`, `has_more` and `next_cursor`.

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

for flow_template in client.flow_templates.list():
    print(flow_template)
```

## `retrieve()`

**Retrieve a flow template.** A starter flow with its graph in the v1 node schema, in `language` (default en).

```python
# client.flow_templates
def retrieve(self, template_id: str, *, language: _m.FlowTemplatesRetrieveLanguage | Unset = UNSET, more_voice_version: str | Unset = UNSET) -> _m.FlowTemplate
```

`client.flow_templates.retrieve()` · `await async_client.flow_templates.retrieve()` · `GET /flow_templates/{template_id}` · [API reference](https://docs.morevoice.ai/api/operations/flow_templates_retrieve/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `template_id` | `str` | yes | The template's ID. |
| `language` | `"en" \| "he"` | no | The template's language (default en): its lines, names and description. |

### Returns

`FlowTemplate`:

| Field | Type | Description |
| --- | --- | --- |
| `template_id` | `string` | The template's ID: pass it as `template_id` to POST /v1/flows. |
| `object` | `"flow_template"` | Always `flow_template`. |
| `kind` | `"voice" \| "agent_script" \| "ivr"` | — |
| `language` | `"en" \| "he"` | — |
| `name` | `string` | — |
| `description` | `string` | — |
| `tags` | `string[]` | — |
| `node_count` | `integer` | — |
| `graph` | `FlowGraph` | A flow's graph: nodes (v1 node schema) wired by their transitions' `next`, variables and settings. |

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

flow_template = client.flow_templates.retrieve("appointment-booking")
print(flow_template)
```
