Read as needed; not a required onboarding step. Path：[Data Access Path](/en/docs)

# Synchronize Data Changes

The Change Feed is an incremental API for external customer applications.
Applications poll `GET /v1/changes`, process a complete page, persist
`next_cursor`, and use [Read Content & History](/en/docs/documents) to retrieve
content or metric details.

Delivery is **pull-only**. MarsYoo does not push new data to customer
applications through webhooks, message-queue callbacks, or another
server-initiated delivery mechanism.

## Current events

| Event type | Trigger | Follow-up read |
| --- | --- | --- |
| `document.created` | A canonical document is created for the first time | Document details or batch-get |
| `document.version.created` | Title, body, or other versioned content changes | Content by `version_id` |
| `document.metrics.updated` | A metric snapshot changes | Document snapshots |

Deletion, takedown, and unavailability events are not currently reliable
customer data sources. They will be enabled only when platform collectors
provide reliable recheck signals.

## Initial read

Every request requires a Consumer API Key:


```bash
export MARSYOO_BASE_URL='https://www.marsyoo.com'
export MARSYOO_API_KEY='whale_consumer_xxx'

curl --get "$MARSYOO_BASE_URL/v1/changes" \
  --header "Authorization: Bearer $MARSYOO_API_KEY" \
  --data-urlencode "event_type=document.created,document.version.created,document.metrics.updated" \
  --data-urlencode "limit=100"
```


Omit `cursor` for the first read. The feed starts at the earliest authorized
event in the online retention window.

| Parameter | Meaning |
| --- | --- |
| `cursor` | Opaque cursor from the previous page; omit on the first read |
| `limit` | 1–200 events per page; defaults to 100 |
| `event_type` | Comma-separated event types |
| `source_platform` | Comma-separated platform enums |
| `ingested_from` / `ingested_to` | RFC 3339 ingest-time boundaries |

The API returns only platforms allowed by the application's
entitlements. Filters cannot expand the authorized scope.

Retrieve details using the returned `document_id`, and include `version_id`
when you need the content version associated with that event.

## Response and content retrieval


```json
{
  "items": [
    {
      "sequence": 42,
      "event_id": "chg_xxx",
      "schema_version": 1,
      "event_type": "document.version.created",
      "dataset_id": "social_media_raw",
      "source_platform": "reddit",
      "document_id": "doc_xxx",
      "version_id": "ver_xxx",
      "changed_fields": ["title", "body", "metadata"],
      "occurred_at": "2026-10-09T11:55:00Z",
      "observed_at": "2026-10-09T12:00:00Z",
      "ingested_at": "2026-10-09T12:00:02Z"
    }
  ],
  "next_cursor": "opaque-cursor"
}
```


Events contain resource IDs and changed field names, never complete document
bodies. Collect the `document_id` values from a page and call:


```http
POST /v1/documents/batch-get
```


To load the historical body referenced by a version event, call:


```http
GET /v1/documents/{document_id}/content?version_id={version_id}
```


## Cursor and checkpoint rules

Use this processing order:

1. Request a page with the current cursor.
2. Process every item on the page idempotently.
3. Persist `next_cursor` only after business processing succeeds.
4. Use the saved cursor to request the next page.

Do not save the cursor before the full page succeeds, or a process failure may
skip events. Reusing the same cursor returns a stable page.

## Delivery and latency

- **At least once**: every event is returned at least once. Rarely (when a server-side write is retried) the same event appears twice, with different `sequence` values and the same `event_id`. Deduplicate by `event_id`, or process idempotently by business resource ID.
- **Order**: events on one cursor chain come in increasing `sequence`. Gaps in `sequence` are normal and do not mean events are missing.
- **Latency**: new events become readable about 2–3 minutes after they are stored.

A cursor is bound to the Consumer application and the complete filter set. Do
not reuse it with another application or after changing event,
platform, or time filters.

## Error handling

| HTTP | Meaning | Recommended action |
| ---: | --- | --- |
| `400` | Invalid parameters or cursor, or cursor/filter mismatch | Correct the request; do not retry automatically |
| `401` | Missing, invalid, or revoked API Key | Use an active key |
| `403` | The application lacks access to the requested scope | Check subscriptions and entitlements |
| `410` | The cursor is older than the online replay window | Rebuild the checkpoint or restore from historical data |
| `429` | Rate, concurrency, or quota limit | Back off according to `Retry-After` |
| `503` | Change Feed temporarily unavailable | Retry a limited number of times with exponential backoff |

Events are currently retained online for 30 days. Applications that stop
consuming for extended periods should monitor checkpoint age.

Events before 2026-11-03 00:00 UTC are no longer available: older cursors get
`410`, a first read starts at that time, and the full 30-day window is back on
2026-12-03. On `410`, read again without a cursor and use
[Bulk Data Exports](/en/docs/exports) to fetch the missing period by ingest time.

## SDK

Use the publicly downloadable [Python and Go Query SDKs](/en/docs/sdk), or
call the REST API directly. In either case, the application must persist its
own checkpoint and save `next_cursor` only after the whole page succeeds.
REST and the [public OpenAPI contract](/en/public-api-reference) remain the
authoritative definition of request fields and response schemas.

See the [Public API Reference](/en/public-api-reference) for the complete
request and schemas.

## Continue Your Task

[Return to the integration path](/en/docs); return to your task after consulting this reference.