Skip to main content
POST
/
api
/
v1
/
generate
Generate Content
curl --request POST \
  --url https://draftliftai.com/api/v1/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "template_id": 42,
  "user_direction": "How AI is transforming content marketing in 2026",
  "memory_ids": [
    1,
    5
  ],
  "model": "gpt-4o"
}
'
{
  "id": "gen_abc123",
  "status": "completed",
  "content_id": 789,
  "message": "Content generated successfully"
}

Single-call generation

The simplest way to generate content — just pass a template_id and user_direction:
curl -X POST https://draftliftai.com/api/v1/generate \
  -H "Authorization: Bearer dl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": 1,
    "user_direction": "Write about AI transforming content marketing"
  }'
The API auto-creates a content record and returns its content_id in the response. Use this ID for all downstream operations (retrieve, edit, finalize).

With memories and references

Attach memories for voice/context and reference materials for source content:
curl -X POST https://draftliftai.com/api/v1/generate \
  -H "Authorization: Bearer dl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": 1,
    "user_direction": "Write about AI transforming content marketing",
    "memory_ids": [1, 5, 12],
    "reference_material_ids": [3]
  }'

Generate against an existing draft

If you’ve already created a content record (via the dashboard or Create Content), pass its content_id:
curl -X POST https://draftliftai.com/api/v1/generate \
  -H "Authorization: Bearer dl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content_id": 123,
    "template_id": 1,
    "user_direction": "Write about AI transforming content marketing"
  }'

Next steps

After generation, retrieve the content to review it, then finalize to save your edited version and trigger learning analysis.

Authorizations

Authorization
string
header
required

API key (dl_live_...) or Supabase JWT token

Body

application/json
template_id
integer
required
user_direction
string
required
content_id
integer | null

Content ID to generate against. If omitted, a new content record is auto-created.

reference_material_ids
integer[]
memory_ids
integer[]
thesis_ids
integer[]
mode
string | null

Optional mode flag; set to "sync" only for explicit admin-approved synchronous generation.

generation_process_name
string | null

Optional override for the generation process name.

generation_process_version
integer | null

Optional override for the generation process version (>=1).

model
string
default:gpt-5
reasoning
ReasoningParams · object

Reasoning controls for GPT-5.

text
TextParams · object

Text output controls for GPT‑5.

max_output_tokens
integer | null

Upper bound for visible + reasoning tokens

Response

Successful Response

content_id
integer
required
generated_content
string
required
model_used
string
required
prompt_used
string
required
generation_timestamp
string<date-time>
required
reasoning_effort
string | null
generation_weight
integer
default:1