---
title: "Data Backfilling via Dataddo API"
slug: "data-backfilling-via-dataddo-api"
description: "Simply load historical data using the Dataddo API. Easily load historical data from sources to destinations with one-time requests with our comprehensive guide."
updated: 2025-08-05T18:28:47Z
published: 2025-08-05T18:28:47Z
canonical: "docs.dataddo.com/data-backfilling-via-dataddo-api"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dataddo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Backfilling via Dataddo API

**Data backfilling** refers to the process of filling gaps in data by loading data outside of scheduled times, which can be **achieved through several manual data loads** to accommodate different time periods and ensure continuity in data availability.

## Prerequisites

          
          

To manually load data via Dataddo API, you will need the following:

1. **Access token**: Obtain by [authorizing the connection](https://docs.dataddo.com/headless/docs/dataddo-api-authorization). The token will be used in consequent requests.
2. **Source ID**: Obtain by call the [GET /sources](https://headless.dataddo.com/#/source/sourceControllerList) API endpoint. The source ID will be in the field called **id**.
3. **Flow ID**: Obtain by calling the [GET /flows/by-source/{sourceId}](https://headless.dataddo.com/#/flow/flowControllerGetFlowsBySource) and using the source ID extracted above. The flow ID will be in the field called **id**.

## Extract Data and Write Loop

To automate the data backfilling process, you will need to enqueue the **source** extraction, wait until the extraction is finalised, enqueue the **flow** write action, wait until the write is finalised, repeat.

1. **Enque the extraction**:
  1. Call the [POST /sources/{id}/extraction/enqueue](https://headless.dataddo.com/#/source/sourceControllerEnqueueExtraction) endpoint.
  2. Specify the date range you want to load in the payload of the body. For example `{"date_range_expression": "7d7"}` will load data from 7 days ago. For more information, refer to the article on [dynamic date range](https://docs.dataddo.com/docs/setting-date-range#dynamic-date-range).
2. **Wait until the extraction finishes running**:
  1. You can check the status of the extraction by calling [GET /sources/{id}/status](https://headless.dataddo.com/#/source/sourceControllerStatus).
  2. The status should no longer be `running` but `live`. That means that the extraction was successfully finalised and the source is ready to extract more data.
3. **Enqueue the write action**: Call [POST /flows/{id}/write/enqueue](https://headless.dataddo.com/#/flow/flowControllerEnqueueWriteAction). You don't need to include anything in the body for the data to be written to your destination.
4. **Wait until the flow finishes writing data**: Call [GET /flows/{id}/status](https://headless.dataddo.com/#/flow/flowControllerStatus) to check the status of the write action.
5. **Repeat until all data is loaded**: Don't forget to keep adjusting the `date_range_expression` from step 1 until you load all the data.

          Warning

          

The `dateRangeExpression` parameter has been renamed to `date_range_expression`. While both versions are currently supported, `dateRangeExpression` will be deprecated soon. Make sure to update your configurations accordingly.

## Best Practices

- Always **check the status endpoint** first to avoid trying to run a source/flow that is already being processed. If you try to enqueue a source/flow that is already running, you will receive an error.
- There is a **limitation of 100 loads per dat** for each source and each flow.
- Keep in mind **rate limits of specific APIs** from which you are extracting the data.
- Use **[upsert](https://docs.dataddo.com/docs/data-storages#upsert) write mode** in your flow to prevent any duplicates.

Upsert inserts new rows and updates existing ones in the destination. By ensuring that the data in the table is updated if a matching record exists, or a new one is inserted, upsert prevents data duplication.
