> For the complete documentation index, see [llms.txt](https://docs.middle.app/middle-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.middle.app/middle-docs/product/accounts/sync.md).

# Sync

Toggle syncs on or off and run ad-hoc syncs

## Turning a sync on or off

To turn a sync on or off:

1. Go to the desired app connection by clicking on the connection in the left-hand menu
2. Go to the record type you'd like to toggle on or off
3. Click the toggle to the right of the desired sync type

## Sync types

The main types of syncs are:

* **Complete transfers** - Grab all the data available from an endpoint or external resource. This sync is common for smaller datasets.
* **Primary key lookups** - Request data for a specific record using a primary identifier. For example, if Middle grabs a record, such as an invoice, and sees a user ID associated with that sale, Middle will perform a sync to grab that user's data.
* **Recent record lookups** - Syncs data from a datetime range. For example, grabbing all sales that have occurred in the past hour, every 20 minutes. The datetime scope and frequency of these syncs are configurable from the developer portal.

{% hint style="info" %}
Recent record lookups [can be set up](/middle-docs/product/apps/sync-records.md#recent-record-lookup) with weekly syncs that run on Saturdays at 06:00 UTC. These grab records over the previous week to ensure Middle doesn't miss anything.
{% endhint %}

## Ad-hoc syncs <a href="#ad-hoc-syncs" id="ad-hoc-syncs"></a>

You are able to initiate a sync manually by triggering an ad-hoc sync.

* For complete transfers, an ad-hoc sync will grab all the data from an endpoint or resource
* For a primary key lookup, you will need to input a primary ID to grab data for
* For recent record lookups, you will need to select a datetime range you'd like to get data from.

![A recent record poll sync ad-hoc sync](https://932524191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mks_UuU2atghAuA9bQz%2Fuploads%2FE8hWz6T56HFXv42eHMpp%2FScreen%20Shot%202022-05-04%20at%2010.20.53%20PM.png?alt=media\&token=8dd2463b-6a58-441e-84cd-d1dc9cf7e0a0)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.middle.app/middle-docs/product/accounts/sync.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
