---
title: "Sync Memories"
method: GET
path: "/api/v1/memories/sync"
tags: ["Memories"]
---

# Sync Memories

`GET /api/v1/memories/sync`

Server-to-Server Sync API with strict retry enforcement.

**First Sync (No History):**
- Call without session_id to start new session
- Returns ALL historical memories (paginated)
- No time window restriction
- Rate limited: 2 hours between sync sessions

**Incremental Sync (Has History):**
- Returns only new memories since last completed sync
- Paginated results

**Pagination:**
- Use session_id + cursor from previous response to fetch next page
- Cursor-based pagination for consistency
- Max 2 retries per cursor (3 total attempts)

**Rate Limiting:**
- New sessions: 2-hour minimum between syncs
- Pagination within session: No rate limit
- Cursor retry limit: 2 retries per cursor

**Session Management:**
- Sessions expire after 1 hour of inactivity
- Session auto-completes when all pages fetched

Example Flow:
```
# Start first sync
GET /sync?limit=100
→ Returns: session_id=abc123, cursor=page1, memories=[...]

# Continue pagination
GET /sync?session_id=abc123&cursor=page1&limit=100
→ Returns: cursor=page2, memories=[...]

# Retry on error (max 2 retries)
GET /sync?session_id=abc123&cursor=page1&limit=100
→ Returns: Same data (idempotent)
```

## Query parameters

- `cursor` string, nullable — Pagination cursor for continuing sync session
- `session_id` string, nullable — Session ID from previous sync request
- `limit` integer — Number of memories per page (10-500)

## Response `200`

Successful Response

- SyncMemoriesResponse
  - `memories` Memory[], required
    - `_id` string, nullable
    - `user_id` string, required
    - `title` string, required
    - `summary` string, required
    - `emotions` string[]
    - `topics` string[]
    - `transcript` TranscriptSegment[]
      - `text` string, required
      - `speaker` string, required
      - `speaker_id` integer, required
      - `is_user` boolean, required
      - `person_id` string, nullable
      - `start` number, required
      - `end` number, required
    - `domains` string[]
    - `mom` string, required
    - `participants` unknown[]
      - unknown
    - `archived` boolean
    - `rating` unknown
    - `source` string, required
    - `coordinates` Location[], nullable
      - `type` string, required
      - `coordinates` number[], required
      - `timestamp` integer, nullable
    - `chat_ids` string[]
    - `created_at` string, date-time, required
    - `started_at` string, date-time, required
    - `finished_at` string, date-time, required
    - `updated_at` string, date-time, nullable
    - `language` string, nullable
    - `deleted` boolean
    - `visibility` 'private' | 'public'
    - `processing_memory_id` string, nullable
    - `status` string, required
    - `transcript_source` string, nullable
    - `present_entities` string[], nullable
    - `mentioned_entities` string[], nullable
    - `tags` string[], nullable
    - `product` string[], nullable
    - `customer_details` CustomerDetails
      - `name` string — Customer name if known, otherwise empty string
      - `contact_number` string — Customer phone number if available, otherwise empty string
      - `type` 'Retailer' | 'Distributor' | 'Customer', required — Type of customer
      - `location` string — Shop name, area, or location if available
    - `competitors_mentioned` string[], nullable
    - `feedbacks` string[], nullable
    - `custom_summary` string, nullable — Structured sales intelligence with markdown headings: **What was pitched**, **What was asked**, **What worked**, **What didn't work**, **Follow-ups**. Only include headings that have content. Empty string if no insights available.
    - `type` string, nullable
    - `checkin_event_id` string, nullable
    - `mavic_user_id` string, nullable
    - `mavic_outlet_id` string, nullable
  - `pagination` PaginationInfo, required
    - `count` integer
    - `has_more` boolean, nullable
    - `next_cursor` string, nullable
    - `total_count` integer, nullable
    - `per_page` integer, nullable
  - `sync_info` SyncInfo, required
    - `session_id` string, required — Unique session ID for pagination continuity
    - `is_first_sync` boolean, required — True if this is the first sync (all historical data)
    - `since` string, nullable — Start of sync window (ISO 8601)
    - `until` string, required — End of sync window (ISO 8601)
    - `effective_since` string, nullable — Actual query start time (ISO 8601)

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/neosapien/apis/neocore.md) · [All operations](https://skmtc.dev/neosapien/apis/neocore/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/neosapien/neocore/revisions/8b94ef58f2cf/schema)
