# App Integrations and Data

An app reaches the services connected in Fours, other APIs and your Fours data from its own code, and no credential is ever pasted into it.

---

## Connected Integrations

An app can use the services connected in Fours — Salesforce, HubSpot, Slack, Google, GitHub, Notion, Stripe, QuickBooks Online and the rest — without anyone pasting a credential into it. You grant it each one in the AppBuilder's **Settings → Integrations**; the app's code then calls the service through Fours, which checks the grant and adds the connection's credentials on the way out. The credentials themselves never reach the app.

Whose connections an app can use follows its ownership: an **organization** app uses your organization's connections, a **personal** app only its owner's own.

1. Open the app in the AppBuilder and go to **Settings → Integrations**.
2. Click **Add integration** and pick a service. Only services that are connected and that an app can use are listed.
3. Set its access on the card. A new grant starts at **Read-only**:

| Access | What the app's code may do with the service |
|--------|---------------------------------------------|
| **Read-only** | Read records (`GET` requests, and the few `POST` requests that only read — such as HubSpot's CRM search, which takes its filters in the request body). |
| **Edit** | Also create and change records (`POST`, `PUT` and `PATCH`). |
| **Full** | Also delete them (`DELETE`, and the calls that can delete in bulk, such as batch endpoints). |

Each card shows the name the app's code uses for the service, and **×** removes the service from the app. A change applies from the app's next call — in the preview and in the published app alike, with nothing to republish. Some calls are never allowed, whatever the level: in Salesforce, for example, running Apex, changing users and permissions, or setting a password. Some need **Full** even though they look like edits: in QuickBooks Online, voiding or deleting a record, a batch request, and any change to the company's preferences or company info.

- **Who can change it.** On an organization app, only an organization **ADMIN**; on a personal app, only its owner. Other editors see each service and its level but can't change them, and the section is hidden from anyone below **Editor** on the app.
- **Everyone who can edit the app can use these integrations through its code.** If the app is [Public](/insulin/custom-apps/publishing/#who-can-open-a-published-app), anyone on the internet can reach the code that uses them.
- **A disconnected service stays listed**, marked not connected. Its access applies again if the service is reconnected — possibly to a different account — so remove it if the app should no longer use it.
- **A connection whose sign-in no longer works can't be added.** If a service is listed as connected but its credential has expired or been revoked, **Add integration** refuses it with *… is connected, but its credential can no longer be used (expired or revoked). Reconnect it on the Settings app's Integration tab, then grant it again.* Nothing is granted. Changing the access of a service already on the app is never refused, so you can always lower it. If a granted service's credential stops working later, the app's calls to it fail with the same advice: reconnect it on the Settings app's **Integration** tab.
- **Not every connection can be used this way.** AI model providers, custom MCP servers, AWS S3, Snowflake and Microsoft Teams can't; for any other service the app needs, store an API key under **Secrets**.

The builder's assistant can ask for an integration it needs: it opens **Settings** at **Integrations** for you to grant it, and grants nothing itself.

*Diagram: The app's code calls a connected service through Fours, which checks the granted access level and adds the connection's credentials on the way out.*

- Org admin, or the owner of a personal app → Settings → Integrations (Read-only / Edit / Full): adds, changes or removes
- Settings → Integrations (Read-only / Edit / Full) → Fours (checks the grant on every call): access level
- Fours (checks the grant on every call) → The app's server code (preview or published): response
- The connected service (Salesforce, HubSpot, …) → Fours (checks the grant on every call): response
- The app's server code (preview or published) → Fours (checks the grant on every call): calls with the app's own token
- Fours (checks the grant on every call) → The connected service (Salesforce, HubSpot, …): adds the connection's credentials

## What a Published App Can Reach

A published app reaches outside services and your Fours data from its own server code:

- **Your connected integrations** — through Fours, as granted under **Settings → Integrations**; see [Connected integrations](#connected-integrations).
- **Other outside services** — an app can call another service's API with a key you store under its **Secrets**; the key reaches the live app when you publish (see [Secrets reach the app when you publish](/insulin/custom-apps/publishing/#secrets-reach-the-app-when-you-publish)).
- **Your Fours data** — through the Fours API, as described below.

The app's own database is separate from both — see [Data an app keeps for itself](/insulin/custom-apps/running/#data-an-app-keeps-for-itself).

### How a published app reaches your Fours data

Every app has an OAuth client of its own, created along with the app (or, for an app made before this changed, the first time its preview starts). The app's server code calls the Fours API with it: a published app holds the client's credentials, delivered when it is published, while the AppBuilder's preview is handed an access token for the client and never sees its secret.

- **It has the Editor role.** The Fours API treats every call the client makes as coming from an **Editor**, for organization and personal apps alike, so the app's server code can do what an Editor can do through the Fours API.
- **Console-only and Public apps both get it.** The [access setting](/insulin/custom-apps/publishing/#who-can-open-a-published-app) decides who can open the app, not what its code can reach.
- **The preview gets it only for an editor.** The access token reaches the preview of someone who can edit the app — for a personal app, its owner. Anyone else's preview has none, and a call to the Fours API there fails with a message that API access is available after the app is published.
- **It goes away with the app.** Deleting the app deletes its OAuth client.

*Diagram: The app's own OAuth client lets its published code, and an editor's preview, call the Fours API as an Editor; deleting the app deletes the client.*

- You create the app → The app's own OAuth client (Editor role): creates it
- You publish the app → Published app server code: delivers its credentials
- Published app server code → The app's own OAuth client (Editor role): client credentials
- The app's own OAuth client (Editor role) → Published app server code: access token
- Published app server code → Fours API: calls as an Editor
- The app's own OAuth client (Editor role) → The same code in an editor's AppBuilder preview: access token, via Fours
- The same code in an editor's AppBuilder preview → Fours API: calls as an Editor
- You delete the app → OAuth client deleted
