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

# Create an email template

> <Warning>
The Feedback Management API is currently in **BETA**, therefore the following endpoints are subject to modification, given a **2 week notice**.

If you are planning to use any of them, please **notify us** so we will be able to keep you informed about upcoming changes.
</Warning>

Creates a new feedback email template for the authenticated user's organization.

When `cta_type` is `BUTTON`, the `cta_text` field is required.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml post /feedback/email-templates
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /feedback/email-templates:
    post:
      tags:
        - Feedback Management
      summary: Create an email template
      description: >
        <Warning>

        The Feedback Management API is currently in **BETA**, therefore the
        following endpoints are subject to modification, given a **2 week
        notice**.


        If you are planning to use any of them, please **notify us** so we will
        be able to keep you informed about upcoming changes.

        </Warning>


        Creates a new feedback email template for the authenticated user's
        organization.


        When `cta_type` is `BUTTON`, the `cta_text` field is required.
      operationId: createFeedbackEmailTemplate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackEmailTemplateCreate'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/feedback_email_template'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          description: Request body validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items: {}
                        msg:
                          type: string
                        type:
                          type: string
components:
  schemas:
    FeedbackEmailTemplateCreate:
      allOf:
        - $ref: '#/components/schemas/FeedbackEmailTemplateBase'
      required:
        - name
        - subject
        - title
        - body
        - cta_type
        - color
        - font_family
    feedback_email_template:
      allOf:
        - $ref: '#/components/schemas/FeedbackEmailTemplateBase'
        - type: object
          required:
            - id
            - org_id
            - name
            - subject
            - title
            - body
            - cta_type
            - color
            - font_family
            - created_at
            - updated_at
          properties:
            id:
              type: integer
              description: Unique identifier of the email template
              example: 1
            org_id:
              type: integer
              description: The organization ID that owns this template
              example: 42
            created_at:
              type: string
              format: date-time
              description: Date and time the template was created
              example: '2024-01-15T10:30:00+00:00'
            updated_at:
              type: string
              format: date-time
              description: Date and time the template was last updated
              example: '2024-06-01T08:00:00+00:00'
    FeedbackEmailTemplateBase:
      type: object
      properties:
        name:
          type: string
          description: Internal name for the template
          example: Default Template
        subject:
          type: string
          description: Email subject line
          example: We'd love your feedback
        title:
          type: string
          description: Title displayed in the email body
          example: How did we do?
        body:
          type: string
          description: Main body text of the email
          example: >-
            Thank you for visiting us. Please take a moment to share your
            experience.
        cta_text:
          type:
            - string
            - 'null'
          description: Call-to-action label. Required when `cta_type` is `BUTTON`.
          example: Leave a review
        cta_type:
          type: string
          enum:
            - BUTTON
            - EMBEDDED_NPS
          description: |
            Type of call-to-action rendered in the email.
            - `BUTTON`: a clickable button; `cta_text` must be non-null.
            - `EMBEDDED_NPS`: an NPS score row embedded in the email.
          example: BUTTON
        post_cta_text:
          type:
            - string
            - 'null'
          description: Text displayed below the call-to-action
          example: Your feedback helps us improve.
        closing_text:
          type:
            - string
            - 'null'
          description: Closing paragraph of the email
          example: Thank you for your time!
        signature_name:
          type:
            - string
            - 'null'
          description: Name displayed in the email signature
          example: The Partoo Team
        logo_url:
          type:
            - string
            - 'null'
          format: uri
          description: URL of the organization logo displayed in the email header
          example: https://example.com/logo.png
        banner_url:
          type:
            - string
            - 'null'
          format: uri
          description: URL of the banner image displayed in the email
          example: https://example.com/banner.png
        color:
          type: string
          description: Primary accent color for the email template (hex code)
          example: '#3B82F6'
        font_family:
          type: string
          enum:
            - Arial
            - Helvetica
            - Verdana
            - Georgia
            - Trebuchet
          description: Font family used in the email
          example: Arial
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````