Skip to main content
POST
/
workspaces
/
{workspace}
/
contacts
Create a contact
curl --request POST \
  --url https://lancepilot.com/api/v3/workspaces/{workspace}/contacts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "number": "+14155550123",
  "name": "John Doe",
  "email": "[email protected]",
  "gender": "male"
}'
{
  "status": 201,
  "message": "Resource created successfully.",
  "data": {}
}

JSON (Basic Contact)

{
  "number": "+14155550123",
  "name": "John Doe",
  "email": "[email protected]",
  "gender": "male"
}

Multipart Form Data (Extended Contact)

If you want to upload an avatar image, assign groups, or set status, you must send the request as multipart/form-data. Example:
POST /contacts
Content-Type: multipart/form-data

number=+14155550123
name=John Doe
[email protected]
gender=male
status=1
avatar=@/path/to/image.png
contact_groups[]=12
contact_groups[]=15

📝 Field Requirements

FieldTypeRequiredNotes
numberstringYesWhatsApp phone number (must be unique in workspace).
namestring (max 50)NoContact’s display name. Defaults to Unknown if not provided.
emailstring (email)NoContact’s email address.
genderenum(male,female,other)NoGender of contact.
statusbooleanNoDefaults to true. Only available in form-data requests.
avatarfile (image, ≤2MB)NoUpload contact avatar (form-data only).
contact_groupsarray of integersNoGroup IDs to assign contact into (form-data only, workspace scoped).

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.

Body

application/json
number
string
required

The WhatsApp phone number of the contact

Example:

"+14155550123"

name
string
Maximum length: 50
Example:

"John Doe"

email
string<email>
gender
enum<string>
Available options:
male,
female,
other
Example:

"male"

Response

status
integer
required
Example:

201

message
string
required
Example:

"Resource created successfully."

data
object
required

Created resource data.