Skip to main content
Syncs are TypeScript functions that run on a schedule and cache external API data in Nango. Use the Syncs API to read records, trigger one-off runs, pause and resume schedules, and manage sync variants.
All requests must include an Authorization: Bearer <secret-key> header. See Authentication for details.

Records

List records

GET /records Returns cached records for a connection and model, ordered by modification date ascending. Use cursor-based pagination to retrieve large datasets.
Records not updated for 30 days have their payload pruned (metadata only remains). Records from syncs not run for 60 days are permanently deleted. Fetch and store records in your own system promptly.

Headers

string
required
Bearer <secret-key>
string
required
The ID of the connection to fetch records for.
string
required
The integration ID (unique key) for the connection.

Query parameters

string
required
The name of the sync model to fetch records for, as defined in nango.yaml.
string
The sync variant to fetch records for. Omit to fetch records from the default (base) variant.
string
ISO 8601 timestamp. Only return records modified after this date. Useful for incremental fetches.
string
Filter records by last action. Accepted values: added, updated, deleted, or a comma-separated combination such as added,updated.
string
Pagination cursor from the previous response’s next_cursor field.
number
default:"100"
Maximum number of records to return per page. Maximum value is 500.
string[]
Filter to specific record IDs. Can be specified multiple times: ids=id1&ids=id2.

Response

object[]
required
Array of records matching the query.
string | null
required
Cursor to pass in the next request to retrieve the following page. null when there are no more records.
Response
Node SDK signature

Prune records

PATCH /records/prune Empties the payload for records up to a specified cursor, while preserving record metadata. Use this to meet compliance requirements without losing the ability to track record state. The payload can be restored by re-syncing.
Pruning only affects Nango’s cache. It does not delete anything on the external API and is not the same as detecting a deletion from the source.

Headers

string
required
Bearer <secret-key>
string
required
The ID of the connection.
string
required
The integration ID for the connection.

Body

string
required
The sync model from which to prune records.
string
required
Records are pruned up to and including this cursor value. Use the _nango_metadata.cursor value from a record.
string
The sync variant to prune records from.
number
Maximum number of records to prune in this request. When omitted, all matching records up to the cursor are pruned.

Response

number
required
Number of records pruned in this request.
boolean
required
true if there are more records to prune up to the given cursor. Send another request with the same until_cursor to continue.
Response

Sync execution

Trigger sync

POST /sync/trigger Triggers an immediate, one-off execution of one or more syncs for a connection. Useful after updating connection metadata or when you need to force a fresh import. Use opts.reset to clear the sync checkpoint and re-fetch all data. Use opts.reset with opts.emptyCache to start completely fresh by also clearing the record cache.

Headers

string
required
Bearer <secret-key>

Body

string
required
The integration ID.
array
required
Array of sync names to trigger. Pass an empty array to trigger all syncs for the connection. Each element can be a string (sync name) or an object { name: string; variant: string } to target a specific variant.
string
The connection to trigger the sync for. When omitted, all connections for the integration are triggered.
object
Options for the sync run.
Returns 200 OK with an empty body on success. Node SDK signature

Start sync

POST /sync/start Resumes a paused sync schedule. Upon starting, the sync executes immediately and then continues on its configured frequency. If the schedule is already running, this has no effect.

Headers

string
required
Bearer <secret-key>

Body

string
required
The integration ID.
array
required
Array of sync names (or { name, variant } objects) to start.
string
The connection to start the sync for. When omitted, the sync is started for all applicable connections.
Returns 200 OK with an empty body on success. Node SDK signature

Pause sync

POST /sync/pause Pauses the schedule for one or more syncs. Paused syncs do not run until restarted with POST /sync/start. In-progress runs complete before the pause takes effect.

Headers

string
required
Bearer <secret-key>

Body

string
required
The integration ID.
array
required
Array of sync names (or { name, variant } objects) to pause.
string
The connection to pause the sync for. When omitted, the sync is paused for all applicable connections.
Returns 200 OK with an empty body on success. Node SDK signature

Get sync status

GET /sync/status Returns the current status of one or more syncs for a connection, including last run time, next scheduled run, checkpoint progress, and record counts.

Headers

string
required
Bearer <secret-key>

Query parameters

string
required
The integration ID.
string
required
Comma-separated list of sync names to get status for, or * to retrieve all syncs for the connection.
string
The connection to get sync status for. When omitted, status for all applicable connections is returned.

Response

object[]
required
Array of sync status objects.
Response
Node SDK signature

Update sync frequency

PUT /sync/update-connection-frequency Overrides the default sync frequency for a specific connection. Pass null for frequency to revert to the default frequency defined in nango.yaml.

Headers

string
required
Bearer <secret-key>

Body

string
required
The integration ID.
string
required
The connection to update the frequency for.
string
required
The sync name as defined in nango.yaml.
string
The sync variant to update frequency for. Omit for the default (base) variant.
string | null
required
New frequency string (for example, every 30 minutes, every 2 hours). Pass null to revert to the default.

Response

string
required
The active frequency for this sync after the update.
Response

Environment variables

List environment variables

GET /environment-variables Returns all environment variables configured for your Nango environment. These are the variables available to sync and action functions at runtime.

Headers

string
required
Bearer <secret-key>

Response

Array of environment variable objects.
string
required
The variable name.
string
required
The variable value.
Response

Sync variants

Sync variants allow you to run the same sync with different configurations for a single connection — for example, syncing issues from multiple repositories independently.
The name base is reserved and cannot be used as a variant key. Each variant operates on its own schedule and stores records separately. Query variant records by passing variant to GET /records.

Create sync variant

POST /sync/{name}/variant/{variant} Creates a new variant of an existing sync for a specific connection.

Path parameters

string
required
The sync name as defined in nango.yaml.
string
required
A unique key for this variant. Cannot be base.

Body

string
required
The integration ID.
string
required
The connection to create the variant for.
After creating a variant, fetch its records by including variant in the query:

Delete sync variant

DELETE /sync/{name}/variant/{variant} Deletes a sync variant and all records associated with it.

Path parameters

string
required
The sync name.
string
required
The variant key to delete.

Body

string
required
The integration ID.
string
required
The connection to delete the variant from.
Returns 200 OK with an empty body on success.