> ## Documentation Index
> Fetch the complete documentation index at: https://docs.foxreach.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Template

> Create a new email template.

## Request Body

<ParamField body="name" type="string" required>
  Template name.
</ParamField>

<ParamField body="subject" type="string">
  Email subject line. Supports [variables and spin syntax](/template-variables) like `{{firstName}}`, `{{company}}`.
</ParamField>

<ParamField body="body" type="string" required>
  Email body content. Supports [variables and spin syntax](/template-variables) for personalization and deliverability.
</ParamField>

<ParamField body="category" type="string" default="email">
  Template category: `email` or `reply_macro`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.foxreach.io/api/v1/templates" \
    -H "X-API-Key: otr_your_key" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Follow-up Template",
      "subject": "Following up on my last email",
      "body": "Hi {{firstName}},\n\nI wanted to follow up on my previous email about..."
    }'
  ```

  ```python Python SDK theme={null}
  from foxreach import FoxReach
  from foxreach.types import TemplateCreate

  client = FoxReach(api_key="otr_your_key")
  template = client.templates.create(
      TemplateCreate(
          name="Cold Intro — SaaS",
          subject="Quick question about {{company}}",
          body="Hi {{firstName}},..."
      )
  )
  ```

  ```typescript TypeScript SDK theme={null}
  import { FoxReach } from "foxreach";

  const client = new FoxReach({ apiKey: "otr_your_key" });
  const template = await client.templates.create({
      name: "Cold Intro — SaaS",
      subject: "Quick question about {{company}}",
      body: "Hi {{firstName}},..."
  });
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "data": {
      "id": "ctm_new456",
      "name": "Follow-up Template",
      "subject": "Following up on my last email",
      "body": "Hi {{firstName}},\n\nI wanted to follow up on my previous email about...",
      "category": "email",
      "createdAt": "2025-01-15T10:00:00",
      "updatedAt": "2025-01-15T10:00:00"
    }
  }
  ```
</ResponseExample>

## Rate Limit

* **100 requests per minute, per API key.** Fixed 60-second window.
* Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` (unix epoch seconds).
* A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns (`Retry-After`, exponential backoff, monitoring `X-RateLimit-Remaining`), see [Rate Limiting](/rate-limiting).
