@composio/core 0.18.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CustomTool-VRfWzMix.d.mts → CustomTool-B3m-188G.d.mts} +1 -1
- package/dist/{CustomTool-Bz0f52QR.mjs → CustomTool-fYEFjSLM.mjs} +1 -1
- package/dist/{FileModifierErrors-CwB-Inm9.mjs → FileModifierErrors-CdGSABoq.mjs} +1 -1
- package/dist/{FileToolModifier.utils.neutral-D_YkHwZP.mjs → FileToolModifier.utils.neutral-DWFpnsj2.mjs} +4 -2
- package/dist/{SsrfErrors-xhdVE4yw.mjs → SsrfErrors-DiQldIdC.mjs} +32 -17
- package/dist/{Telemetry-Dw9W5RSp.mjs → Telemetry-JRJJYS4I.mjs} +2 -2
- package/dist/{cancellation-P5YUlcfz.mjs → cancellation-Dwa9lGHA.mjs} +7 -5
- package/dist/{composio-Cb3d1jFe.d.mts → composio-B36OXii1.d.mts} +3017 -144
- package/dist/{customTool.types-B6ej_8XZ.d.mts → customTool.types-C436M_D0.d.mts} +525 -101
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +8 -15
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +101 -18
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +123 -0
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +9 -2
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +7 -0
- package/dist/docs/reference/sdk-reference/typescript/keyring.mdx +56 -0
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +78 -0
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +15 -15
- package/dist/docs/reference/sdk-reference/typescript/meta.json +8 -1
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +117 -24
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +24 -10
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +151 -14
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +50 -40
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +26 -25
- package/dist/docs/reference/sdk-reference/typescript/usage.mdx +78 -0
- package/dist/docs/reference/sdk-reference/typescript/webhook-endpoints.mdx +162 -0
- package/dist/docs/reference/sdk-reference/typescript/webhook-subscriptions.mdx +218 -0
- package/dist/docs/reference/sdk-reference/typescript/webhooks.mdx +20 -0
- package/dist/{errors-Ue9wMrPK.mjs → errors-D_A4b2c2.mjs} +143 -4
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/{fileUtils.node-KE5Fa-af.mjs → fileUtils.node-DNLhLg0W.mjs} +8 -6
- package/dist/index.d.mts +418 -146
- package/dist/index.mjs +2728 -349
- package/dist/models/Files.node.d.mts +2 -3
- package/dist/models/Files.node.mjs +2 -2
- package/dist/models/Files.workerd.d.mts +2 -3
- package/dist/platform/node.d.mts +2 -3
- package/dist/platform/workerd.d.mts +2 -3
- package/dist/{sensitiveFileUploadPaths-QN7w4n8v.mjs → sensitiveFileUploadPaths-BlLp-Yo2.mjs} +10 -7
- package/dist/{ssrfGuard.node-BLX6b-Rf.mjs → ssrfGuard.node-BZ270bcu.mjs} +104 -14
- package/dist/{types-CGdgK442.d.mts → types-Br3GBya5.d.mts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +3 -4
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +3 -4
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +3 -4
- package/dist/utils/modifiers/FileToolModifier.node.mjs +6 -6
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +3 -4
- package/dist/utils/modifiers/FileToolModifier.workerd.mjs +1 -1
- package/dist/utils/ssrfGuard.node.d.mts +19 -10
- package/dist/utils/ssrfGuard.node.mjs +1 -1
- package/dist/utils/ssrfGuard.workerd.d.mts +12 -4
- package/dist/utils/ssrfGuard.workerd.mjs +2 -2
- package/package.json +9 -9
- package/src/composio.ts +207 -10
- package/src/errors/ConnectedAccountsErrors.ts +47 -0
- package/src/errors/SDKErrors.ts +52 -0
- package/src/errors/ToolErrors.ts +24 -0
- package/src/errors/ToolRouterErrors.ts +57 -0
- package/src/errors/index.ts +3 -0
- package/src/index.ts +15 -0
- package/src/lib/toolRouterMcp.ts +132 -0
- package/src/lib/toolRouterParams.ts +116 -29
- package/src/models/ConnectedAccounts.ts +118 -2
- package/src/models/CustomToolkits.ts +169 -0
- package/src/models/Experimental.ts +27 -0
- package/src/models/Keyring.ts +65 -0
- package/src/models/Logs.ts +101 -0
- package/src/models/MCP.ts +29 -15
- package/src/models/ToolRouter.ts +43 -14
- package/src/models/ToolRouterSession.ts +224 -16
- package/src/models/Toolkits.ts +181 -2
- package/src/models/Tools.ts +58 -26
- package/src/models/Triggers.ts +10 -90
- package/src/models/Usage.ts +119 -0
- package/src/models/Webhooks.ts +520 -0
- package/src/services/pusher/Pusher.ts +46 -16
- package/src/types/authConfigs.types.ts +2 -0
- package/src/types/connectedAccounts.types.ts +54 -0
- package/src/types/customToolkits.types.ts +102 -0
- package/src/types/keyring.types.ts +32 -0
- package/src/types/logs.types.ts +108 -0
- package/src/types/toolRouter.types.ts +259 -14
- package/src/types/toolkit.types.ts +161 -0
- package/src/types/usage.types.ts +81 -0
- package/src/types/webhooks.types.ts +143 -0
- package/src/utils/constants.ts +1 -5
- package/src/utils/jsonSchema.ts +4 -1
- package/src/utils/logger.ts +39 -7
- package/src/utils/sdk.ts +385 -22
- package/src/utils/ssrfGuard.node.ts +127 -13
- package/src/utils/ssrfGuard.workerd.ts +11 -1
- package/src/utils/transformers/connectedAccounts.ts +37 -2
- package/src/utils/transformers/customToolkits.ts +98 -0
- package/src/utils/transformers/keyring.ts +24 -0
- package/src/utils/transformers/logs.ts +85 -0
- package/src/utils/transformers/toolkits.ts +183 -3
- package/src/utils/transformers/triggers.ts +2 -2
- package/src/utils/transformers/usage.ts +77 -0
- package/src/utils/transformers/webhooks.ts +139 -0
|
@@ -26,7 +26,7 @@ the execution will throw a `ComposioToolVersionRequiredError` unless `dangerousl
|
|
|
26
26
|
This helps prevent unexpected behavior when new toolkit versions are released.
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
|
-
async execute(slug: string, body:
|
|
29
|
+
async execute(slug: string, body: { allowTracing?: boolean; arguments?: Record<string, unknown>; connectedAccountId?: string; customAuthParams?: { baseURL?: string; body?: Record<string, unknown>; parameters: { in: 'query' | 'header'; name: string; value: string | number }[] }; customConnectionData?: { authScheme: 'OAUTH2'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: { access_token?: ...; scope?: ... }; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: { access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'API_KEY'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'OAUTH1'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'NO_AUTH'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object }; dangerouslySkipVersionCheck?: boolean; text?: string; userId?: string; version?: string }, options?: { afterExecute?: afterExecuteModifier; beforeExecute?: beforeExecuteModifier } & BeforeFileUploadHook & ComposioRequestOptions): Promise<...>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
**Parameters**
|
|
@@ -34,16 +34,20 @@ async execute(slug: string, body: ToolExecuteParams, options?: ExecuteToolModifi
|
|
|
34
34
|
| Name | Type | Description |
|
|
35
35
|
|------|------|-------------|
|
|
36
36
|
| `slug` | `string` | The slug/ID of the tool to be executed |
|
|
37
|
-
| `body` | `
|
|
38
|
-
| `options?` |
|
|
37
|
+
| `body` | `\{ allowTracing?: boolean; arguments?: Record<string, unknown>; connectedAccountId?: string; customAuthParams?: \{ baseURL?: string; body?: Record<string, unknown>; parameters: \{ in: 'query' \| 'header'; name: string; value: string \| number \}[] \}; customConnectionData?: \{ authScheme: 'OAUTH2'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: \{ access_token?: ...; scope?: ... \}; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: \{ access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'API_KEY'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'OAUTH1'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'NO_AUTH'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \}; dangerouslySkipVersionCheck?: boolean; text?: string; userId?: string; version?: string \}` | The parameters to be passed to the tool |
|
|
38
|
+
| `options?` | `\{ afterExecute?: afterExecuteModifier; beforeExecute?: beforeExecuteModifier \} & BeforeFileUploadHook & ComposioRequestOptions` | Optional modifiers and request options |
|
|
39
39
|
|
|
40
40
|
**Returns**
|
|
41
41
|
|
|
42
|
-
`Promise
|
|
42
|
+
`Promise<...>` — The response from the tool execution
|
|
43
43
|
|
|
44
44
|
**Example**
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
|
+
// Look up the tool's current version once, then pin that string in your code or config
|
|
48
|
+
const { version } = await composio.tools.getRawComposioToolBySlug('GITHUB_GET_REPOS');
|
|
49
|
+
console.log(version); // e.g. '20250909_00'
|
|
50
|
+
|
|
47
51
|
const result = await composio.tools.execute('GITHUB_GET_REPOS', {
|
|
48
52
|
userId: 'default',
|
|
49
53
|
version: '20250909_00',
|
|
@@ -100,7 +104,7 @@ const result = await composio.tools.execute('HACKERNEWS_GET_FRONTPAGE', {
|
|
|
100
104
|
Executes a tool based on a tool router session.
|
|
101
105
|
|
|
102
106
|
```typescript
|
|
103
|
-
async executeSessionTool(toolSlug: string, body:
|
|
107
|
+
async executeSessionTool(toolSlug: string, body: { arguments?: Record<string, unknown>; sessionId: string }, modifiers?: SessionExecuteMetaModifiers, tool?: { availableVersions?: string[]; description?: string; inputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; scopes?: string[]; slug: string; tags?: string[]; toolkit?: { logo?: string; name: string; slug: string }; version?: string }, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise<...>
|
|
104
108
|
```
|
|
105
109
|
|
|
106
110
|
**Parameters**
|
|
@@ -108,15 +112,15 @@ async executeSessionTool(toolSlug: string, body: ToolExecuteMetaParams, modifier
|
|
|
108
112
|
| Name | Type | Description |
|
|
109
113
|
|------|------|-------------|
|
|
110
114
|
| `toolSlug` | `string` | The slug of the tool to execute |
|
|
111
|
-
| `body` | `
|
|
115
|
+
| `body` | `\{ arguments?: Record<string, unknown>; sessionId: string \}` | The execution parameters |
|
|
112
116
|
| `modifiers?` | `SessionExecuteMetaModifiers` | The modifiers to apply to the tool |
|
|
113
|
-
| `tool?` | `
|
|
117
|
+
| `tool?` | `\{ availableVersions?: string[]; description?: string; inputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; scopes?: string[]; slug: string; tags?: string[]; toolkit?: \{ logo?: string; name: string; slug: string \}; version?: string \}` | Optional tool schema used to resolve toolkit metadata for modifiers |
|
|
114
118
|
| `options?` | `ToolRouterSessionExecuteOptions` | |
|
|
115
119
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
116
120
|
|
|
117
121
|
**Returns**
|
|
118
122
|
|
|
119
|
-
`Promise
|
|
123
|
+
`Promise<...>` — The response from the tool execution
|
|
120
124
|
|
|
121
125
|
---
|
|
122
126
|
|
|
@@ -128,7 +132,7 @@ This method fetches the tools from the Composio API and wraps them using the pro
|
|
|
128
132
|
**Overload 1**
|
|
129
133
|
|
|
130
134
|
```typescript
|
|
131
|
-
async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType
|
|
135
|
+
async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType>
|
|
132
136
|
```
|
|
133
137
|
|
|
134
138
|
**Parameters**
|
|
@@ -141,12 +145,12 @@ async get(userId: string, filters: ToolListParams, options?: ProviderOptions & C
|
|
|
141
145
|
|
|
142
146
|
**Returns**
|
|
143
147
|
|
|
144
|
-
`Promise<ReturnType
|
|
148
|
+
`Promise<ReturnType>` — The wrapped tools collection
|
|
145
149
|
|
|
146
150
|
**Overload 2**
|
|
147
151
|
|
|
148
152
|
```typescript
|
|
149
|
-
async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType
|
|
153
|
+
async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType>
|
|
150
154
|
```
|
|
151
155
|
|
|
152
156
|
**Parameters**
|
|
@@ -159,7 +163,7 @@ async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequ
|
|
|
159
163
|
|
|
160
164
|
**Returns**
|
|
161
165
|
|
|
162
|
-
`Promise<ReturnType
|
|
166
|
+
`Promise<ReturnType>` — The wrapped tool
|
|
163
167
|
|
|
164
168
|
**Example**
|
|
165
169
|
|
|
@@ -180,9 +184,10 @@ const emailTools = await composio.tools.get('default', {
|
|
|
180
184
|
|
|
181
185
|
### getInput()
|
|
182
186
|
|
|
183
|
-
|
|
187
|
+
Generates arguments for a tool from a natural-language description of the task.
|
|
184
188
|
|
|
185
|
-
|
|
189
|
+
Composio uses an LLM to fill the tool's input parameters from `text`. Review the
|
|
190
|
+
generated arguments before passing them to `tools.execute()`.
|
|
186
191
|
|
|
187
192
|
```typescript
|
|
188
193
|
async getInput(slug: string, body: ToolGetInputParams, requestOptions?: ComposioRequestOptions): Promise<ToolGetInputResponse>
|
|
@@ -192,22 +197,23 @@ async getInput(slug: string, body: ToolGetInputParams, requestOptions?: Composio
|
|
|
192
197
|
|
|
193
198
|
| Name | Type | Description |
|
|
194
199
|
|------|------|-------------|
|
|
195
|
-
| `slug` | `string` | The
|
|
196
|
-
| `body` | `ToolGetInputParams` | The
|
|
200
|
+
| `slug` | `string` | The slug of the tool to generate arguments for |
|
|
201
|
+
| `body` | `ToolGetInputParams` | The generation request |
|
|
197
202
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
198
203
|
|
|
199
204
|
**Returns**
|
|
200
205
|
|
|
201
|
-
`Promise<ToolGetInputResponse>` — The
|
|
206
|
+
`Promise<ToolGetInputResponse>` — The generated `arguments`, or an `error` when generation fails
|
|
202
207
|
|
|
203
208
|
**Example**
|
|
204
209
|
|
|
205
210
|
```typescript
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
211
|
+
const { arguments: args, error } = await composio.tools.getInput('GITHUB_CREATE_ISSUE', {
|
|
212
|
+
text: 'Open an issue in composiohq/composio titled "Docs typo" describing the broken link',
|
|
213
|
+
version: '20250909_00',
|
|
209
214
|
});
|
|
210
|
-
|
|
215
|
+
if (error) throw new Error(error);
|
|
216
|
+
console.log(args); // { owner: 'composiohq', repo: 'composio', title: 'Docs typo', ... }
|
|
211
217
|
```
|
|
212
218
|
|
|
213
219
|
---
|
|
@@ -224,7 +230,7 @@ Tool Router session, then use `session.tools()`, `session.customTools()`, or
|
|
|
224
230
|
`session.execute()`.
|
|
225
231
|
|
|
226
232
|
```typescript
|
|
227
|
-
async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<
|
|
233
|
+
async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<{ availableVersions?: string[]; description?: string; inputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; scopes?: string[]; slug: string; tags?: string[]; toolkit?: { logo?: string; name: string; slug: string }; version?: string }>
|
|
228
234
|
```
|
|
229
235
|
|
|
230
236
|
**Parameters**
|
|
@@ -237,7 +243,7 @@ async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, req
|
|
|
237
243
|
|
|
238
244
|
**Returns**
|
|
239
245
|
|
|
240
|
-
`Promise<
|
|
246
|
+
`Promise<\{ availableVersions?: string[]; description?: string; inputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; scopes?: string[]; slug: string; tags?: string[]; toolkit?: \{ logo?: string; name: string; slug: string \}; version?: string \}>` — The requested tool with its complete schema and metadata
|
|
241
247
|
|
|
242
248
|
**Example**
|
|
243
249
|
|
|
@@ -390,7 +396,7 @@ This method is mostly used by the CLI to get the list of tools.
|
|
|
390
396
|
No filtering is done on the tools, the list is cached in the backend, no further optimization is required.
|
|
391
397
|
|
|
392
398
|
```typescript
|
|
393
|
-
async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<
|
|
399
|
+
async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<string[]>
|
|
394
400
|
```
|
|
395
401
|
|
|
396
402
|
**Parameters**
|
|
@@ -401,7 +407,7 @@ async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<ToolRetriev
|
|
|
401
407
|
|
|
402
408
|
**Returns**
|
|
403
409
|
|
|
404
|
-
`Promise<
|
|
410
|
+
`Promise<string[]>` — The complete list of all available tools with their metadata
|
|
405
411
|
|
|
406
412
|
**Example**
|
|
407
413
|
|
|
@@ -415,39 +421,43 @@ console.log(toolsEnum.items);
|
|
|
415
421
|
|
|
416
422
|
### proxyExecute()
|
|
417
423
|
|
|
418
|
-
|
|
424
|
+
Sends an HTTP request to a toolkit's API, authenticated as a connected account.
|
|
425
|
+
|
|
426
|
+
Use it to call an endpoint that no predefined tool covers. Composio injects the
|
|
427
|
+
connected account's credentials on the server side.
|
|
419
428
|
|
|
420
|
-
|
|
421
|
-
|
|
429
|
+
A relative `endpoint` is appended to the toolkit's base URL, and that base URL can
|
|
430
|
+
already include a path. Google Calendar's base URL is
|
|
431
|
+
`https://www.googleapis.com/calendar/v3`, so pass `/users/me/calendarList`, not
|
|
432
|
+
`/calendar/v3/users/me/calendarList` (which resolves to `/calendar/v3/calendar/v3/...`
|
|
433
|
+
and returns a 404 from Google). An absolute URL on the same domain is sent as-is.
|
|
422
434
|
|
|
423
435
|
```typescript
|
|
424
|
-
async proxyExecute(body:
|
|
436
|
+
async proxyExecute(body: { body?: unknown; connectedAccountId?: string; customConnectionData?: { authScheme: 'OAUTH2'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: { access_token?: ...; scope?: ... }; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: { access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'API_KEY'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'OAUTH1'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'NO_AUTH'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object }; endpoint: string; method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; parameters?: { in: 'query' | 'header'; name: string; value: string | number }[] }, requestOptions?: ComposioRequestOptions): Promise<ToolProxyResponse>
|
|
425
437
|
```
|
|
426
438
|
|
|
427
439
|
**Parameters**
|
|
428
440
|
|
|
429
441
|
| Name | Type | Description |
|
|
430
442
|
|------|------|-------------|
|
|
431
|
-
| `body` |
|
|
443
|
+
| `body` | `\{ body?: unknown; connectedAccountId?: string; customConnectionData?: \{ authScheme: 'OAUTH2'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: \{ access_token?: ...; scope?: ... \}; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: \{ access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'API_KEY'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'OAUTH1'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'NO_AUTH'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \}; endpoint: string; method: 'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH'; parameters?: \{ in: 'query' \| 'header'; name: string; value: string \| number \}[] \}` | The proxy request |
|
|
432
444
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
433
445
|
|
|
434
446
|
**Returns**
|
|
435
447
|
|
|
436
|
-
`Promise<ToolProxyResponse>` — The
|
|
448
|
+
`Promise<ToolProxyResponse>` — The upstream status, headers, and parsed body
|
|
437
449
|
|
|
438
450
|
**Example**
|
|
439
451
|
|
|
440
452
|
```typescript
|
|
441
|
-
//
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
method: 'GET'
|
|
448
|
-
}
|
|
453
|
+
// Google Calendar's base URL is https://www.googleapis.com/calendar/v3
|
|
454
|
+
const { status, data } = await composio.tools.proxyExecute({
|
|
455
|
+
endpoint: '/users/me/calendarList',
|
|
456
|
+
method: 'GET',
|
|
457
|
+
connectedAccountId: 'ca_...',
|
|
458
|
+
parameters: [{ in: 'query', name: 'maxResults', value: 10 }],
|
|
449
459
|
});
|
|
450
|
-
console.log(
|
|
460
|
+
console.log(status, data);
|
|
451
461
|
```
|
|
452
462
|
|
|
453
463
|
---
|
|
@@ -20,7 +20,7 @@ Create a new trigger instance for a user
|
|
|
20
20
|
If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
async create(userId: string, slug: string, body?:
|
|
23
|
+
async create(userId: string, slug: string, body?: { connectedAccountId?: string; triggerConfig?: Record<string, unknown> }, requestOptions?: ComposioRequestOptions): Promise<{ triggerId: string }>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
**Parameters**
|
|
@@ -29,12 +29,12 @@ async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, r
|
|
|
29
29
|
|------|------|-------------|
|
|
30
30
|
| `userId` | `string` | The user id of the trigger instance |
|
|
31
31
|
| `slug` | `string` | The slug of the trigger instance |
|
|
32
|
-
| `body?` | `
|
|
32
|
+
| `body?` | `\{ connectedAccountId?: string; triggerConfig?: Record<string, unknown> \}` | The parameters to create the trigger instance |
|
|
33
33
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
34
34
|
|
|
35
35
|
**Returns**
|
|
36
36
|
|
|
37
|
-
`Promise
|
|
37
|
+
`Promise<\{ triggerId: string \}>` — The created trigger instance
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -43,7 +43,7 @@ async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, r
|
|
|
43
43
|
Delete a trigger instance
|
|
44
44
|
|
|
45
45
|
```typescript
|
|
46
|
-
async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
46
|
+
async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<{ triggerId: string }>
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
**Parameters**
|
|
@@ -55,7 +55,7 @@ async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promis
|
|
|
55
55
|
|
|
56
56
|
**Returns**
|
|
57
57
|
|
|
58
|
-
`Promise
|
|
58
|
+
`Promise<\{ triggerId: string \}>`
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
@@ -107,7 +107,7 @@ Retrieve a trigger type by its slug for the provided version of the app
|
|
|
107
107
|
Use the global toolkit versions param when initializing composio to pass a toolkitversion
|
|
108
108
|
|
|
109
109
|
```typescript
|
|
110
|
-
async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
110
|
+
async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<{ config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: { logo: string; name: string; slug: string }; version?: string }>
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
**Parameters**
|
|
@@ -119,7 +119,7 @@ async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<Tr
|
|
|
119
119
|
|
|
120
120
|
**Returns**
|
|
121
121
|
|
|
122
|
-
`Promise<
|
|
122
|
+
`Promise<\{ config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: \{ logo: string; name: string; slug: string \}; version?: string \}>` — The trigger type object
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
@@ -128,19 +128,19 @@ async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<Tr
|
|
|
128
128
|
Fetch list of all the active triggers
|
|
129
129
|
|
|
130
130
|
```typescript
|
|
131
|
-
async listActive(query?:
|
|
131
|
+
async listActive(query?: { authConfigIds?: string[] | null; connectedAccountIds?: string[] | null; cursor?: string; limit?: number; showDisabled?: boolean | null; triggerIds?: string[] | null; triggerNames?: string[] | null }, requestOptions?: ComposioRequestOptions): Promise<{ items: { connectedAccountId: string; disabledAt: string | null; id: string; state: Record<string, unknown>; triggerConfig: Record<string, unknown>; triggerData?: string; triggerName: string; updatedAt: string; uuid?: string }[]; nextCursor: string | null; totalPages: number }>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
**Parameters**
|
|
135
135
|
|
|
136
136
|
| Name | Type | Description |
|
|
137
137
|
|------|------|-------------|
|
|
138
|
-
| `query?` | `
|
|
138
|
+
| `query?` | `\{ authConfigIds?: string[] \| null; connectedAccountIds?: string[] \| null; cursor?: string; limit?: number; showDisabled?: boolean \| null; triggerIds?: string[] \| null; triggerNames?: string[] \| null \}` | The query parameters to filter the trigger instances |
|
|
139
139
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
140
140
|
|
|
141
141
|
**Returns**
|
|
142
142
|
|
|
143
|
-
`Promise<
|
|
143
|
+
`Promise<\{ items: \{ connectedAccountId: string; disabledAt: string \| null; id: string; state: Record<string, unknown>; triggerConfig: Record<string, unknown>; triggerData?: string; triggerName: string; updatedAt: string; uuid?: string \}[]; nextCursor: string \| null; totalPages: number \}>` — List of trigger instances
|
|
144
144
|
|
|
145
145
|
**Example**
|
|
146
146
|
|
|
@@ -160,7 +160,7 @@ Fetches the list of all the available trigger enums
|
|
|
160
160
|
This method is used by the CLI where filters are not required.
|
|
161
161
|
|
|
162
162
|
```typescript
|
|
163
|
-
async listEnum(requestOptions?: ComposioRequestOptions): Promise<
|
|
163
|
+
async listEnum(requestOptions?: ComposioRequestOptions): Promise<string[]>
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
**Parameters**
|
|
@@ -171,7 +171,7 @@ async listEnum(requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRet
|
|
|
171
171
|
|
|
172
172
|
**Returns**
|
|
173
173
|
|
|
174
|
-
`Promise<
|
|
174
|
+
`Promise<string[]>`
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
@@ -180,19 +180,19 @@ async listEnum(requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRet
|
|
|
180
180
|
List all the trigger types
|
|
181
181
|
|
|
182
182
|
```typescript
|
|
183
|
-
async listTypes(query?:
|
|
183
|
+
async listTypes(query?: { cursor?: string; limit?: number | null; toolkits?: string[] | null }, requestOptions?: ComposioRequestOptions): Promise<{ items: { config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: { logo: string; name: string; slug: string }; version?: string }[]; nextCursor?: string | null; totalPages: number }>
|
|
184
184
|
```
|
|
185
185
|
|
|
186
186
|
**Parameters**
|
|
187
187
|
|
|
188
188
|
| Name | Type | Description |
|
|
189
189
|
|------|------|-------------|
|
|
190
|
-
| `query?` | `
|
|
190
|
+
| `query?` | `\{ cursor?: string; limit?: number \| null; toolkits?: string[] \| null \}` | The query parameters to filter the trigger types |
|
|
191
191
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
192
192
|
|
|
193
193
|
**Returns**
|
|
194
194
|
|
|
195
|
-
`Promise<
|
|
195
|
+
`Promise<\{ items: \{ config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: \{ logo: string; name: string; slug: string \}; version?: string \}[]; nextCursor?: string \| null; totalPages: number \}>` — The list of trigger types
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
@@ -283,14 +283,14 @@ If a subscription already exists, the first subscription is updated. Otherwise a
|
|
|
283
283
|
subscription is created. By default this subscribes to V3 trigger message events.
|
|
284
284
|
|
|
285
285
|
```typescript
|
|
286
|
-
async setWebhookSubscription(params:
|
|
286
|
+
async setWebhookSubscription(params: { enabledEvents?: string[]; version?: 'V1' | 'V2' | 'V3'; webhookUrl: string }): Promise<WebhookSubscription>
|
|
287
287
|
```
|
|
288
288
|
|
|
289
289
|
**Parameters**
|
|
290
290
|
|
|
291
291
|
| Name | Type |
|
|
292
292
|
|------|------|
|
|
293
|
-
| `params` | `
|
|
293
|
+
| `params` | `\{ enabledEvents?: string[]; version?: 'V1' \| 'V2' \| 'V3'; webhookUrl: string \}` |
|
|
294
294
|
|
|
295
295
|
**Returns**
|
|
296
296
|
|
|
@@ -311,15 +311,16 @@ await composio.triggers.setWebhookSubscription({
|
|
|
311
311
|
Subscribe to all the triggers
|
|
312
312
|
|
|
313
313
|
```typescript
|
|
314
|
-
async subscribe(fn: (_data:
|
|
314
|
+
async subscribe(fn: (_data: { id: string; metadata: { connectedAccount: { authConfigId: string; authConfigUUID: string; id: string; status: 'ACTIVE' | 'INACTIVE'; userId: string; uuid: string }; id: string; toolkitSlug: string; triggerConfig: Record<string, unknown>; triggerData?: string; triggerSlug: string; uuid: string }; originalPayload?: Record<string, unknown>; payload?: Record<string, unknown>; toolkitSlug: string; triggerSlug: string; userId: string; uuid: string }) => void, filters?: { authConfigId?: string; connectedAccountId?: string; toolkits?: string[]; triggerData?: string; triggerId?: string; triggerSlug?: string[]; userId?: string }, onSubscriptionError?: (data: Record<string, unknown>) => void): Promise<void>
|
|
315
315
|
```
|
|
316
316
|
|
|
317
317
|
**Parameters**
|
|
318
318
|
|
|
319
319
|
| Name | Type | Description |
|
|
320
320
|
|------|------|-------------|
|
|
321
|
-
| `fn` | `(_data:
|
|
322
|
-
| `filters
|
|
321
|
+
| `fn` | `(_data: \{ id: string; metadata: \{ connectedAccount: \{ authConfigId: string; authConfigUUID: string; id: string; status: 'ACTIVE' \| 'INACTIVE'; userId: string; uuid: string \}; id: string; toolkitSlug: string; triggerConfig: Record<string, unknown>; triggerData?: string; triggerSlug: string; uuid: string \}; originalPayload?: Record<string, unknown>; payload?: Record<string, unknown>; toolkitSlug: string; triggerSlug: string; userId: string; uuid: string \}) => void` | The function to call when a trigger is received |
|
|
322
|
+
| `filters?` | `\{ authConfigId?: string; connectedAccountId?: string; toolkits?: string[]; triggerData?: string; triggerId?: string; triggerSlug?: string[]; userId?: string \}` | The filters to apply to the triggers |
|
|
323
|
+
| `onSubscriptionError?` | `(data: Record<string, unknown>) => void` | Optional callback invoked with the raw Pusher payload when the underlying subscription fails (for example on auth or permission rejection). The subscribe promise still resolves; this is the only programmatic signal of the failure. Errors thrown from — or promises rejected by — the callback are contained and logged. |
|
|
323
324
|
|
|
324
325
|
**Returns**
|
|
325
326
|
|
|
@@ -364,7 +365,7 @@ await triggers.unsubscribe();
|
|
|
364
365
|
Update an existing trigger instance
|
|
365
366
|
|
|
366
367
|
```typescript
|
|
367
|
-
async update(triggerId: string, body:
|
|
368
|
+
async update(triggerId: string, body: { status: 'enable' | 'disable' }, requestOptions?: ComposioRequestOptions): Promise<{ status: 'success' }>
|
|
368
369
|
```
|
|
369
370
|
|
|
370
371
|
**Parameters**
|
|
@@ -372,12 +373,12 @@ async update(triggerId: string, body: TriggerInstanceManageUpdateParams, request
|
|
|
372
373
|
| Name | Type | Description |
|
|
373
374
|
|------|------|-------------|
|
|
374
375
|
| `triggerId` | `string` | The Id of the trigger instance |
|
|
375
|
-
| `body` | `
|
|
376
|
+
| `body` | `\{ status: 'enable' \| 'disable' \}` | The parameters to update the trigger instance |
|
|
376
377
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
377
378
|
|
|
378
379
|
**Returns**
|
|
379
380
|
|
|
380
|
-
`Promise
|
|
381
|
+
`Promise<\{ status: 'success' \}>` — The updated trigger instance response
|
|
381
382
|
|
|
382
383
|
---
|
|
383
384
|
|
|
@@ -393,14 +394,14 @@ The signature is computed as: `HMAC-SHA256(${webhookId}.${webhookTimestamp}.${pa
|
|
|
393
394
|
and is expected in the format: `v1,base64EncodedSignature`
|
|
394
395
|
|
|
395
396
|
```typescript
|
|
396
|
-
async verifyWebhook(params:
|
|
397
|
+
async verifyWebhook(params: { id: string; payload: string; secret: string; signature: string; timestamp: string; tolerance?: number }): Promise<VerifyWebhookResult>
|
|
397
398
|
```
|
|
398
399
|
|
|
399
400
|
**Parameters**
|
|
400
401
|
|
|
401
402
|
| Name | Type | Description |
|
|
402
403
|
|------|------|-------------|
|
|
403
|
-
| `params` | `
|
|
404
|
+
| `params` | `\{ id: string; payload: string; secret: string; signature: string; timestamp: string; tolerance?: number \}` | The verification parameters |
|
|
404
405
|
|
|
405
406
|
**Returns**
|
|
406
407
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Usage"
|
|
3
|
+
description: "`composio.experimental.usage` — metering for the project the API key belongs to. **Experimental — shape may change in future releases.**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
Access this class through the `composio.usage` property:
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const composio = new Composio({ apiKey: 'your-api-key' });
|
|
12
|
+
const result = await composio.usage.list();
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### breakdown()
|
|
18
|
+
|
|
19
|
+
Usage for one metering entity type, grouped by a dimension.
|
|
20
|
+
**Experimental — shape may change in future releases.**
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
async breakdown(entityType: string, params?: { filters?: { sessionId?: string[] | null; userId?: string[] | null }; from?: number; groupBy?: string; limit?: number; orderBy?: 'key' | 'total_quantity' | 'event_count'; orderDirection?: 'asc' | 'desc'; to?: number }, requestOptions?: ComposioRequestOptions): Promise<{ entityType: string; eventCount: number; groups: { eventCount: number; key: string; totalQuantity: string }[]; totalQuantity: string; unit: string }>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Parameters**
|
|
27
|
+
|
|
28
|
+
| Name | Type | Description |
|
|
29
|
+
|------|------|-------------|
|
|
30
|
+
| `entityType` | `string` | Entity type to break down (e.g. `tool_calls`, `sessions`) |
|
|
31
|
+
| `params?` | `\{ filters?: \{ sessionId?: string[] \| null; userId?: string[] \| null \}; from?: number; groupBy?: string; limit?: number; orderBy?: 'key' \| 'total_quantity' \| 'event_count'; orderDirection?: 'asc' \| 'desc'; to?: number \}` | Optional range, `groupBy`, ordering, `limit` and filters |
|
|
32
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
33
|
+
|
|
34
|
+
**Returns**
|
|
35
|
+
|
|
36
|
+
`Promise<\{ entityType: string; eventCount: number; groups: \{ eventCount: number; key: string; totalQuantity: string \}[]; totalQuantity: string; unit: string \}>` — Totals plus per-group rows
|
|
37
|
+
|
|
38
|
+
**Example**
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const byUser = await composio.experimental.usage.breakdown('sessions', {
|
|
42
|
+
groupBy: 'user_id',
|
|
43
|
+
orderBy: 'event_count',
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### summary()
|
|
50
|
+
|
|
51
|
+
Usage totals per metering entity type for a time range.
|
|
52
|
+
**Experimental — shape may change in future releases.**
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
async summary(params?: { entityTypes?: string[]; filters?: { sessionId?: string[] | null; userId?: string[] | null }; from?: number; to?: number }, requestOptions?: ComposioRequestOptions): Promise<{ entities: Record<string, { eventCount: number; totalQuantity: string; unit: string }> }>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Parameters**
|
|
59
|
+
|
|
60
|
+
| Name | Type | Description |
|
|
61
|
+
|------|------|-------------|
|
|
62
|
+
| `params?` | `\{ entityTypes?: string[]; filters?: \{ sessionId?: string[] \| null; userId?: string[] \| null \}; from?: number; to?: number \}` | Optional range, `entityTypes` and filters |
|
|
63
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
64
|
+
|
|
65
|
+
**Returns**
|
|
66
|
+
|
|
67
|
+
`Promise<...>` — Totals keyed by entity type
|
|
68
|
+
|
|
69
|
+
**Example**
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
const summary = await composio.experimental.usage.summary({
|
|
73
|
+
from: Date.now() - 7 * 24 * 60 * 60 * 1000,
|
|
74
|
+
filters: { userId: ['user_123'] },
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|