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

# SDK: Integrations

> Configure, test, install, and remove native integrations

Use `client.integrations` for AgentFlow's manifest-backed native integrations.

<CodeGroup>
  ```python Python theme={null}
  integrations = await client.integrations.list()
  integration = await client.integrations.retrieve(integrations[0].id)

  configured = await client.integrations.configure(
      integration.id,
      credentials={"api_key": api_key},
  )
  probe = await client.integrations.test(integration.id)
  if not probe.ok:
      raise RuntimeError(probe.message)
  ```

  ```ts TypeScript theme={null}
  const integrations = await client.integrations.list();
  const integration = await client.integrations.retrieve(integrations[0].id);

  const configured = await client.integrations.configure(integration.id, {
    credentials: { api_key: apiKey },
  });
  const probe = await client.integrations.test(integration.id);
  if (!probe.ok) {
    throw new Error(String(probe.message));
  }
  ```
</CodeGroup>

Read `integration.fields` to discover required credential field IDs; do not hard-code a field name from another integration. `configure(...)` replaces the full required set and write responses never include plaintext secret values.

`test(...)` performs a real provider request. It may incur provider rate limits even though AgentFlow chooses the cheapest authenticated probe. The result is recorded when a tenant integration row exists.

Choose the lifecycle from `integration.credential_mode`:

| Mode                         | SDK operations                                                                                                                    |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `external_api_key`           | `configure(...)`, `test(...)`, and `remove(...)`; do not call `install(...)`.                                                     |
| `managed_key_pair`           | `install(...)` converges the built-in capabilities. The current Snowflake integration does not accept generic tenant credentials. |
| `managed_oauth_installation` | Use the provider-specific admin/OAuth API. Slack rejects the generic configure, install, and remove operations.                   |

Remove tenant credentials when the integration should no longer use tenant overrides:

<CodeGroup>
  ```python Python theme={null}
  removed = await client.integrations.remove(integration.id)
  ```

  ```ts TypeScript theme={null}
  const removed = await client.integrations.remove(integration.id);
  ```
</CodeGroup>

Configuration, install, and removal require tenant-admin permission. Generic removal is only available for `external_api_key` integrations and soft-deletes the tenant override; it does not uninstall native tools or agents. A deployment-level fallback credential may remain available afterward, and the returned integration status tells you which source is active.
