Skip to main content
POST
/
format
/
v1
/
templates
Create format template
curl --request POST \
  --url https://api.case.dev/format/v1/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "caption",
  "content": "<string>",
  "description": "<string>",
  "styles": {},
  "variables": [
    "<string>"
  ],
  "tags": [
    "<string>"
  ]
}
'
{
  "id": "tmpl_abc123",
  "name": "Legal Brief Caption",
  "type": "caption",
  "variables": [
    "caseNumber",
    "court",
    "plaintiff",
    "defendant"
  ],
  "createdAt": "2024-01-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Body

application/json
name
string
required

Template name

type
enum<string>
required

Template type

Available options:
caption,
signature,
letterhead,
certificate,
footer,
custom
content
string
required

Template content with {{variable}} placeholders

description
string

Template description

styles
object

CSS styles for the template

variables
string[]

Template variables (auto-detected if not provided)

tags
string[]

Template tags for organization

Response

Template created successfully

id
string

Template ID

name
string

Template name

type
string

Template type

variables
string[]

Detected template variables

createdAt
string<date-time>

Creation timestamp