Skip to main content
POST
/
templates
Create a new Template
curl --request POST \
  --url https://commerce.driv.ly/api/templates \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "updatedAt": "<string>",
  "createdAt": "<string>",
  "usedBy": [
    123
  ],
  "message": "<string>",
  "sequence": 123,
  "type": "Email Sent",
  "choice": "A",
  "messages": [
    123
  ],
  "subject": "<string>"
}
'
{
  "doc": {
    "updatedAt": "<string>",
    "createdAt": "<string>",
    "usedBy": [
      123
    ],
    "message": "<string>",
    "sequence": 123,
    "type": "Email Sent",
    "choice": "A",
    "messages": [
      123
    ],
    "subject": "<string>"
  },
  "message": "<string>"
}
Make sure you install our SDK first. You can find out how, and more here.
import { SDK } from '@drivly/commerce'
import type { templates } from '@drivly/commerce'

const sdk = new SDK(...)

const templates = await sdk.templates.create(data: templates): Promise<templates>

Authorizations

Authorization
string
header
required

Query Parameters

depth
number

number of levels to automatically populate relationships and uploads

locale
string

retrieves document(s) in a specific locale

fallback-locale
string

specifies a fallback locale if no locale value exists

Body

application/json
updatedAt
string
required
createdAt
string
required
usedBy
(number | SalesRep · object)[] | null
message
string | null
sequence
number | null
type
enum<string> | null
Available options:
Email Sent,
Initial Text Message,
Text Nudge
choice
enum<string> | null
Available options:
A,
B,
C,
D,
E,
F,
G,
H,
I
messages
(number | Message · object)[] | null
subject
string | null

Response

200 - application/json

ok

doc
Template · object
required
message
string
required