Composio V3
After a few months of development, we’re excited to release the v3 overhaul of the Composio SDK and APIs! ❤️
The new API features improved usability, enhanced stability, and better scalability. The SDKs built on top of it offer improved ergonomics and more comprehensive feature sets.
Why a new version?
Over the past few months, we have observed significant growth in usage of both our APIs and SDKs. Based on extensive feedback from our user community, we identified several key areas requiring improvement:
- More intuitive and consistent naming conventions
- Enhanced support for LLM and agentic frameworks such as OpenAI, Vercel AI SDK, and OpenAI Agents
- Improved type safety and developer experience
After carefully analyzing this feedback, we determined that implementing these improvements effectively required rebuilding the APIs and SDKs from the ground up.
Nomenclature
We have updated several key terms in the SDK and API to improve clarity and consistency. The following table summarizes these changes:
Switch to nano IDs from UUIDs
We have transitioned from UUIDs to nano IDs throughout the platform for the following reasons:
- Improved readability: UUIDs are lengthy and difficult to read
- Better usability: Easier to copy with a single double-click
- Better organization: Nano IDs allow us to distinguish between different resource types through prefixes
Note: Nano IDs are short, unique, and prefixed to indicate the resource type.
Backward compatibility
Aka, we’re not breaking anything.
We have implemented routing from all previous API endpoints to their new v3 counterparts, ensuring backward compatibility during the transition period.
You can continue using previous APIs with the following changes:
- Switch from UUIDs to nano IDs
- Update any deprecated parameters or response formats
While previous SDK versions remain functional, we will deprecate support for them in two weeks.
SDK Changes
Upgrade to the latest SDK version using the appropriate package manager:
Both SDKs now implement proper namespacing for each concept.
User ID scoping
The concept of entity_id
has been expanded and renamed to user_id
.
All operations are now scoped to a user ID, including:
- Fetching tools
- Initiating connections
- Executing tools
- Managing triggers
This change provides explicit specification of the user for whom the action is being performed. When a user may have multiple accounts (such as work and personal Gmail connections), you can use the more specific connected account ID.
Replacing ToolSets with Providers
We have deprecated “toolsets” in favor of “providers”. This change allows Composio to provide deeper standardization for tool implementation across different frameworks.
Previously, you needed to import and use a framework-specific ComposioToolSet
class:
The SDK structure is now framework-agnostic and includes the OpenAI provider out of the box:
You can now use the same tools across any framework with our unified interface, or create custom toolsets for frameworks we don’t yet support.
Read more about providers in our documentation and explore the complete list of available providers.
Fetching and filtering tools
Previously, you could filter tools by:
- Apps
- Action names (tool names)
- Tags
You could also specify an important
flag to retrieve the most important tools:
You can now filter tools by:
- Toolkits
- Tool slugs
- Limit parameter
- Search query
The important
flag has been removed. Instead, tools are returned in order of importance by default:
user_id
is now explicitly required, the check_connected_accounts
flag is no longer necessary.Fetching raw tool data
To examine the raw schema definition of a tool for understanding input/output parameters or building custom logic around tool definitions, use the following methods:
Executing tools
Tool execution remains largely unchanged, with user_id
now explicitly required.
For agentic frameworks, the tool object returned from tools.get
is now the respective framework’s native tool object. Tool call execution is handled by the agentic framework itself.
For non-agentic frameworks, Composio provides a helper function to execute tool calls.
For more information on executing tools for different frameworks, see Replacing ToolSets with Providers.
Tool Modifiers (formerly Tool Processors)
Tool processors have been renamed to tool modifiers and now provide an improved developer experience. The implementation is now available in TypeScript too! (previously Python-only).
The modifiers now leverage language-specific features to provide a more natural developer experience.
While tool processors could previously be applied during SDK initialization, tool fetching, and tool execution, we have restructured them as follows:
- Chat Completion providers: Modifiers are specified and applied during tool execution
- Agentic frameworks: Modifiers are specified and applied during tool fetching
Schema Modifiers
The following example demonstrates schema modifier usage, applicable across all providers:
Before Modifiers
The following example shows creating and using a before modifier for a Chat Completion provider. For agentic frameworks, view the complete before modifier documentation:
After Modifiers
The following example shows creating and using an after modifier for a Chat Completion provider. For agentic frameworks, view the complete after modifier documentation:
Custom Tools
The SDK continues to support custom tools. Creating tools from your methods remains possible. We recommend reviewing the detailed custom tools documentation for more information.
Due to changes in the SDK architecture, creating custom tools that use Composio’s managed authentication has been modified. In the previous SDK, you could create a custom tool as follows:
The execute tool request method handles injection of the appropriate base URL and authentication credentials for the tool:
For more information, including executing custom tools and defining custom headers and query parameters, refer to the Custom Tools documentation.
Auth configs (formerly integrations)
Integrations are now called auth configs. While the terminology has changed, the underlying concept remains the same.
Auth configs store the configuration required for authentication with a given toolkit, including OAuth developer credentials, configurable base URLs, and scopes.
Auth configs now use nano IDs instead of UUIDs:
We recommend storing auth config nano IDs in your database for connecting users to the appropriate auth configuration.
For most use cases, you will create auth configs through the dashboard, and this process remains unchanged. Read more about creating auth configs and customizing auth configs.
Creating auth configs programmatically in the previous SDK:
Creating auth configs programmatically in the current SDK:
For using custom authentication credentials, refer to the Programmatic Auth Configs documentation.
https://backend.composio.dev/api/v3/toolkits/callback
. The previous URL was https://backend.composio.dev/api/v1/auth-apps/add
.Connected accounts / User IDs
The primary change in connected accounts and user IDs is that user IDs are now a more prominent concept compared to entities in previous versions.
We have simplified the process of connecting a user to a toolkit. Instead of multiple methods and parameters for initiating a connection, both the SDK and API now require only a user_id
and auth_config_id
to initiate a connection.
This approach is more explicit and works well with the ability for developers to have multiple auth configs for a given toolkit.
Connected accounts now use nano IDs instead of UUIDs:
Previously, you might have initiated a connection like this:
The current process for initiating a connection is as follows:
Triggers
Composio continues to support listening to application events using triggers through WebSockets and webhooks.
Creating triggers
The process for creating triggers and specifying their configuration has been redesigned for improved clarity and intuitiveness.
Some triggers require configuration, such as repository names for GitHub triggers or channel names for Slack triggers. You can view the configuration for a trigger as follows:
You can then create the trigger with the appropriate configuration:
Enabling/Disabling triggers
You can enable or disable triggers through either the SDK or the dashboard. The dashboard process remains unchanged.
Managing triggers with the SDK:
Listening to triggers
We recommend listening to triggers through webhooks. The following are example routes for Next.js and FastAPI.
For development, you can also listen to triggers through the SDK.
🚧 Coming Soon
Local tools
Previously, the Python SDK included local tools. These were tools defined within the SDK and consisted of local shell and code-related tools such as “clipboard”, “sqltool”, and “shelltool”.
This feature is currently in development for both Python and TypeScript SDKs, with newly created tools built for improved agent accuracy.
Generated types
In the previous Python SDK, you could generate types for tools using the CLI:
This provided app slugs and tool slugs with IntelliSense support:
This feature is currently in development for both Python and TypeScript SDKs.
API Endpoints
The following table lists important API endpoints that have changed. You can use this reference to quickly find the new v3 API endpoint for migration: