Update a connected account
Updates authentication credentials and configuration for an existing connected account. Modify OAuth tokens, refresh tokens, access scopes, or API configuration settings. Specify the account by ID, or by combination of organization/user, connector, and identifier. Returns the updated account with new token expiry and status information. To replace a static credential, send authorization_details.static_auth.details with the key that matches the connection's authentication type: token for bearer, api_key for API key, or username and password for basic auth. Sending a credential for a key-based account also makes it ACTIVE, so this is how you recover an EXPIRED one.
Authorization
Authorization: Bearer $TOKEN, an access token from the client credentials grant. See Authentication.
Body
connected_accountobjectrequiredShow 2 child attributes
api_configobjectauthorization_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 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, or {"static_auth": {...}} for static credentials, holding the key the connection reads: token for bearer, api_key for API key, 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.22.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?: UpdateConnectedAccount['authorizationDetails']; organizationId?: string; userId?: string; connectedAccountId?: string; apiConfig?: UpdateConnectedAccount['apiConfig']; },): Promise<UpdateConnectedAccountResponse>Parameters
connectionNamestringidentifierstringauthorizationDetailsUpdateConnectedAccount['authorizationDetails']{ case: "oauthToken", value }, 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 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']Returns Promise<UpdateConnectedAccountResponse>.
From @scalekit-sdk/node 2.21.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