---
title: "Push a template from CLI"
method: POST
path: "/v1/templates/push"
tags: ["templates"]
---

# Push a template from CLI

`POST /v1/templates/push`

## Request

- Base URL: `https://api.wraps.dev`
- URL: `https://api.wraps.dev/v1/templates/push`
- Auth: HTTP bearer

Upserts a template compiled from React Email source. Used by `wraps push`.

## Request body

- object
  - `slug` string, required: Template slug (filename without extension)
  - `source` string, required: React Email TSX source code
  - `compiledHtml` string, required: Compiled HTML output
  - `compiledText` string, required: Compiled plain text output
  - `subject` string, required: Email subject line
  - `previewText` string: Preview/preheader text
  - `emailType` union, required: Email type for compliance
    - string
    - string
  - `channel` union: Template channel (default: email)
    - string
    - string
  - `variables` object[], required: Template variables
    - `name` string, required
    - `fallback` string
  - `sourceHash` string, required: SHA256 hash of source file
  - `sesTemplateName` string, required: SES template name
  - `cliProjectPath` string: Path in project (e.g. templates/welcome.tsx)
  - `force` boolean: Force overwrite even if edited on dashboard

## Response `200`

## Other responses

- `400`: Malformed request — unparseable body or an invalid parameter.
- `401`: Missing, malformed, or revoked credentials. Send `Authorization: Bearer <api key>`.
- `403`: Authenticated, but the resource belongs to another organization.
- `404`: No such route, or no such resource in this organization.
- `422`: The request parsed but failed schema validation.
- `429`: Rate limit exceeded. Wait for the window named by the RateLimit headers.
- `500`: Unexpected server failure. Safe to retry with backoff; quote `requestId` if it persists.

---

[API](https://skmtc.dev/wraps/apis/wraps-platform-api.md) · [All operations](https://skmtc.dev/wraps/apis/wraps-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wraps/apis/wraps-platform-api/revisions/12116fb21af7?raw)
