ComposioHQ/composio · error · ValidationError
Failed to parse auth config update data
Error message
Failed to parse auth config update data
What it means
ValidationError from AuthConfigs.update: the data argument failed AuthConfigUpdateParamsSchema before the update body is built. Different update types (e.g. custom) produce different required field sets, and the discriminated union rejects mismatches.
Solutions
- Check error.cause ZodError issues for required/invalid fields
- Match all fields required by the type discriminator you're sending
- Fetch the current auth config and derive the update payload from it
- Use the exported AuthConfigUpdateParams TS type
Example fix
// before
authConfigs.update(id, { type: 'custom', creds: 'token' } as any);
// after
authConfigs.update(id, { type: 'custom', creds: { key: 'API_KEY', value: '...' } }); Defensive patterns
Strategy: validation
Validate before calling
import { AuthConfigUpdateParamsSchema } from '@composio/core';
const check = AuthConfigUpdateParamsSchema.safeParse(data);
if (!check.success) console.error(check.error.issues); Type guard
const validUpdateData = (d: unknown): boolean => AuthConfigUpdateParamsSchema.safeParse(d).success;
Try / catch
try { await authConfigs.update(id, data); } catch (e) { if (e instanceof ValidationError && e.message.includes('auth config update')) fixFromZodIssues(e.cause); } Prevention
- Type update payloads with exported schema types
- Fetch the current auth config to model the update
When it happens
Trigger: authConfigs.update(nanoid, { type: 'custom', ... }) missing required custom fields; passing fields that belong to a different auth type; updating with a stale shape after the API contract changed.
Common situations: Updating legacy auth configs after SDK upgrades; merging partial patches that drop required discriminator fields; automated scripts reusing create payloads for updates.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Failed to parse auth config create options
- Failed to parse connected account list query
- Failed to parse manage connections config
- Expected a z.object() schema.
- experimental_subAgent() schema must be a Zod schema or JSON…
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/14caff20907e9d45.
Report an issue: GitHub.
Appendix: source
Thrown at ts/packages/core/src/models/AuthConfigs.ts:250
* apiKey: 'new-api-key-value'
* }
* });
*
* // Update a default auth config with new scopes
* const updatedConfig = await composio.authConfigs.update('auth_abc123', {
* type: 'default',
* scopes: ['read:user', 'repo']
* });
* ```
*/
async update(
nanoid: string,
data: AuthConfigUpdateParams,
requestOptions?: ComposioRequestOptions
): Promise<AuthConfigUpdateResponse> {
const parsedData = AuthConfigUpdateParamsSchema.safeParse(data);
if (parsedData.error) {
throw new ValidationError('Failed to parse auth config update data', {
cause: parsedData.error,
});
}
const updateBody =
parsedData.data.type === 'custom'
? {
type: 'custom' as const,
credentials: parsedData.data.credentials,
is_enabled_for_tool_router: parsedData.data.isEnabledForToolRouter,
tool_access_config: {
tools_for_connected_account_creation:
parsedData.data.toolAccessConfig?.toolsForConnectedAccountCreation,
tools_available_for_execution:
parsedData.data.toolAccessConfig?.toolsAvailableForExecution ??
parsedData.data.restrictToFollowingTools,
},
}
: {View on GitHub (pinned to 64b1b85502)