updateSiteAgent
Client function: patch an existing site agent persona — only the fields you send change.
import { updateSiteAgent } from 'flowstack-sdk'Non-React client function. PATCH /api/v1/sites/{siteId}/agents/{name}. The safe counterpart to upsertSiteAgent: unsent fields are preserved. The persona name is the URL key and cannot be patched.
Signature
updateSiteAgent(credentials, siteId, name, patch, config?): Promise<ApiResponse<{ site_id: string; agent: SiteAgent }>>Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The app owner's credentials (owner-scoped JWT). |
siteId | string | required | The site/app id. |
name | string | required | The persona to patch (URL-encoded into the path). |
patch | Partial<Omit<SiteAgentInput, 'name'>> | required | Only the fields to change. name is excluded by the type — rename is not supported. |
config | FlowstackClientConfig | — | Client config (baseUrl, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<{ site_id: string; agent: SiteAgent }>> | The persona after the patch. |
Examples
Pin a model
await updateSiteAgent(credentials, siteId, 'coach', { model: 'claude-sonnet-4-6' });Clear the model pin
// Empty string clears the pin — omitting `model` would leave it in place.
await updateSiteAgent(credentials, siteId, 'coach', { model: '' });WarningOwner/management operation — call it with the app owner's credentials from a builder/dashboard/server context, not from inside the generated app's end-user runtime.
builtAppSafe is false.WarningTo clear the builder-pinned
model you must send model: '' explicitly. Omitting the field is a no-op under patch semantics, so there is no way to unpin by leaving it out.See also
upsertSiteAgent · listSiteAgents · SiteAgent
Source: src/api/client.ts (Site Ops, P0-156; `model` pin P0-181) · Also available in llms-full.txt and registry.json.