# Retrieve template

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

`GET /templates/:id`

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

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

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

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

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

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

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

**cURL**

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

**CLI**

```bash
sendping 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.
