Skip to main content
POST
/
workspaces
/
{workspace}
/
contacts
/
number
/
{number}
/
messages
/
document
Document Message
curl --request POST \
  --url https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/number/{number}/messages/document \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "file": "https://example.com/document.pdf",
  "caption": "This is caption for document."
}'
{
  "status": 201,
  "message": "Resource created successfully.",
  "data": {}
}
This endpoint allows you to send an document message to a contact. You can provide the document in two ways:
  1. Document URL: Pass the document URL in the request body.
  2. Uploaded File: Send the document as a file using multipart/form-data.

File Field Requirements

  • file:
    • Required
    • Allowed MIME types: txt, docx, ppt, pptx, xls, xlsx, doc, pdf
    • Maximum size: 100 MB (max:102400 KB)

Request Options

  • Document URL Example (JSON):
    {
      "file": "https://example.com/document.txt"
    }
    
  • Uploaded File Example (multipart/form-data):
    POST /workspaces/{workspace}/contacts/number/{number}/messages/document
    Content-Type: multipart/form-data
    
    file: [binary document file]
    
Choose the method that best fits your use case.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace
string<uuid>
required

ID of the workspace.

number
string<uuid>
required

Number of the contact.

Body

application/json

Message sending parameters.

file
string
required

Document URL.

caption
string

Optional caption for the document.

Response

status
integer
required
Example:

201

message
string
required
Example:

"Resource created successfully."

data
object
required

Created resource data.