Update a connected account
Updates an existing connected account, identified by its ID or by connector and identifier. Send authorization_details only when you import credentials from another platform as part of migrating to AgentKit. To change other settings, such as api_config, leave authorization_details out and the stored credentials stay as they are. To have the user connect again, use Get an authorization link instead. Returns the updated account.
Authorization
Authorization: Bearer $TOKEN, an access token from the client credentials grant. See Authentication.
Body
connected_accountobjectrequiredShow 2 child attributes
api_configobjectapi_config, so send every key you want to keep. Leave it out to keep the stored configuration.authorization_detailsobjectShow 4 child attributes
google_dwdobjectoauth_tokenobjectstatic_authobjectdetails. The keys depend on the connection's authentication type: token for bearer, api_key for API key, and username and password for basic auth. Providers that need several API key headers take one key per header.Show 1 child attribute
detailsobjectrequiredtoken for bearer, api_key for API key (or, for a connector that sends several headers, one value per header, keyed by the header name), or username and password for basic auth. Add domain or version here when the provider needs them.Show 4 child attributes
api_keystringpasswordstringtokenstringusernamestringtrusted_idpobjectdb_user. Responses include access_key_id and expiry, never the secret key or session token.connectorstringidstringidentifierstringorganization_idstringidentifier, such as a Scalekit organization ID. Ignored when identifier is set.user_idstringorganization_id, keys the account to one user in that organization. Ignored when identifier is set.scalekit_client.actions.update_connected_account
Update an existing connected account
scalekit_client.actions.update_connected_account( connection_name: str, identifier: str, authorization_details: Optional[Dict[str, Any]] = None, organization_id: Optional[str] = None, user_id: Optional[str] = None, connected_account_id: Optional[str] = None, api_config: Optional[Dict[str, Any]] = None,) -> UpdateConnectedAccountResponseParameters
connection_namestrrequiredidentifierstrrequiredauthorization_detailsOptional[Dict[str, Any]]{"oauth_token": {...}} for OAuth tokens (access_token, refresh_token, and optionally expires_at, when the access token expires, as a datetime in UTC, such as datetime.fromisoformat("2026-11-12T07:18:56+00:00")), or {"static_auth": {...}} for static credentials, holding the key the connection reads: token for bearer, api_key for API key (or, for a connector that sends several headers, one value per header, keyed by the header name), or username and password for basic auth. Unlike the REST body, static_auth has no details level.organization_idOptional[str]user_idOptional[str]connected_account_idOptional[str]api_configOptional[Dict[str, Any]]Returns UpdateConnectedAccountResponse: The updated connected account details
From scalekit-sdk-python 2.25.0.
Also called by scalekit_client.actions.get_or_create_connected_account.
scalekit.actions.updateConnectedAccount
Update an existing connected account. Requires either connectedAccountId or both connectionName + identifier.
scalekit.actions.updateConnectedAccount( params: { connectionName?: string; identifier?: string; authorizationDetails?: MessageInitShape<typeof UpdateConnectedAccountSchema>['authorizationDetails']; organizationId?: string; userId?: string; connectedAccountId?: string; apiConfig?: UpdateConnectedAccount['apiConfig']; },): Promise<UpdateConnectedAccountResponse>Parameters
connectionNamestringidentifierstringauthorizationDetailsMessageInitShape<typeof UpdateConnectedAccountSchema>['authorizationDetails']{ case: "oauthToken", value } (set value.expiresAt to when the access token expires, in UTC, such as timestampFromDate(new Date("2026-11-12T07:18:56Z")) with timestampFromDate from @bufbuild/protobuf/wkt), or static credentials as { case: "staticAuth", value }, where value.details holds the key the connection reads: token for bearer, api_key for API key (or, for a connector that sends several headers, one value per header, keyed by the header name), or username and password for basic auth.organizationIdstringidentifier, such as a Scalekit organization ID. Ignored when identifier is set.userIdstringorganization_id, keys the account to one user in that organization. Ignored when identifier is set.connectedAccountIdstringapiConfigUpdateConnectedAccount['apiConfig']api_config, so send every key you want to keep. Leave it out to keep the stored configuration.Returns Promise<UpdateConnectedAccountResponse>.
From @scalekit-sdk/node 2.22.0.
Also called by scalekit.actions.getOrCreateConnectedAccount.
Response 200
connected_accountobjectShow 13 child attributes
api_configobjectauthorization_detailsobjectoauth_token, static_auth, google_dwd or trusted_idp.Show 4 child attributes
google_dwdobjectoauth_tokenobjectstatic_authobjectdetails. The keys depend on the connection's authentication type: token for bearer, api_key for API key, and username and password for basic auth. Providers that need several API key headers take one key per header.trusted_idpobjectdb_user. Responses include access_key_id and expiry, never the secret key or session token.authorization_typestring (enum)OAUTHAPI_KEYBASIC_AUTHBEARER_TOKENCUSTOMBASICOAUTH_M2MTRELLO_OAUTH1GOOGLE_DWDTRUSTED_IDPSMART_FHIRNO_AUTHconnection_idstringconnectorstringidstringidentifierstringis_org_wide_credentialbooleanfalse for a user's own account.last_used_atstringproviderstringGMAIL or SLACK.statusstring (enum)ACTIVEEXPIREDPENDING_AUTHPENDING_VERIFICATIONDISCONNECTEDtoken_expires_atstringupdated_atstringErrors
Every error has the same body: code, message and details. See Errors and rate limits.
400Invalid request - missing required fields, invalid authorization details, or validation failed401Authentication required - missing or invalid access token404Connected account not found - the specified account does not exist