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

# Create a template

> Creates a draft. Nothing can be sent with it until you publish it. Without `slug`, one is
made from the name. `starter` fills it from a ready-made design: `otp`, `welcome`,
`password-reset`, `receipt`, `invoice`, `invitation` or `sign-in-alert`.



## OpenAPI

````yaml /openapi.json post /templates
openapi: 3.1.2
info:
  title: PulseSend API
  version: 1.0.0
  description: >-
    Send transactional email over HTTP. Authenticate with a `ps_live_` or
    `ps_test_` key.
servers:
  - url: https://pulse-send.jiordiviera.me/api/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Emails
  - name: Files
  - name: Templates
paths:
  /templates:
    post:
      tags:
        - Templates
      summary: Create a template
      description: >-
        Creates a draft. Nothing can be sent with it until you publish it.
        Without `slug`, one is

        made from the name. `starter` fills it from a ready-made design: `otp`,
        `welcome`,

        `password-reset`, `receipt`, `invoice`, `invitation` or `sign-in-alert`.
      operationId: v1.templates.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Shown in the dashboard only.
                  examples:
                    - Sign-in code
                slug:
                  type: string
                  description: >-
                    What your code sends in `template`. Lowercase letters,
                    digits and hyphens.
                  examples:
                    - otp-login
                starter:
                  type: string
                  description: A ready-made design to start from.
                  examples:
                    - otp
                subject:
                  type: string
                  description: Mustache, like the HTML.
                  examples:
                    - 'Your {{brand.name}} code: {{code}}'
                from:
                  type: string
                  description: Default sender, used when an email gives none.
                  examples:
                    - Acme <security@acme.com>
                html:
                  type: string
                  description: Mustache template, up to 512 KB.
                text:
                  type: string
                  description: Plain-text version. Generated from the HTML when omitted.
              required:
                - name
      responses:
        '201':
          description: '`TemplateResource`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateResource'
components:
  schemas:
    TemplateResource:
      type: object
      properties:
        object:
          type: string
          const: template
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        aliases:
          type: object
          additionalProperties: []
        subject:
          type: string
          description: 'Le brouillon : ce que publish publiera.'
        from:
          type:
            - string
            - 'null'
        html:
          type: string
        text:
          type:
            - string
            - 'null'
        variables:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              required:
                type: boolean
              default:
                type:
                  - string
                  - 'null'
              example:
                type:
                  - string
                  - 'null'
            required:
              - name
              - required
              - default
              - example
        published_version:
          type:
            - integer
            - 'null'
        has_unpublished_changes:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - object
        - id
        - name
        - slug
        - aliases
        - subject
        - from
        - html
        - text
        - variables
        - published_version
        - has_unpublished_changes
        - created_at
        - updated_at
      title: TemplateResource
  securitySchemes:
    apiKey:
      type: http
      description: Your API key, `ps_live_…` or `ps_test_…`.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.