# List flow templates

`GET https://api.morevoice.ai/v1/flow_templates`

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

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `flow_templates_list`.

## Parameters

### Query 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). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Responses

### 200 OK

OK Returns `FlowTemplateList`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"list"` | — |
| `data` | `FlowTemplate[]` | — |
| `has_more` | `boolean` | Whether more objects follow in the requested direction. |
| `next_cursor` | `string \| null` | Pass as starting_after (or ending_before, when paging backwards) to continue; null on the last page. |
| `url` | `string` | The list's path. |

Example:

```json
{
  "data": [
    {
      "description": "Understands what the caller needs, books a slot in your calendar, texts a confirmation and offers another time when it's taken.",
      "kind": "voice",
      "language": "en",
      "name": "Appointment booking",
      "node_count": 14,
      "object": "flow_template",
      "tags": [
        "inbound",
        "booking",
        "sms",
        "api"
      ],
      "template_id": "appointment-booking"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "object": "list",
  "url": "/v1/flow_templates"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

for await (const flowTemplate of mv.flowTemplates.list()) {
	console.log(flowTemplate);
}
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

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

**cURL**

```sh
curl https://api.morevoice.ai/v1/flow_templates \
  -H "Authorization: Bearer $MOREVOICE_API_KEY"
```
