Partial update of session fields.
/turn and /generate-examples Trigger.dev tasks) — agents typically only PATCH title or manually-edited draft_subject/draft_body.
/api/campaigns/ai-chat-sessions/{id} with other verbs. See the sibling page for related operations on the same resource.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
AI chat session UUID
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$All fields are optional. Only keys present in the body are written — other fields are left untouched. The handler does NOT validate whether the session is currently running; writes during a live Trigger.dev run may race.
Replace the chat transcript. Typically managed by the server via /turn; agents should rarely PATCH this directly.
Human-readable session title surfaced in the UI.
Current draft email subject. Accepts template variables.
Current draft email body. Accepts template variables.
Structural framework (hook, value prop, CTA, etc.). Overwriting this invalidates generated_examples.
Prior skeleton versions for undo/rollback.
Prior draft subject/body versions.
Monotonically-increasing revision counter for the skeleton.
-9007199254740991 <= x <= 9007199254740991Per-lead sample emails. Usually written by the generate-email-examples Trigger.dev task — PATCH it directly only to clear or manually override.
Busy-flag for async Trigger.dev work owned by this session. null means idle — new turns or generate-examples calls can be accepted. While non-null, concurrent POSTs to /turn or /generate-examples return 409 until the task completes and clears the flag.
chat_processing, generating_examples Session updated. Returns the full updated row.
Canonical campaign AI chat session. One session drafts one email (one sequence node) through a back-and-forth chat with the framework LLM.