Skip to content

Create an AI Template

Request

Create a reusable message template. Templates are referenced from flow nodes by their uuid (the template_uuid field on linkedin_send_message, email_send_message, etc.).

is_public is required — sending the request without it currently returns a 500 instead of a validation error, so always include it (1 = shared with the team, 0 = private). name and type are also required; everything else is optional and defaults to empty.

Security
bearerAuth
Bodyapplication/jsonrequired
namestringrequired
Example:"Cold outreach — CTO"
typestringrequired

Template type.

Enum:"message""connection_note""email""post_comment"
Example:"message"
is_publicintegerrequired

1 = visible to the whole team, 0 = private. Required (see note above).

Enum:01
Example:1
subjectstring or null

Subject line (for email templates).

bodystring or null

Template body. Supports {{variables}} (e.g. {{first_name}}).

promptstring or null

AI personalization prompt.

llm_uuidstring or null, (uuid)

LLM integration to use for AI blocks.

llm_configobject or null
enable_validationboolean
enable_fallbackboolean
settingsobject
POST
/flows/api/ai-templates
curl -i -X POST \
  https://leadgen.grinfi.io/flows/api/ai-templates \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Cold outreach — CTO",
    "type": "message",
    "is_public": 1,
    "body": "Hi {{first_name}}, saw you lead engineering at {{company}} — worth a chat?"
  }'

Responses

Template created.

Bodyapplication/json
uuidstring, (uuid)
team_idinteger
template_category_uuidstring or null, (uuid)
namestring
subjectstring or null
bodystring or null
attachmentsArray of objects or null
typestring

Template type.

Enum:"message""connection_note""email""post_comment"
llm_uuidstring or null, (uuid)
llm_configobject or null
promptstring or null
enable_validationboolean
validation_llm_uuidstring or null, (uuid)
validation_llm_configobject or null
validation_promptstring or null
enable_fallbackboolean
settingsobject or null
created_atstring, (date-time)
updated_atstring, (date-time)
Response
{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "team_id": 0, "template_category_uuid": "8615c630-89da-4f0b-abff-7eec9679fbe3", "name": "string", "subject": "string", "body": "string", "attachments": [ {} ], "type": "message", "llm_uuid": "b7cc7bc5-91a7-491e-a0a2-aef6fcdc275b", "llm_config": {}, "prompt": "string", "enable_validation": true, "validation_llm_uuid": "d44ed88c-5ace-4a4f-91d3-5b30b7b6d898", "validation_llm_config": {}, "validation_prompt": "string", "enable_fallback": true, "settings": {}, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }