Skip to main content

Record Visit (v1)

Method + Path​

POST /v1/public/tracking/visit

Actual backend path: /v1/public/tracking/visit

Description​

Record a visit to a vCard or storefront. This endpoint is used for analytics and tracking purposes.

Authentication​

Not required - This is a public endpoint

Headers​

HeaderTypeRequiredDescription
Content-TypestringYesapplication/json

Request Body​

{
"type": "vcard",
"destinationSlug": "john-doe",
"sessionId": "session-123",
"utmName": "email-campaign",
"userAgent": "Mozilla/5.0...",
"referer": "https://example.com",
"ipAddress": "192.168.1.1",
"country": "United States",
"city": "New York",
"deviceType": "mobile",
"browser": "Chrome",
"os": "iOS"
}

Body Parameters​

ParameterTypeRequiredDescription
typestringYesVisit type. Valid values: vcard, storefront
destinationSlugstringYesSlug of the vCard or storefront
sessionIdstringYesUnique session identifier
utmNamestringNoUTM campaign name
userAgentstringNoUser agent string (max 500 characters)
refererstringNoReferrer URL (max 1000 characters)
ipAddressstringNoIP address (max 45 characters)
countrystringNoCountry name (max 100 characters)
citystringNoCity name (max 100 characters)
deviceTypestringNoDevice type. Valid values: desktop, mobile, tablet, unknown
browserstringNoBrowser name (max 100 characters)
osstringNoOperating system (max 100 characters)

Response (200)​

{
"visit": {
"id": "507f1f77bcf86cd799439011",
"sessionId": "session-123",
"type": "vcard",
"destinationSlug": "john-doe",
"createdAt": "2024-01-15T10:00:00Z"
}
}

Common Errors​

  • 400 Bad Request: Invalid request body
  • 404 Not Found: Destination not found
  • 422 Unprocessable Entity: Validation errors
  • 500 Internal Server Error: Server error