Skip to main content

Overview

This page documents the data structures used throughout the Marketing Events Sync workflow, including API response formats, internal data models, and callback output structures.

Marketing Event Object

Source Structure

From: HubSpot Marketing Events API response Example from: test.js:6-29
{
  "eventName": "Test",
  "eventType": "Test",
  "startDateTime": "2025-11-06T13:00:00Z",
  "endDateTime": "2025-11-08T13:00:00Z",
  "eventOrganizer": "Test",
  "eventDescription": "Test",
  "eventUrl": null,
  "eventCancelled": false,
  "eventCompleted": false,
  "customProperties": [
    {
      "name": "pipeline",
      "value": "default"
    },
    {
      "name": "simpleevents_event_location",
      "value": "Test"
    }
  ],
  "objectId": "496825886022",
  "eventStatus": "ONGOING",
  "createdAt": "2025-11-14T10:00:00.000Z"
}

Field Definitions

eventName
string
required
Name of the marketing event. Used as dealname in the created deal.
eventType
string
Type of event (e.g., “Webinar”, “Conference”, “Onsite - In Person”, “Workshop”)
startDateTime
string
ISO 8601 formatted start date and time for the event
endDateTime
string
ISO 8601 formatted end date and time for the event
eventOrganizer
string
Name of the organization or person organizing the event. Mapped to valid HubSpot options.
eventDescription
string
Description text for the event
eventUrl
string | null
URL for event registration or details page
eventCancelled
boolean
Whether the event has been cancelled
eventCompleted
boolean
Whether the event has been completed
customProperties
array
Array of custom property objects (see Custom Properties structure below)
objectId
string
required
Unique identifier for the marketing event. Used as evento_marketing_id in deals.
eventStatus
string
Current status: “UPCOMING”, “ONGOING”, “COMPLETED”, or “CANCELLED”
createdAt
string
ISO 8601 timestamp when the event was created in HubSpot

Custom Properties Array

Location: Nested within Marketing Event objects Example from: test.js:16-25, 38-47, 61-70

Structure

[
  {
    "name": "pipeline",
    "value": "732960029"
  },
  {
    "name": "simpleevents_event_location",
    "value": "Icare | El Golf 40, Piso Zócalo, Las Condes"
  },
  {
    "name": "simpleevents_configuration",
    "value": "eyJmb3JtSUQi..."
  }
]

Field Definitions

name
string
required
Property identifier/key
value
string | number | null
required
Property value

Common Properties

Identifies which HubSpot pipeline the deal should be assigned to.Type: string | numberValid Values:
  • "default" - Default pipeline
  • 732960029, 733263424, 733155504, 732990838, 733019304, 733257614 - Specific pipeline IDs
Used by: getPipelineFromCustomProperties() function
Physical or virtual location of the event.Type: stringExamples:
  • "Icare | El Golf 40, Piso Zócalo, Las Condes"
  • "Online"
  • "Santiago"
Encoded configuration data from SimpleEvents.io integration.Type: stringFormat: Base64 encoded JSON

Deal Properties Object

Location: Sent in POST request to create deals Defined in: events.js:284-295

Structure

{
  "properties": {
    "dealname": "20251202 Prueba TI 7",
    "fecha_hora_de_inicio": "2025-12-02T11:00:00Z",
    "fecha_hora_fin": "2025-12-02T12:00:00Z",
    "organizador_evento": "Icare",
    "description": "Prueba TI 7",
    "url_evento": "https://app.simpleevents.io/event/8002",
    "evento_marketing_id": "497326171656",
    "tipo_de_evento_de_marketing": "Onsite - In Person",
    "pipeline": "default",
    "dealstage": "appointmentscheduled"
  }
}

Field Definitions

dealname
string
required
Name of the deal (from eventName)Source: eventData.eventName
fecha_hora_de_inicio
string
Event start date/time in ISO 8601 formatSource: eventData.startDateTime
fecha_hora_fin
string
Event end date/time in ISO 8601 formatSource: eventData.endDateTime
organizador_evento
string
Mapped organizer value (Icare, G12, or Legal)Source: Transformed from eventData.eventOrganizer via mapOrganizerToValidOption()Valid Values: "Icare", "G12", "Legal"
description
string
Event description textSource: eventData.eventDescription
url_evento
string | null
Event URL for registration or detailsSource: eventData.eventUrl
evento_marketing_id
string
required
Unique marketing event identifierSource: eventData.objectIdPurpose: Links deal to original marketing event; used for duplicate detection
tipo_de_evento_de_marketing
string
Marketing event typeSource: eventData.eventType
pipeline
string
required
Pipeline identifierSource: Extracted from customProperties via getPipelineFromCustomProperties()Default: "default"
dealstage
string
required
Deal stage ID based on pipelineSource: Mapped from pipeline via getDealStageByPipeline()Default: "appointmentscheduled"

Pipeline Mapping Structure

Location: events.js:205-213

Definition

const pipelineMapping = {
  default: "appointmentscheduled",
  732960029: "1067986567",
  733263424: "1068046680",
  733155504: "1067993111",
  732990838: "1067990364",
  733019304: "1068033893",
  733257614: "1068039530",
};

Mapping Table

Pipeline IDDeal Stage IDDescription
defaultappointmentscheduledDefault pipeline stage
7329600291067986567Custom pipeline 1
7332634241068046680Custom pipeline 2
7331555041067993111Custom pipeline 3
7329908381067990364Custom pipeline 4
7330193041068033893Custom pipeline 5
7332576141068039530Custom pipeline 6
If a pipeline value is not found in the mapping, the function returns "appointmentscheduled" as the default deal stage.

Callback Output Structure

Location: events.js:362-372

Success Response

callback({
  outputFields: {
    totalEvents: 150,
    todayEvents: 5,
    createdCount: 3,
    skippedCount: 1,
    failedCount: 1,
    createdEvents: JSON.stringify([
      {
        "id": "12345678",
        "dealname": "20251202 Prueba TI 7"
      },
      {
        "id": "12345679",
        "dealname": "Test Event"
      }
    ], null, 2),
    skippedEvents: JSON.stringify([
      {
        "name": "Existing Event",
        "reason": "exists_by_id"
      }
    ], null, 2),
    failedEvents: JSON.stringify([
      {
        "name": "Failed Event",
        "error": "Property values were not valid"
      }
    ], null, 2)
  }
});

Field Definitions

totalEvents
number
Total number of marketing events retrieved from API
todayEvents
number
Number of events created today (after filtering)
createdCount
number
Number of deals successfully created
skippedCount
number
Number of events skipped (already exist)
failedCount
number
Number of events that failed to create
createdEvents
string
JSON string array of created deal objects with id and dealname
skippedEvents
string
JSON string array of skipped events with name and reason
failedEvents
string
JSON string array of failed events with name and error

Created Event Object

Location: Returned by createCustomRecord() at events.js:315-318

Structure

{
  "id": "12345678901",
  "dealname": "20251202 Prueba TI 7"
}
id
string
HubSpot CRM object ID for the created deal
dealname
string
Name of the created deal (same as event name)

Skipped Event Object

Location: Created during processing loop at events.js:333, 341

Structure

{
  "name": "Existing Event Name",
  "reason": "exists_by_id"
}
name
string
Name of the skipped event
reason
string
Reason for skippingPossible Values:
  • "exists_by_id" - Event already exists by evento_marketing_id
  • "exists_by_name" - Event already exists by dealname

Failed Event Object

Location: Created during error handling at events.js:350-353

Structure

{
  "name": "Failed Event Name",
  "error": "Property values were not valid: dealname already exists"
}
name
string
Name of the event that failed to create
error
string
Error message from the exception

Test Data Examples

Complete Event with Pipeline

From: test.js:54-74
{
  "eventName": "Evento con pipeline 732960029",
  "eventType": "Webinar",
  "startDateTime": "2025-11-15T15:00:00Z",
  "endDateTime": "2025-11-15T16:00:00Z",
  "eventOrganizer": "Cebra",
  "eventDescription": "Test con pipeline 732960029",
  "eventUrl": null,
  "customProperties": [
    {
      "name": "pipeline",
      "value": "732960029"
    },
    {
      "name": "simpleevents_event_location",
      "value": "Online"
    }
  ],
  "objectId": "999999999991",
  "eventStatus": "UPCOMING",
  "createdAt": "2025-11-14T14:15:00.000Z"
}
Transforms to Deal:
{
  "properties": {
    "dealname": "Evento con pipeline 732960029",
    "fecha_hora_de_inicio": "2025-11-15T15:00:00Z",
    "fecha_hora_fin": "2025-11-15T16:00:00Z",
    "organizador_evento": "Icare",
    "description": "Test con pipeline 732960029",
    "url_evento": null,
    "evento_marketing_id": "999999999991",
    "tipo_de_evento_de_marketing": "Webinar",
    "pipeline": "732960029",
    "dealstage": "1067986567"
  }
}

Event with Unmapped Pipeline

From: test.js:98-118
{
  "eventName": "Evento con pipeline no mapeado",
  "eventType": "Workshop",
  "startDateTime": "2025-11-17T14:00:00Z",
  "endDateTime": "2025-11-17T18:00:00Z",
  "eventOrganizer": "Unknown Org",
  "eventDescription": "Test con pipeline no encontrado en mapeo",
  "eventUrl": null,
  "customProperties": [
    {
      "name": "pipeline",
      "value": "999888777"
    },
    {
      "name": "simpleevents_event_location",
      "value": "Remote"
    }
  ],
  "objectId": "999999999993",
  "eventStatus": "UPCOMING",
  "createdAt": "2025-11-14T18:45:00.000Z"
}
Transforms to Deal (uses defaults):
{
  "properties": {
    "dealname": "Evento con pipeline no mapeado",
    "fecha_hora_de_inicio": "2025-11-17T14:00:00Z",
    "fecha_hora_fin": "2025-11-17T18:00:00Z",
    "organizador_evento": "Icare",
    "description": "Test con pipeline no encontrado en mapeo",
    "url_evento": null,
    "evento_marketing_id": "999999999993",
    "tipo_de_evento_de_marketing": "Workshop",
    "pipeline": "999888777",
    "dealstage": "appointmentscheduled"
  }
}
Note how the unmapped pipeline value "999888777" is preserved in the pipeline field, but the dealstage defaults to "appointmentscheduled".

Event Without Pipeline

From: test.js:31-52
{
  "eventName": "20251202 Prueba TI 7",
  "eventType": "Onsite - In Person",
  "startDateTime": "2025-12-02T11:00:00Z",
  "endDateTime": "2025-12-02T12:00:00Z",
  "eventOrganizer": "ICARE - SimpleEvents.io",
  "eventDescription": "Prueba TI 7",
  "eventUrl": "https://app.simpleevents.io/event/8002",
  "customProperties": [
    {
      "name": "simpleevents_configuration",
      "value": "eyJmb3JtSUQi..."
    },
    {
      "name": "simpleevents_event_location",
      "value": "Icare | El Golf 40, Piso Zócalo, Las Condes"
    }
  ],
  "objectId": "497326171656",
  "eventStatus": "UPCOMING",
  "createdAt": "2025-11-14T12:30:00.000Z"
}
Transforms to Deal (uses default pipeline):
{
  "properties": {
    "dealname": "20251202 Prueba TI 7",
    "fecha_hora_de_inicio": "2025-12-02T11:00:00Z",
    "fecha_hora_fin": "2025-12-02T12:00:00Z",
    "organizador_evento": "Icare",
    "description": "Prueba TI 7",
    "url_evento": "https://app.simpleevents.io/event/8002",
    "evento_marketing_id": "497326171656",
    "tipo_de_evento_de_marketing": "Onsite - In Person",
    "pipeline": "default",
    "dealstage": "appointmentscheduled"
  }
}
When no pipeline property is found in customProperties, the function uses "default" as the pipeline value and "appointmentscheduled" as the deal stage.

Build docs developers (and LLMs) love