Generate a template

Have the copy agent author a full sequence from a brief. One metered model call. The result is a template you can read, edit step by step, and wire onto a campaign.

POSThttps://app.trygtm.com/api/v1/templates/generate
Scope
write
Cost
2 action credits per unit — ai.message.standard

Headers

Idempotency-Keystringoptional
A key unique to this write, up to 255 characters. A retry carrying the same key returns the first response instead of running again. Kept for 24 hours.

Body

namestringrequired
The name to give it. Names are how campaigns, templates and lists are referred to, so make it specific.
briefstringrequired
What the sequence should say and to whom, 10 to 2000 characters. The copy agent authors every step from this.
attemptstringoptional
An idempotency key for this generation, up to 64 characters. Send the same value when retrying after a lost answer, and the retry is refused rather than billed a second time. Omit it and every call is a separate charge.
goalstringoptional
What the campaign or template is for. Decides the default step chain and how the copy agent writes.start_conversationbook_meetingbook_demoevent_signupnurturereengage

Request

curl -X POST https://app.trygtm.com/api/v1/templates/generate \
  -H "Authorization: Bearer $TRYGTM_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q4 logistics leaders",
    "brief": "Open a conversation with demand-gen leaders at mid-market logistics software companies about routing costs."
  }'

Response

{
  "data": {
    "detail": "Generated “Logistics opener” with 5 steps.",
    "template": {
      "id": "c1d2e3f4-0a1b-4c2d-8e3f-4a5b6c7d8e9f",
      "name": "Logistics opener",
      "goal": "book_meeting"
    },
    "steps": [
      {
        "position": 1,
        "tract": "campaign-email",
        "action": "send_email",
        "channel": "email",
        "label": "Opener",
        "wait_amount": 0,
        "wait_unit": "days",
        "branch_condition": null,
        "body": null,
        "settings": {}
      }
    ]
  }
}

Was this page helpful?