Send Message
POST
https://api.mottasl.ai/v1/message/send
Messages
Last modified:2024-12-07 14:36:58
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Query Params
create
boolean
required
Example:
true
Body Params application/json
recipient_type
string
required
preview_url
boolean
required
to
string
Phone number
Examples:
96655555552010111111111111
Match pattern:
[0-9]
type
enum<string>
Message Type
Allowed values:
texttemplateaudiocontactsdocumentimageinteractivelocation
Examples:
templatetextvideoaudiodocument
template
object
required
template_id
string
required
language
string
required
argument
object
required
HEADER
array[string]
required
Example
{
"recipient_type": "individual",
"preview_url": false,
"to": "9665555555",
"type": "template",
"template": {
"template_id": "test_template_name",
"language": "en",
"argument": {
"BODY": [
"Customer Name",
"123456"
]
}
}
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mottasl.ai/v1/message/send?create=true' \
--header 'Content-Type: application/json' \
--data-raw '{
"recipient_type": "individual",
"preview_url": false,
"to": "9665555555",
"type": "template",
"template": {
"template_id": "test_template_name",
"language": "en",
"argument": {
"BODY": [
"Customer Name",
"123456"
]
}
}
}'
Responses
🟢200Success
application/json
Body
success
boolean
required
message
string
required
data
object
required
id
integer
required
message_id
string
required
from_id
string
required
to_id
string
required
timestamp
string
required
channel
string
required
source
string
optional
type
string
required
direction
string
required
level
string
required
parent_message_id
integer
required
thread_id
integer
required
business_id
string
required
contact_id
integer
required
forwarded
boolean
required
spam
integer
optional
mentions
null
optional
agent_id
integer
required
window_marker
boolean
optional
template_id
integer
required
is_recorded
boolean
optional
CreatedAt
string
required
UpdatedAt
string
required
Example
{
"data": {
"id": 53009555,
"message_id": "wamid.HBgMMjAxMDkyODU4Nzg1FQIAERgSNzI2OTMxNEM3M0RGOUJBM0I4AA==",
"from_id": "96600008478",
"to_id": "201000000005",
"timestamp": "2025-03-10T13:33:22.453557388Z",
"channel": "whatsapp",
"source": "",
"type": "template",
"direction": "out",
"level": "agent",
"parent_message_id": 0,
"thread_id": 0,
"business_id": "2c8a9a2d-04f8-49df-a240-f4a990782c94",
"contact_id": 92,
"forwarded": false,
"spam": 0,
"mentions": null,
"agent_id": 40000,
"window_marker": false,
"template_id": 12345,
"is_recorded": false,
"CreatedAt": "2025-03-10T13:33:22.453557Z",
"UpdatedAt": "2025-03-10T13:33:22.453557Z"
},
"message": "Message sent successfully",
"success": true
}
🟠400BadRequest
Modified at 2024-12-07 14:36:58