integration object fronts 215+ third-party API endpoints through the platform’s signed proxy. For discovery, billing, and the full workflow see the external APIs guide; for the CLI catalog, see deepspace integrations.
integration
The integration client exposes four HTTP verbs. All return a typed envelope.
get takes a query-parameter object as its middle argument; the others take an optional JSON body. delete also accepts a body - the api-worker dispatches DELETE with a JSON payload when one is provided.
Endpoint names are two segments: <integration>/<endpoint> (e.g. openai/chat-completion).
- POST
- GET
- PUT
- DELETE
The most common verb. Use for actions, completions, lookups, and anything with a request body.
IntegrationResponse<T>
issues appears when the api-worker’s Zod validator rejects the body shape. Read it instead of guessing field names - or run deepspace integrations info <endpoint> to print the schema before you call.
RequestOptions
Cross-app platform context
These exports support a small set of cross-app surfaces (inbox, platform fetch). The scaffold does not include<PlatformProvider> - wrap manually if you need this surface.
usePlatform()
platformFetch prepends /platform and adds the auth header automatically. Throws if no <PlatformProvider> is mounted. subscribeInbox is the primitive useInbox() calls under the hood - apps rarely call it directly.
useInbox()
useInbox().
usePlatformWS<S>(options)
Generic platform WebSocket subscription for custom platform-side streams. S is the state shape; the constraint requires a status: ConnectionStatus field so the hook can drive reconnect UI.
OAuth endpoints
For OAuth-backed integrations (currently Google), these REST endpoints manage per-user connections. Call viafetch with the session token.
| Endpoint | Method | Purpose |
|---|---|---|
/api/integrations/status | GET | Returns connection flags for all OAuth providers |
/api/integrations/oauth/:provider/connect | GET | Initiates OAuth flow (browser navigation) |
/api/integrations/oauth/:provider/disconnect | DELETE | Revokes the current user’s stored tokens |
requiresOAuth response
When a user calls an OAuth endpoint without a connected account:
connectUrl (or call /api/integrations/oauth/google/connect directly), then retry the original call.
See also
- External APIs guide - patterns, billing routing, and discovery.
- CLI integrations command -
list/info/invoke. - AI chat guide - streamed LLM responses with tool use (uses a different pipeline).