---
title: "Create a new template"
full: true
_openapi:
  method: POST
  toc: []
  structuredData:
    headings: []
    contents:
      - content: "Creates a new email template for the organization"
_apiData:
  document: "https://reloop.sh/api/template/openapi/json"
  operationData: [{"path":"/api/template/v1/create","method":"post"}]
  parameterList: [{"name":"name","type":"string","required":true,"description":"","location":"body","minLength":1,"maxLength":255},{"name":"description","type":"string","required":false,"description":"","location":"body"},{"name":"subject","type":"string","required":false,"description":"","location":"body","maxLength":500},{"name":"content","type":"any[]","required":false,"description":"","location":"body"}]
  responseMap: {"200":{"description":"Response for status 200","schema":{"id":"con_123456789","name":"Newsletter","description":"example_description","subject":"Welcome to Reloop","fromEmail":"example_fromEmail","replyTo":"example_replyTo","previewText":"example_previewText","organizationId":"example_organizationId","createdByUserId":"example_createdByUserId","status":"draft","content":[],"variables":[{"name":"Newsletter","type":"string","defaultValue":null}],"currentVersion":0,"thumbnailUrl":"example_thumbnailUrl","isDefault":true,"deletedAt":null,"createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}},"400":{"description":"Standard error response format","schema":{"message":"Contact already exists","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead.","link":"https://reloop.sh/docs/api/contacts"}},"401":{"description":"Standard error response format","schema":{"message":"Contact already exists","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead.","link":"https://reloop.sh/docs/api/contacts"}},"403":{"description":"Standard error response format","schema":{"message":"Contact already exists","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead.","link":"https://reloop.sh/docs/api/contacts"}},"404":{"description":"Standard error response format","schema":{"message":"Contact already exists","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead.","link":"https://reloop.sh/docs/api/contacts"}},"500":{"description":"Standard error response format","schema":{"message":"Contact already exists","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead.","link":"https://reloop.sh/docs/api/contacts"}}}
  codeSamples:
    - id: node
      lang: javascript
      label: Node.js
      source: |-
        import { Reloop } from "reloop-email";
        
        const reloop = new Reloop({ apiKey: "rl_123456789" });
        
        const template = await reloop.template.create({
          name: "Welcome Email",
          subject: "Welcome to Reloop!",
          content: []
        });
    - id: curl
      lang: bash
      label: cURL
      source: |-
        curl -X POST https://reloop.sh/template/v1/create \\
          -H "Authorization: Bearer rl_123456789" \\
          -H "Content-Type: application/json" \\
          -d '{
            "name": "Welcome Email",
            "subject": "Welcome to Reloop!",
            "content": []
          }'
    - id: python
      lang: python
      label: Python
      source: |-
        import requests
        
        response = requests.post(
            "https://reloop.sh/template/v1/create",
            headers={
                "Authorization": "Bearer rl_123456789",
                "Content-Type": "application/json",
            },
            json={
                "name": "Welcome Email",
                "subject": "Welcome to Reloop!",
                "content": [],
            },
        )
        
        template = response.json()
    - id: php
      lang: php
      label: PHP
      source: |-
        <?php
        $client = new \\GuzzleHttp\\Client();
        
        $response = $client->post('https://reloop.sh/template/v1/create', [
            'headers' => [
                'Authorization' => 'Bearer rl_123456789',
                'Content-Type'  => 'application/json',
            ],
            'json' => [
                'name' => 'Welcome Email',
                'subject' => 'Welcome to Reloop!',
                'content' => [],
            ],
        ]);
        
        $template = json_decode($response->getBody(), true);
    - id: java
      lang: java
      label: Java
      source: |-
        import java.net.URI;
        import java.net.http.*;
        import java.net.http.HttpRequest.BodyPublishers;
        
        HttpClient client = HttpClient.newHttpClient();
        
        String body = """
            {
              "name": "Welcome Email",
              "subject": "Welcome to Reloop!",
              "content": []
            }
            """;
        
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://reloop.sh/template/v1/create"))
            .header("Authorization", "Bearer rl_123456789")
            .header("Content-Type", "application/json")
            .POST(BodyPublishers.ofString(body))
            .build();
        
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
    - id: dotnet
      lang: csharp
      label: .NET
      source: |-
        using System.Net.Http;
        using System.Net.Http.Json;
        
        var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer rl_123456789");
        
        var payload = new {
            name = "Welcome Email",
            subject = "Welcome to Reloop!",
            content = new object[] {}
        };
        
        var response = await client.PostAsJsonAsync(
            "https://reloop.sh/template/v1/create",
            payload
        );
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


{/* This file was generated by the OpenAPI doc generator. Do not edit this file directly. Run `bun run generate:api-docs` to regenerate. */}

<APIPage />
