Skip to main content

REST API Reference

Base URL: /api/v1 Authentication: Bearer JWT Token

Common Patterns

Request Format

Content-Type: application/json
Authorization: Bearer <jwt_token>

Response Format

{
"data": { /* resource or array of resources */ },
"meta": {
"total": 100,
"skip": 0,
"take": 25,
"hasMore": true
}
}

Pagination

GET /customers?tenantId=tenant_123&skip=0&take=25

Customer Endpoints

List Customers

GET /api/v1/customers

Query parameters: tenantId, status, skip, take

Get Customer

GET /api/v1/customers/:id

Resolve Customer

Find or create customer by identity:

GET /api/v1/customers/resolve?email=user@example.com

Create Customer

POST /api/v1/customers

Update Customer

PATCH /api/v1/customers/:id

Merge Customers

POST /api/v1/customers/:id/merge

Activity Endpoints

Get Timeline

GET /api/v1/customers/:id/activities

Add Activity

POST /api/v1/customers/:id/activities

Notes Endpoints

Get Notes

GET /api/v1/customers/:id/notes

Add Note

POST /api/v1/customers/:id/notes

Segment Endpoints

List Segments

GET /api/v1/segments

Create Segment

POST /api/v1/segments

Get Segment Members

GET /api/v1/segments/:id/members

Refresh Segment

POST /api/v1/segments/:id/refresh

Sync to Messaging

POST /api/v1/segments/:id/sync-to-messaging

Campaign Endpoints

List Campaigns

GET /api/v1/campaigns

Create Campaign

POST /api/v1/campaigns

Get Campaign

GET /api/v1/campaigns/:id

Update Campaign

PATCH /api/v1/campaigns/:id

Schedule Campaign

POST /api/v1/campaigns/:id/schedule

Pause Campaign

POST /api/v1/campaigns/:id/pause

Resume Campaign

POST /api/v1/campaigns/:id/resume

Journey Endpoints

List Journeys

GET /api/v1/journeys

Create Journey

POST /api/v1/journeys

Get Journey Steps

GET /api/v1/journeys/:id/steps

Activate Journey

POST /api/v1/journeys/:id/activate

Social Endpoints

List Connections

GET /api/v1/social/connections

Connect Account

POST /api/v1/social/connections/connect

Disconnect Account

DELETE /api/v1/social/connections/:id

List Posts

GET /api/v1/social/posts

Create Post

POST /api/v1/social/posts

Publish Post

POST /api/v1/social/posts/:id/publish

Public Lead Endpoints

Authentication: None (public endpoints)

These endpoints allow capturing leads from public-facing forms without authentication. Rate-limited to 10 requests per minute per IP.

Submit Lead

Capture a lead from a contact form, demo request, or other public form.

POST /api/leads
Content-Type: application/json

Request Body:

{
"email": "prospect@example.com",
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Golf Club",
"phoneNumber": "+27821234567",
"message": "Interested in learning more about TeeTime",
"leadType": "demo-request",
"tenantId": "digiwedge",
"siteId": "corporate-site",
"sourceRef": "demo-form",
"pageUrl": "https://digiwedge.com/demo",
"utmSource": "google",
"utmMedium": "cpc",
"utmCampaign": "spring-2026",
"honeypot": "",
"timeToSubmitMs": 5000
}

Lead Types: demo-request, contact, general

Anti-Fraud Fields:

  • honeypot: Hidden field that must be empty (bots fill it)
  • timeToSubmitMs: Time from page load to submit (fast submits are suspect)

Response:

{
"submissionId": "123e4567-e89b-12d3-a456-426614174000"
}

Anti-Fraud Gates:

  1. Honeypot: If filled, returns fake success
  2. Disposable Email: Submissions from mailinator.com, etc. are disqualified
  3. Fast Submit: Submissions under 2 seconds are marked suspect
  4. Duplicate Detection: Duplicate leads within 5 minutes return existing ID
  5. Rate Limiting: 10 requests per minute per IP

Lead Quality Tags:

  • unverified: New lead, not yet verified
  • suspect: Fast submit or other suspicious activity
  • disqualified: Disposable email or other disqualifying factor

Analytics Endpoints

Engagement Analytics

GET /api/v1/analytics/engagement

Campaign Analytics

GET /api/v1/analytics/campaigns

Social Analytics

GET /api/v1/analytics/social