Skip to content

Create Chat

Creates a new conversation (or reuses an active chat) for a contact and channel.

Endpoint

http
POST /api/{organizationId}/chat/create

Base URL: https://v1.api.interflow.chat

Authentication

API Key in the header (either format):

http
x-api-key: ak_your_api_key

or

http
Authorization: Bearer ak_your_api_key

Parameters

URL

ParameterTypeRequiredDescription
organizationIdstring (UUID)YesOrganization ID

Body

FieldTypeRequiredDescription
contactTypestringYeswhatsapp, phone, email, instagram, facebook, or telegram
contactValuestringYesContact value (phone, email, username, etc.)
channelIdstring (UUID)YesActive channel ID — sidebar Channels (copy from the card)
customerIdstring (UUID)NoExisting customer — Customers → actions (⋮) → Copy ID; if omitted, find/create automatically
customerNamestringNoName when creating a new customer
teamIdstring (UUID)NoTeam for the conversation — sidebar Teams (copy from the card)
initialMessagestring | objectNoInitial message (text or media)
whatsappTemplateobjectNoMeta template (WhatsApp Official only) — Channels → Templates → Copy ID
flowIdstring (UUID)NoStarts the flow immediately — sidebar Flows (copy from the card)
flowVariablesarrayNoFlow variables: [{ "name": "...", "value": "..." }]
contextMessagestringNoContext used with flowId or responseFlowId
responseFlowIdstring (UUID)NoFlow on customer reply — same ID under Flows (copy from the card)
keepPendingbooleanNoIf true, keeps the chat pending even with initialMessage / whatsappTemplate (skips attend and auto-assign)

initialMessage

String (text) or object:

FieldTypeDescription
typestringtext, image, video, audio, or document
contentstringText (required if type = text) or caption
urlstringHTTPS media URL (required for media types)
namestringFile name (optional)
mimetypestringMIME type (optional)
forwardobjectForward metadata (optional)

whatsappTemplate

FieldTypeDescription
id or templateIdstring (UUID)Interflow template ID — Channels → channel → WhatsApp TemplatesCopy ID
variablesobject | arrayTemplate variables (optional)

CUSTOMER STAGE

When creating a new customer, the system uses the channel default stage (settings.defaultStageId), if valid.

Behavior

  • If an active chat already exists (pending, in_progress, or await_closing) for the same contact/channel, it is reused (existing: true).
  • Without keepPending, sending initialMessage or whatsappTemplate usually attends the chat (in_progress) or adds you as collaborator.
  • With keepPending: true, the message/template is sent and the chat stays pending (also skips auto-assign on create).
  • flowId and responseFlowId are independent: the first starts immediately; the second waits for the customer reply.

Examples

Basic create

bash
curl -X POST "https://v1.api.interflow.chat/api/{organizationId}/chat/create" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ak_your_api_key" \
  -d '{
    "contactType": "whatsapp",
    "contactValue": "5511999999999",
    "channelId": "channel-uuid",
    "customerName": "Customer name"
  }'

WhatsApp template + keep pending + flow on reply

bash
curl -X POST "https://v1.api.interflow.chat/api/{organizationId}/chat/create" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ak_your_api_key" \
  -d '{
    "contactType": "whatsapp",
    "contactValue": "5511999999999",
    "channelId": "channel-uuid",
    "customerName": "Customer name",
    "keepPending": true,
    "responseFlowId": "flow-uuid",
    "whatsappTemplate": {
      "id": "template-uuid"
    }
  }'

Immediate flow

bash
curl -X POST "https://v1.api.interflow.chat/api/{organizationId}/chat/create" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ak_your_api_key" \
  -d '{
    "contactType": "whatsapp",
    "contactValue": "5511999999999",
    "channelId": "channel-uuid",
    "flowId": "flow-uuid",
    "contextMessage": "Welcome!",
    "flowVariables": [
      { "name": "source", "value": "api" }
    ]
  }'

Response

Success (200)

json
{
  "success": true,
  "chatId": "chat-uuid",
  "formattedContact": "5511999999999",
  "existing": false,
  "flowInitiated": false,
  "keepPending": true,
  "responseFlowScheduled": true,
  "responseFlowId": "flow-uuid",
  "responseFlowName": "Flow name",
  "templateSent": true,
  "templateMessageId": "message-uuid"
}

Common errors

HTTPSituation
400Invalid parameters / template on non-official channel
404Inactive channel or unknown responseFlowId
401Invalid API Key

Next steps

Documentation constantly being updated