# Build a stream in with cherry

> From the name of an app to a stream landing its records in your warehouse, in one conversation with cherry.

cherry writes a stream in's connector from the app's own API documentation, tries it with your credential, and asks you to approve it before anything runs. You need to be an owner or admin, and you need the app's API key or sign-in to hand.

:::tip Data in a Postgres database?
You don't need cherry or a connector for it. sanda publishes a Postgres source of its own: see [stream a Postgres database](https://docs.sanda-os.com.au/streams/postgres).
:::

## Before you start

- **The app has an API**, and you can get a key for it. Most cloud apps have one, under a heading such as Settings · API, Integrations or Developers. If yours needs a sales call to switch it on, do that first.
- **The address of its API documentation**, usually called the API reference. cherry reads only sites you name in the conversation.
- **A warehouse** to land in. See [provision a warehouse](https://docs.sanda-os.com.au/warehouse/provision).

## Build the stream

:::steps
1. **Ask cherry.** Go to the **Streams in** tab of **Data · Streams** and press **Ask cherry to build one**, or tell cherry in your own words: "Bring our sales from Example POS into the warehouse every 15 minutes."
2. **Say where the documentation is.** cherry asks for the address of the API reference if you haven't given it. Paste it into the chat. If cherry knows the address, it offers it as a button: pressing the button names it, just as typing it would.
3. **Let cherry read and write.** cherry reads the documentation, then writes a connector for what you asked for. Each step shows in the conversation as it happens. If sanda refuses the connector (a host it may not use, a resource with no key), cherry reads why and fixes it.
4. **Connect your credential.** cherry opens the connector's page with a form beside the conversation and says what to paste and where the app shows it. Paste the key into the form, never into the chat, and press **Check and connect**. sanda checks it with the app before keeping it.
5. **Tell cherry it is connected.** cherry tries each thing the connector reads: the first pages, with your credential, landing nothing. It tells you what came back, and fixes the connector if something is wrong, such as a cursor that doesn't move.
6. **Approve, and start.** cherry asks for two things at once, as cards in the conversation: approving the connector, which names the hosts it may talk to and what it may do there, and starting the stream, with its schedule. Read the first card, then press **Confirm all**.
:::

The stream's first run starts straight away, and the stream is on the **Streams in** tab. Its page shows the tables it landed and every run.

## If you would rather do part of it yourself

Everything cherry does has a place on the page, for an owner or admin:

- **A connector waiting for approval** is under **Waiting for approval**. Open it to read what it may touch, try it, and press **Approve**. See [approve a connector](https://docs.sanda-os.com.au/streams/approve-a-connector).
- **A credential** is connected from the connector's row under **Connectors**: press **Connect**.
- **A stream on an approved connector** is made with **New stream in**: the connector under **Reads from**, a name, the credential, what to read, any settings the connector asks for (a location, an account), and the schedule.

## Choosing a schedule

A stream in can run as often as every 15 minutes on Standard and every 5 minutes on Enterprise, or daily or weekly at a time of day.

Data is never fresher than the app makes it. Some apps publish a sale the moment it closes; others only at the end of the day. And every run spends some of the app's API allowance and wakes your warehouse, so choose the slowest schedule your team really needs. Under the schedule, the editor says what it costs a month. See [what streams cost](https://docs.sanda-os.com.au/streams#what-streams-cost).

## When it stops working

An app changes its API, or a key is rotated, and a run fails. The stream's page says why, in the app's own words where it gave any, and lists every request the run made.

- **The app refused the credential.** The stream waits, and its credential is marked **type it again**. Press **Type it again** beside the credential under **Connectors** and paste the new key.
- **Anything else.** Press **Ask cherry to fix it** on the stream's page. cherry reads the error and the requests, writes a fixed version of the connector, tries it, and asks you to approve it. Once approved, the stream runs the new version.
