Skip to main content
POST
/
messages
Create a new Message
curl --request POST \
  --url https://commerce.driv.ly/api/messages \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "<string>",
  "agent": "<string>",
  "lead": "<string>",
  "salesRep": "<string>",
  "internalEmail": "<string>",
  "externalPhoneNumber": "<string>",
  "externalEmail": "<string>",
  "internalPhoneNumber": "<string>",
  "text": "<string>",
  "templateType": "<string>",
  "template": "<string>",
  "attachments": [
    "<string>"
  ]
}
'
{
  "data": {
    "id": "<string>",
    "agent": "<string>",
    "lead": "<string>",
    "salesRep": "<string>",
    "internalEmail": "<string>",
    "externalPhoneNumber": "<string>",
    "externalEmail": "<string>",
    "internalPhoneNumber": "<string>",
    "text": "<string>",
    "templateType": "<string>",
    "template": "<string>",
    "attachments": [
      "<string>"
    ]
  },
  "success": true
}

Query Parameters

depth
integer

The number of levels of related objects to include in the response

Body

application/json
id
string

Message is uniquely identified by id

agent

Message is written by Agent

lead

Lead sends/receives chat- Message

salesRep

Sales Rep sends/receives Message

internalEmail
string<idn-email>

Message is with Internal Email

externalPhoneNumber
string

Message is with External Phone Number

Pattern: ^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$
externalEmail
string<idn-email>

Message is with External Email

internalPhoneNumber
string

Message is with Internal Phone Number

Pattern: ^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$
text
string

Message has Message Text

templateType
string

Message is autofilled by Template Type

template

Message is filled in from Template

attachments
(string | Attachment · object)[]

Message has Attachment

Response

Message Created

data
Message · object
Example:
{
"id": "msg_kj3l9dks9j20",
"sentAt": "2023-05-14T12:00:00Z",
"content": "Is the vehicle still available?",
"senderId": "cus_9j2k3ls9dj20",
"receiverId": "com_9j3k2dls0j29"
}
success
boolean