# Retrieve a flow template

`GET https://api.morevoice.ai/v1/flow_templates/{template_id}`

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

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

Operation ID: `flow_templates_retrieve`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `template_id` | `string` | yes | The template's ID. |

### Query parameters

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

### 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 `FlowTemplate`.

| Field | Type | Description |
| --- | --- | --- |
| `template_id` | `string` | The template's ID: pass it as `template_id` to POST /v1/flows. |
| `object` | `"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. |
| `graph.schema_version` | `1` | The node schema version (1). |
| `graph.kind` | `"voice" \| "agent_script" \| "ivr"` | — |
| `graph.nodes` | `FlowNode[]` | — |
| `graph.variables` | `object[]` | — |
| `graph.settings` | `object` | — |

Example:

```json
{
  "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"
}
```

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

### 404 Not Found

No object with this ID exists in this organisation and mode. 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

const flowTemplate = await mv.flowTemplates.retrieve("appointment-booking");
console.log(flowTemplate);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

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

**cURL**

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