---
title: "Create Session"
method: POST
path: "/print-mail/v1/template_editor_sessions"
tags: ["Template Editor Sessions"]
---

# Create Session

`POST /print-mail/v1/template_editor_sessions`

Create a Template Editor Session.

Note that if no `backURL` is supplied, PostGrid removes the Back button
from the editor page. This is ideal for when you `iframe` the editor.

## Request body

- TemplateEditorSessionCreate
  - `template` string, required — ID of the underlying template that this edits.
  - `backURL` string, uri — The URL supplied when this editor session was created.
  - `title` string — The title supplied when this editor session was created.
  - `trackers` union — Controls which Trackers are displayed in the template editor session.
    - 'all' | 'none'
    - string[]
  - `styles` TemplateEditorSessionStyles — Style overrides for the template editor session.
    - `canvas` TemplateEditorSessionCanvasStyles — Style overrides for the template editor canvas.
      - `backgroundColor` string — The canvas background color.
    - `saveButton` TemplateEditorSessionSaveButtonStyles — Style overrides for the template editor save button.
      - `backgroundColor` string — The save button background color.
      - `textColor` string — The save button text color.
    - `panelText` TemplateEditorSessionPanelTextStyles — Style overrides for template editor panel text.
      - `color` string — The panel text color.

## Response `201`

The newly created Template Editor Session.

- TemplateEditorSession
  - `id` string, required — A unique ID prefixed with `template_editor_session_`.
  - `object` 'template_editor_session', required — Always `template_editor_session`.
  - `live` boolean, required — `true` if this is a live mode session else `false`.
  - `template` string, required — ID of the underlying template that this edits.
  - `backURL` string, uri — The URL supplied when this editor session was created.
  - `title` string — The title supplied when this editor session was created.
  - `trackers` union — Controls which Trackers are displayed in the template editor session.
    - 'all' | 'none'
    - string[]
  - `styles` TemplateEditorSessionStyles — Style overrides for the template editor session.
    - `canvas` TemplateEditorSessionCanvasStyles — Style overrides for the template editor canvas.
      - `backgroundColor` string — The canvas background color.
    - `saveButton` TemplateEditorSessionSaveButtonStyles — Style overrides for the template editor save button.
      - `backgroundColor` string — The save button background color.
      - `textColor` string — The save button text color.
    - `panelText` TemplateEditorSessionPanelTextStyles — Style overrides for template editor panel text.
      - `color` string — The panel text color.
  - `url` string, uri, required — A URL that can be iframed or redirected to for editing the template.
  - `createdAt` string, date-time, required — The UTC time at which this session was created.

## Other responses

- `400` — The newly created Template Editor Session.
- `401` — The newly created Template Editor Session.
- `404` — The newly created Template Editor Session.
- `422` — The newly created Template Editor Session.
- `429` — The newly created Template Editor Session.
- `500` — The newly created Template Editor Session.

---

[API](https://skmtc.net/postgrid/apis/postgrid-print-mail-api.md) · [All operations](https://skmtc.net/postgrid/apis/postgrid-print-mail-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/postgrid/postgrid-print-mail-api/revisions/6bb9d268c5d1/schema)
