# Retrieve template

> GET /templates/:id — fetch a single template.

`GET /templates/:id`

The `id` path parameter also accepts an `alias`.

**Node.js**

```js
import { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

const { data, error } = await mb.templates.get('43f68331-0622-4e15-8202-246a0388854b');
console.log({ data, error });
```

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

SendDart::Templates.get("43f68331-0622-4e15-8202-246a0388854b")
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendDart\SendDart;

$senddart = SendDart::client('mb_xxxxxxxxx');

$senddart->templates->get('43f68331-0622-4e15-8202-246a0388854b');
```

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

senddart.Templates.get("43f68331-0622-4e15-8202-246a0388854b")
```

**Go**

```go
import "github.com/shekhu10/senddart-sdks/senddart-go"

client := senddart.NewClient("mb_xxxxxxxxx")

template, err := client.Templates.Get("43f68331-0622-4e15-8202-246a0388854b")
```

**Rust**

```rust
use senddart::SendDart;

let mb = SendDart::new("mb_xxxxxxxxx");

let _template = mb.templates.get("43f68331-0622-4e15-8202-246a0388854b").await?;
```

**Java**

```java
import com.senddart.SendDart;
import com.senddart.SendDartResponse;

SendDart senddart = new SendDart("mb_xxxxxxxxx");

SendDartResponse response = senddart.templates().get("43f68331-0622-4e15-8202-246a0388854b");
```

**.NET**

```csharp
using SendDart;

ISendDart senddart = SendDartClient.Create("mb_xxxxxxxxx");

var resp = await senddart.TemplateRetrieveAsync("43f68331-0622-4e15-8202-246a0388854b");
```

**cURL**

```bash
curl -X GET 'https://www.senddart.com/api/templates/43f68331-0622-4e15-8202-246a0388854b' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
senddart templates get 43f68331-0622-4e15-8202-246a0388854b
```

### Response

```json
{
  "object": "template",
  "id": "43f68331-0622-4e15-8202-246a0388854b",
  "current_version_id": "7c1e9b02-5a3f-4d68-9c14-8b2e0f5a6d37",
  "alias": null,
  "name": "Welcome email",
  "status": "published",
  "published_at": "2026-06-23T10:05:00.000Z",
  "has_unpublished_versions": false,
  "from": "Acme <hello@yourdomain.com>",
  "subject": "Welcome, {{first_name}}!",
  "reply_to": null,
  "html": "<h1>Hi {{first_name}}</h1>",
  "text": null,
  "variables": [
    {
      "id": "var_9e2b4a1f8c3d6e7b0f5a2c8d",
      "key": "first_name",
      "type": "string",
      "fallback_value": "there",
      "created_at": "2026-06-23T10:00:00.000Z",
      "updated_at": "2026-06-23T10:00:00.000Z"
    }
  ],
  "created_at": "2026-06-23T10:00:00.000Z",
  "updated_at": "2026-06-23T10:05:00.000Z"
}
```

> **Note:** Returns `not_found` if no template with that id (or alias) belongs to you.
