Send message
/api/v1/messages/sendThis endpoint allows you to send an outgoing message to a specific contact via the Klink platform.
Sending files from your own URL (externalMedia)
- Only
urlis required.fileName,fileTypeandfileSizeare filled in automatically when omitted: the name from the URL, the type from the file extension, and the size from your server'sContent-Length. - The customer receives your original URL. Klink does not re-host the file, so keep it publicly reachable.
- LINE only accepts HTTPS URLs for images and videos.
- To upload a file to Klink instead, use Upload File (multipart) in Media Manager and send its ID as
mediaFileId.
Sending a WhatsApp template (whatsappTemplate)
Send an approved WhatsApp template, for example to message a customer outside WhatsApp's 24-hour window.
- Works only when the contact's latest conversation is on an official WhatsApp channel (360dialog / Meta). QR-linked WhatsApp numbers have no templates.
nameis the template name.languageis only needed when the same name exists in more than one language.variablesfills the body placeholders:"1"for{{1}}, or the name for a named placeholder such as{{first_name}}. Every placeholder needs a value.messageTypecan be omitted; templates are always sent astext.messageis optional: by default the Klink inbox shows the template text with your variables filled in.- Only
APPROVEDtemplates can be sent. Use List WhatsApp templates to see a channel's templates and the variables each one needs. - Can't be combined with
mediaFileId,externalMediaorplatformUserId. - Returns 400 with the reason if the contact has no conversation, the channel isn't official WhatsApp, the template isn't found or approved, or a variable is missing.
Request
Authorization
Bearer Token
Provide your API token in the Authorization header. See Authentication to issue one.
Example:Authorization: Bearer ********************
contactIdstringrequiredmessageTypestringrequiredtext,image,video,audioorfile.messagestringrequiredmediaFileIdstringoptionalOnly use one, externalMedia or mediaFileId when sending video, image, file
externalMediaobjectoptionalSend a file hosted on your own server. Use either
externalMediaormediaFileId, not both. The file is delivered from your URL as-is (Klink does not copy it), so it must stay publicly reachable. LINE requires HTTPS for images and videos.Child attributes
urlstringrequiredPublic URL of the file (https recommended).
Example:https://example.com/files/report.pdf
fileTypestringoptionalMIME type (
application/pdf) or file extension (pdf). Optional: inferred from the file name or the server's Content-Type.Example:application/pdf
fileNamestringoptionalName shown to the customer. Defaults to the last segment of the URL (e.g.
report.pdf).Example:report.pdf
fileSizeintegeroptionalSize in bytes. Optional: read from the server's Content-Length when omitted.
Example:1005148
widthintegeroptionalImage/video width in pixels (optional).
heightintegeroptionalImage/video height in pixels (optional).
createdAtstringrequiredwhatsappTemplateobjectoptionalSend an approved WhatsApp template instead of free text
Child attributes
namestringrequiredTemplate name, e.g. welcomemessage
languagestringoptionalLanguage code, e.g. en; only needed when the name exists in several languages
variablesobjectoptionalValues keyed by placeholder: "1" for {{1}}, or first_name for {{first_name}}
Responses
200OK
OK
statusintegerrequiredmessagestringrequireddataobjectrequiredChild attributes
idstringrequiredcreatedAtstringrequiredupdatedAtstringrequireddeletedAtnullrequiredclientRequestIdstringrequiredpartition_keystringrequiredmessagestringrequireddirectionstringrequiredtypestringrequiredreadAtnullrequiredmetadataobjectrequiredplatformIdstringrequiredplatformMessageIdstringrequiredreplyPlatformMessageIdnullrequiredreplyReactionnullrequiredlinkMessageIdnullrequiredlinkMessagePartitionKeynullrequiredtemplatenullrequiredlocalestringrequiredurlstringrequiredpreviewUrlstringrequiredimageSetIdstringrequiredroomIdstringrequiredroomobjectrequiredactorIdnullrequiredactorTypestringrequiredactornullrequireduploadIdstringrequireduploadobjectrequiredChild attributes
createdAtstringrequiredupdatedAtstringrequireddeletedAtnullrequiredfileNamestringrequiredfileSizeintegerrequiredoriginalUrlstringrequiredfileUrlstringrequired
senderIdnullrequiredworkflowRulenullrequiredassigneeIdnullrequiredassigneenullrequiredrepliedMessagenullrequirededitedMessageIdnullrequirededitedMessagePartitionKeynullrequirededitedMessagenullrequiredisEditedbooleanrequirededitedAtnullrequiredlabelstringrequiredcontactIdnullrequiredreceiverMetadatanullrequiredattachmentsnullrequired
400Bad Request
Bad Request
messagearray[string]requirederrorstringrequiredstatusCodeintegerrequired