SmsPort Docs / WhatsApp

Reference

API Documentation

Compact reference for the current SMSPORT builder and drip endpoints.

44 endpoints23 GET20 POST1 DELETE

Login

Authenticates a workspace user and returns the SmsPort session tokens.

POST/auth/loginPublic endpoint

Parameters

ParameterDetails
email
required
Workspace login email
password
required
Workspace password

Example JSON Response

Response
{
  "accessToken": "token",
  "refreshToken": "refresh-token",
  "tokenType": "Bearer",
  "expiresIn": 900
}

Example Request

curl -X POST /auth/login \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "owner@smsport.local",
  "password": "password123"
}'

Refresh Session

Refreshes an expired access token using a valid refresh token.

POST/auth/refreshPublic endpoint

Example Request

curl -X POST /auth/refresh \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "refreshToken": "refresh-token"
}'

Get Current User

Returns the authenticated user and tenant context.

GET/auth/meBearer token required

Example Request

curl -X GET /auth/me \
  -H "Authorization: Bearer YOUR_TOKEN"

List Drip Campaigns

Returns compact campaign rows for the drip workspace list.

GET/dripsBearer token required

Example JSON Response

Response
{
  "campaigns": [
    {
      "id": "campaign-1",
      "name": "Welcome Drip",
      "status": "published",
      "latestVersionNumber": 2,
      "activeEnrollments": 24,
      "pausedEnrollments": 2,
      "totalEnrollments": 48
    }
  ]
}

Example Request

curl -X GET /drips \
  -H "Authorization: Bearer YOUR_TOKEN"

Create Drip Campaign

Creates a campaign shell with audience, trigger, and stop rules.

POST/dripsBearer token required

Parameters

ParameterDetails
name
required
Unique drip campaign name
audienceSource
required
tenant_contacts or contact_list
triggerType
required
api_trigger, keyword_trigger, tag_trigger, or webhook_trigger

Example JSON Response

Response
{
  "campaign": {
    "id": "campaign-1",
    "name": "Welcome Drip",
    "status": "draft"
  },
  "versions": []
}

Example Request

curl -X POST /drips \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Welcome Drip",
  "audienceSource": "tenant_contacts",
  "triggerType": "api_trigger",
  "triggerValue": "order_shipped",
  "exitConditions": [
    { "type": "keyword", "value": "STOP" }
  ]
}'

Create Draft Version

Creates a version payload from ordered steps and edges.

POST/drips/:campaignId/versionsBearer token required

Parameters

ParameterDetails
campaignId
required
UUID of the drip campaign

Example Request

curl -X POST /drips/:campaignId/versions \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "nodes": [
    {
      "nodeKey": "wait_start",
      "type": "wait",
      "title": "Wait",
      "config": { "mode": "relative", "durationMinutes": 60 }
    }
  ],
  "edges": []
}'

Check Version Readiness

Returns publish validation and readiness state for a draft version.

GET/drips/:campaignId/versions/:versionId/readinessBearer token required

Parameters

ParameterDetails
campaignId
required
Drip campaign UUID
versionId
required
Draft version UUID

Example JSON Response

Response
{
  "ready": true,
  "errors": [],
  "warnings": []
}

Example Request

curl -X GET /drips/:campaignId/versions/:versionId/readiness \
  -H "Authorization: Bearer YOUR_TOKEN"

Publish Version

Publishes an immutable version for live enrollments.

POST/drips/:campaignId/versions/:versionId/publishBearer token required

Parameters

ParameterDetails
campaignId
required
Drip campaign UUID
versionId
required
Draft version UUID

Example Request

curl -X POST /drips/:campaignId/versions/:versionId/publish \
  -H "Authorization: Bearer YOUR_TOKEN"

Start Drip Enrollment

Enrolls a contact into the published drip version.

POST/v1/drips/startBearer token required

Parameters

ParameterDetails
campaignId
required
Published drip campaign UUID
contactId
required
Tenant contact UUID
context
optional
Optional values available to template interpolation

Example Request

curl -X POST /v1/drips/start \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "campaignId": "campaign-1",
  "contactId": "contact-1",
  "context": {
    "orderId": "ORD-1001",
    "displayName": "Asha"
  }
}'

List Campaign Enrollments

Returns enrollment rows for the selected drip campaign.

GET/v1/drips/:campaignId/enrollmentsBearer token required

Parameters

ParameterDetails
campaignId
required
Drip campaign UUID

Example Request

curl -X GET /v1/drips/:campaignId/enrollments \
  -H "Authorization: Bearer YOUR_TOKEN"

Get Drip Report

Returns backend-owned summary, delivery, exit, step, and recent activity metrics.

GET/v1/drips/:campaignId/reportBearer token required

Parameters

ParameterDetails
campaignId
required
Drip campaign UUID

Example JSON Response

Response
{
  "campaign": {
    "id": "campaign-1",
    "name": "Welcome Drip",
    "status": "published",
    "versionNumber": 2
  },
  "summary": {
    "totalEnrolled": 42,
    "active": 12,
    "paused": 3,
    "completed": 20,
    "exited": 7
  }
}

Example Request

curl -X GET /v1/drips/:campaignId/report \
  -H "Authorization: Bearer YOUR_TOKEN"

Record Lifecycle Event

Records normalized lifecycle events such as delivery, unsubscribe, or conversion.

POST/v1/drips/eventsBearer token required

Example Request

curl -X POST /v1/drips/events \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "contactId": "contact-1",
  "eventType": "conversion_success",
  "source": "webhook",
  "payload": {
    "outboundMessageId": "message-1"
  }
}'

Create Global Opt-Out

Globally blocks future drip sends for a contact.

POST/v1/drips/opt-outsBearer token required

Example Request

curl -X POST /v1/drips/opt-outs \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "contactId": "contact-1",
  "channel": "all",
  "reason": "unsubscribe_requested"
}'

Pause Enrollment

Applies an operator pause to a specific enrollment.

POST/v1/drips/enrollments/:enrollmentId/pauseBearer token required

Parameters

ParameterDetails
enrollmentId
required
Enrollment UUID

Example Request

curl -X POST /v1/drips/enrollments/:enrollmentId/pause \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "durationHours": 24,
  "reason": "manual_review"
}'

Terminate Enrollment

Stops a running enrollment before its natural exit.

POST/v1/drips/enrollments/:enrollmentId/terminateBearer token required

Parameters

ParameterDetails
enrollmentId
required
Enrollment UUID

Example Request

curl -X POST /v1/drips/enrollments/:enrollmentId/terminate \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "manual_terminate"
}'

Get Contact Lists

Returns contact lists used by drip audience selection.

GET/contacts/listsBearer token required

Example Request

curl -X GET /contacts/lists \
  -H "Authorization: Bearer YOUR_TOKEN"

List Contacts

Returns paginated contacts, optionally scoped to a selected contact list.

GET/contactsBearer token required

Example Request

curl -X GET /contacts \
  -H "Authorization: Bearer YOUR_TOKEN"

Create Contact

Creates a single tenant contact record.

POST/contactsBearer token required

Example Request

curl -X POST /contacts \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "displayName": "Asha",
  "phoneE164": "+911111111111",
  "listIds": ["list-1"]
}'

Start Contact Import

Starts a CSV-based contact import job into an optional list.

POST/contacts/importBearer token required

Example Request

curl -X POST /contacts/import \
  -H "Authorization: Bearer YOUR_TOKEN"

Fetch Templates

Returns synced template records for the drip send step.

GET/templatesBearer token required

Example Request

curl -X GET /templates \
  -H "Authorization: Bearer YOUR_TOKEN"

Campaign Overview

Returns campaign metrics, readiness, delivery mix, and recent operational activity.

GET/campaigns/overviewBearer token required

Example Request

curl -X GET /campaigns/overview \
  -H "Authorization: Bearer YOUR_TOKEN"

Campaign Builder Snapshot

Returns the compact campaign builder state, pickers, draft, and recent runs.

GET/campaigns/builderBearer token required

Example Request

curl -X GET /campaigns/builder \
  -H "Authorization: Bearer YOUR_TOKEN"

Save Campaign Draft

Creates or updates the current outbound campaign draft.

POST/campaigns/draftBearer token required

Example Request

curl -X POST /campaigns/draft \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Festival Promo",
  "deliveryKind": "template",
  "templateId": "template-1",
  "senderPhoneNumberId": "sender-1",
  "audienceSource": "contact_list",
  "audienceListId": "list-1"
}'

Launch Campaign Draft

Launches the saved campaign draft into a live run.

POST/campaigns/draft/launchBearer token required

Example Request

curl -X POST /campaigns/draft/launch \
  -H "Authorization: Bearer YOUR_TOKEN"

Get Campaign Run Analytics

Returns delivery funnel, timing, audience, and engagement analytics for one run.

GET/campaigns/runs/:runId/analyticsBearer token required

Parameters

ParameterDetails
runId
required
Campaign run identifier

Example Request

curl -X GET /campaigns/runs/:runId/analytics \
  -H "Authorization: Bearer YOUR_TOKEN"

List Inbox Conversations

Returns inbox conversation rows for the live-chat workspace.

GET/inbox/conversationsBearer token required

Example Request

curl -X GET /inbox/conversations \
  -H "Authorization: Bearer YOUR_TOKEN"

Get Conversation Thread

Returns the selected conversation thread and messages.

GET/inbox/conversations/:conversationIdBearer token required

Parameters

ParameterDetails
conversationId
required
Conversation identifier

Example Request

curl -X GET /inbox/conversations/:conversationId \
  -H "Authorization: Bearer YOUR_TOKEN"

Reply To Conversation

Sends a manual reply into an active conversation thread.

POST/inbox/conversations/:conversationId/replyBearer token required

Parameters

ParameterDetails
conversationId
required
Conversation identifier

Example Request

curl -X POST /inbox/conversations/:conversationId/reply \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Hello, how can we help?",
  "replyToMessageId": "message-1"
}'

List Canned Replies

Returns saved canned replies for fast live-chat responses.

GET/inbox/canned-repliesBearer token required

Example Request

curl -X GET /inbox/canned-replies \
  -H "Authorization: Bearer YOUR_TOKEN"

Create Live Chat Stream Session

Creates a stream session for the real-time live-chat experience.

POST/inbox/live-chat/stream-sessionBearer token required

Example Request

curl -X POST /inbox/live-chat/stream-session \
  -H "Authorization: Bearer YOUR_TOKEN"

Webhook Operations Summary

Returns unresolved, failed, and replay-eligible webhook counts.

GET/webhooks/ops/summaryBearer token required

Example Request

curl -X GET /webhooks/ops/summary \
  -H "Authorization: Bearer YOUR_TOKEN"

List Webhook Events

Returns recent webhook event rows for operational review.

GET/webhooks/ops/eventsBearer token required

Example Request

curl -X GET /webhooks/ops/events \
  -H "Authorization: Bearer YOUR_TOKEN"

Replay Webhook Event

Replays one webhook event when it is still replay-eligible.

POST/webhooks/ops/events/:id/replayBearer token required

Parameters

ParameterDetails
id
required
Webhook event identifier

Example Request

curl -X POST /webhooks/ops/events/:id/replay \
  -H "Authorization: Bearer YOUR_TOKEN"

List Team Members

Returns current tenant members for operator assignment flows.

GET/team/membersBearer token required

Example Request

curl -X GET /team/members \
  -H "Authorization: Bearer YOUR_TOKEN"

List Team Invites

Returns outstanding team invitations.

GET/team/invitesBearer token required

Example Request

curl -X GET /team/invites \
  -H "Authorization: Bearer YOUR_TOKEN"

Invite Team Member

Invites a new member into the tenant workspace.

POST/team/invitationsBearer token required

Example Request

curl -X POST /team/invitations \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "agent@smsport.local",
  "role": "agent",
  "fullName": "Support Agent"
}'

Get Sender Phone Numbers

Returns connected sender numbers for sender selection in the drip builder.

GET/whatsapp/phone-numbersBearer token required

Example Request

curl -X GET /whatsapp/phone-numbers \
  -H "Authorization: Bearer YOUR_TOKEN"

WhatsApp Logs

Fetch WhatsApp logs of the last 3 days using this API.

GET/api/v1/whatsapp-logsPublic endpoint

Parameters

ParameterDetails
from
required
Provide from date in format YYYY-MM-DD
to
required
Provide to date in format YYYY-MM-DD

Example JSON Response

Response
{
  "success": true,
  "message": "Whatsapp Logs generated successfully.",
  "data": [
    {
      "type": "status_update",
      "request_id": "NlOPxxxxxxxxxxxx",
      "phone_number_id": "155xxxxxxxxxx",
      "recipient_id": "916xxxxxxxxx",
      "status": "delivered",
      "timestamp": "1763717022",
      "errors": null
    }
  ]
}

Example Request

curl -X GET /api/v1/whatsapp-logs \
  -H "Authorization: Bearer YOUR_TOKEN"

WhatsApp Logs Summary

Get WhatsApp logs summary for a 30-day interval.

GET/api/v1/whatsapp-summaryPublic endpoint

Parameters

ParameterDetails
from
required
Provide from date in format YYYY-MM-DD
to
required
Provide to date in format YYYY-MM-DD

Example JSON Response

Response
{
  "success": true,
  "message": "WhatsApp Summary fetched successfully.",
  "data": {
    "sent": 10,
    "accepted": 16,
    "delivered": 97,
    "read": 5,
    "failed": 3,
    "rejected": 0,
    "pending": 8
  }
}

Example Request

curl -X GET /api/v1/whatsapp-summary \
  -H "Authorization: Bearer YOUR_TOKEN"

Send Session Message (Simple)

Send a text or media message. You can send text, image, document, audio, video, location, sticker, or reaction messages.

POST/api/v1/whatsapp-sessionPublic endpoint

Parameters

ParameterDetails
phone_number_id
required
The ID of the phone number sending the message
to
required
Recipient Mobile Number (with country code)

Example JSON Response

Response
{
  "status": "success"
}

Example Request

curl -X POST /api/v1/whatsapp-session \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "text",
  "text": "Hello World"
}'

Verify API Connection (Ping)

Health Check Connection API. Used by third parties to verify their API Key validity before executing other public APIs.

GET/api/v1/pingAPI Key Required

Example JSON Response

Response
{
  "success": true,
  "message": "Connection successful",
  "environment": "live",
  "tenantId": "c61b0c95-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Example Request

curl -X GET /api/v1/ping \
  -H "Authorization: Bearer YOUR_TOKEN"