# Automatic syncing

# Automatic syncing

Costfluent collects cost data from your connected data sources on its own schedule, several times a
day. Every one of those collections is a call into your cloud account: a Cost Explorer query on AWS,
a cost details report on Azure, a query against your billing export on Google Cloud. Some of those
calls are metered by the provider and billed to you.

Automatic syncing is the switch over that schedule. It is on for every workspace until somebody
turns it off.

Open **Settings**, then **Workspaces**, select the workspace, and use the **Automatic syncing**
card.

## What stops

The recurring collection, and the credential check that runs beside it. Costfluent stops calling
the data sources this workspace uses on its own initiative, so the calls stop appearing in your
provider's API metering.

## What keeps working

- Every cost record already collected. Nothing is deleted, hidden or re-scoped.
- Cost reports, dashboards, budgets, alerts and the Public API, over the data that was collected
  before syncing was turned off.
- **Sync now** on a data source. A collection somebody asks for explicitly still runs, which is how
  you bring a paused workspace up to date without turning the schedule back on.

New cost data stops arriving until you turn automatic syncing back on, so figures for the days in
between fill in on the next collection rather than appearing as zero.

## Data sources shared with another workspace

A data source is connected once for the organization and then enabled in the workspaces that use
it. Costfluent stops calling a source when no workspace that uses it wants automatic syncing, so a
source another workspace still syncs keeps updating — for that workspace and for yours, since the
cost data is the same data.

A data source no workspace has enabled yet keeps syncing, because no workspace has said anything
about it.

## Public API

The setting is part of the workspace object. See [Authentication](/api/authentication) for tokens,
and the [API Reference](/api) for the full schemas.

Read whether a workspace syncs automatically:

```bash
curl -H "Authorization: Bearer $COSTFLUENT_API_TOKEN" \
  https://api.costfluent.com/api/v1/workspaces/wsp_example
```

Turn automatic syncing off:

```bash
curl -X PUT \
  -H "Authorization: Bearer $COSTFLUENT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enableAutomaticSyncing": false}' \
  https://api.costfluent.com/api/v1/workspaces/wsp_example
```

Collect on demand while it is off:

```bash
curl -X POST \
  -H "Authorization: Bearer $COSTFLUENT_API_TOKEN" \
  https://api.costfluent.com/api/v1/providers/prv_example/sync
```
