---
updatedAt: 2026-04-21T09:18:29.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Generate past events V2

The method is used for transferring the available event data from your CRM or other data store to our system.<br/>Workflows are not launched for these events. You can send up to 500 events per a request. <br/> <b>NOTE:</b> Version 2 API methods do not require escaping in nested JSON. <br/><a href="https://docs.esputnik.com/docs/sending-past-events">Learn more.</a>

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "esputnik.com",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://esputnik.com"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Deprecated"
    }
  ],
  "paths": {
    "/api/v2/past_events": {
      "post": {
        "tags": [
          "Deprecated"
        ],
        "summary": "Generate past events V2",
        "description": "The method is used for transferring the available event data from your CRM or other data store to our system.<br/>Workflows are not launched for these events. You can send up to 500 events per a request. <br/> <b>NOTE:</b> Version 2 API methods do not require escaping in nested JSON. <br/><a href=\"https://docs.esputnik.com/docs/sending-past-events\">Learn more.</a>",
        "operationId": "sendHistoryEvents_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchPastEventsV2"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json; charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/EventsMigrationResults"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EventsMigrationResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "<b>ACCEPTED</b> - the event added successfully to processing.<br/>\n<b>OCCURRED_DATE_IS_REQUIRED</b> - no event occurrence date present.<br/>\n<b>INCORRECT_OCCURRED_DATE_FORMAT</b> - incorrect date format. <br/>\n<b>OCCURRED_TIME_TOO_DEPTH</b> - the event occurrence time is beyond the limit for the past.<br/>\n<b>OCCURRED_TIME_IN_FUTURE</b> - the event occurrence time cannot be in the future.<br/>\n<b>EVENT_SEGMENTATION_DISABLED</b> - the segmentation for this event is disabled. More info at <a href=\"https://esputnik.com/en/support/how-to-use-event-segmentation\">How to use event segmentation</a> <br>\n<b>SERVER_ERROR</b> - failure to put the message in the queue for sending."
          }
        },
        "description": "The result of the history events migration."
      },
      "EventsMigrationResults": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "description": "The result of the history events migration.",
            "items": {
              "$ref": "#/components/schemas/EventsMigrationResult"
            }
          },
          "successCount": {
            "type": "integer",
            "format": "int32"
          },
          "errorCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "EventParameter": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "object",
            "oneOf": [
              {
                "$ref": "#/components/schemas/String"
              },
              {
                "$ref": "#/components/schemas/Object"
              }
            ]
          }
        },
        "description": "The list of event parameters represented as an array of \"key\" - \"value\" pairs. The parameter keys are arbitrary. <br>\n\tUsed in campaigns and for dynamic content creation in messages."
      },
      "BatchPastEventsV2": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "description": "The list of the past events",
            "items": {
              "$ref": "#/components/schemas/PastEvent"
            }
          }
        }
      },
      "PastEvent": {
        "required": [
          "eventTypeKey",
          "keyValue"
        ],
        "type": "object",
        "properties": {
          "eventTypeKey": {
            "type": "string",
            "description": "Event type ID. If no such event type exists, a new one is created.<br>\nAll characters are allowed, except < ; ’ \\ / | \" ` ' ^ ? ! , >",
            "example": "example-key"
          },
          "keyValue": {
            "type": "string",
            "description": "Event key. Determines event uniqueness.<br>\nThe key must contain a unique value for each contact (for example, email, phone number, external contact id, etc.)<br>\nAll characters are allowed, except < ; ’ \\ / | \" ` ' ^ ? ! , > <br>\nMax length: 300 symbols"
          },
          "params": {
            "type": "array",
            "description": "The list of event parameters represented as an array of \"key\" - \"value\" pairs. The parameter keys are arbitrary. <br>\n\tUsed in campaigns and for dynamic content creation in messages.",
            "items": {
              "$ref": "#/components/schemas/EventParameter"
            }
          },
          "occurred": {
            "type": "string",
            "description": "Event date and time."
          }
        },
        "description": "The list of the past events"
      },
      "Object": {
        "type": "object"
      },
      "String": {
        "type": "string"
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```