Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 04:45 UTC
| 1 | --- |
| 2 | title: "AuthConfigs" |
| 3 | description: "Manage authentication configurations." |
| 4 | --- |
| 5 | |
| 6 | ## Methods |
| 7 | |
| 8 | ### list() |
| 9 | |
| 10 | Lists authentication configurations based on provided filter criteria. |
| 11 | |
| 12 | ```python |
| 13 | def list(**query: Unpack[auth_config_list_params.AuthConfigListParams]) -> auth_config_list_response.AuthConfigListResponse |
| 14 | ``` |
| 15 | |
| 16 | **Parameters** |
| 17 | |
| 18 | | Name | Type | |
| 19 | |------|------| |
| 20 | | `query?` | `Unpack[auth_config_list_params.AuthConfigListParams]` | |
| 21 | |
| 22 | **Returns** |
| 23 | |
| 24 | `auth_config_list_response.AuthConfigListResponse` |
| 25 | |
| 26 | --- |
| 27 | |
| 28 | ### create() |
| 29 | |
| 30 | Create a new auth config |
| 31 | |
| 32 | ```python |
| 33 | def create(toolkit: str, options: Union[auth_config_create_params.AuthConfig, ComposioManagedAuthConfigOptions]) -> auth_config_create_response.AuthConfig |
| 34 | ``` |
| 35 | |
| 36 | **Parameters** |
| 37 | |
| 38 | | Name | Type | Description | |
| 39 | |------|------|-------------| |
| 40 | | `toolkit` | `str` | The toolkit to create the auth config for. | |
| 41 | | `options` | `Union[auth_config_create_params.AuthConfig, ComposioManagedAuthConfigOptions]` | The options to create the auth config with. For a Composio-managed auth config, `managed_app_id` picks the app. | |
| 42 | |
| 43 | **Returns** |
| 44 | |
| 45 | `auth_config_create_response.AuthConfig` — The created auth config. |
| 46 | |
| 47 | **Example** |
| 48 | |
| 49 | ```python |
| 50 | toolkit = composio.toolkits.get("slack") |
| 51 | app = next(a for a in toolkit.composio_managed_auth if not a.is_default) |
| 52 | composio.auth_configs.create( |
| 53 | "slack", |
| 54 | {"type": "use_composio_managed_auth", "managed_app_id": app.managed_app_id}, |
| 55 | ) |
| 56 | ``` |
| 57 | |
| 58 | --- |
| 59 | |
| 60 | ### get() |
| 61 | |
| 62 | Retrieves a specific authentication configuration by its ID |
| 63 | |
| 64 | ```python |
| 65 | def get(nanoid: str) -> auth_config_retrieve_response.AuthConfigRetrieveResponse |
| 66 | ``` |
| 67 | |
| 68 | **Parameters** |
| 69 | |
| 70 | | Name | Type | Description | |
| 71 | |------|------|-------------| |
| 72 | | `nanoid` | `str` | The ID of the auth config to retrieve. | |
| 73 | |
| 74 | **Returns** |
| 75 | |
| 76 | `auth_config_retrieve_response.AuthConfigRetrieveResponse` — The retrieved auth config. |
| 77 | |
| 78 | --- |
| 79 | |
| 80 | ### update() |
| 81 | |
| 82 | Updates an existing authentication configuration. This method allows you to modify properties of an auth config such as credentials, scopes, or tool restrictions. The update type (custom or default) determines which fields can be updated. |
| 83 | |
| 84 | ```python |
| 85 | def update(nanoid: str, *, options: auth_config_update_params.AuthConfigUpdateParams) -> auth_config_update_response.AuthConfigUpdateResponse |
| 86 | ``` |
| 87 | |
| 88 | **Parameters** |
| 89 | |
| 90 | | Name | Type | Description | |
| 91 | |------|------|-------------| |
| 92 | | `nanoid` | `str` | The ID of the auth config to update. | |
| 93 | | `options` | `auth_config_update_params.AuthConfigUpdateParams` | The options to update the auth config with. | |
| 94 | |
| 95 | **Returns** |
| 96 | |
| 97 | `auth_config_update_response.AuthConfigUpdateResponse` — The update result with success and message fields. |
| 98 | |
| 99 | --- |
| 100 | |
| 101 | ### delete() |
| 102 | |
| 103 | Deletes an existing authentication configuration. |
| 104 | |
| 105 | ```python |
| 106 | def delete(nanoid: str) -> auth_config_delete_response.AuthConfigDeleteResponse |
| 107 | ``` |
| 108 | |
| 109 | **Parameters** |
| 110 | |
| 111 | | Name | Type | Description | |
| 112 | |------|------|-------------| |
| 113 | | `nanoid` | `str` | The ID of the auth config to delete. | |
| 114 | |
| 115 | **Returns** |
| 116 | |
| 117 | `auth_config_delete_response.AuthConfigDeleteResponse` — The deletion result with success and message fields. |
| 118 | |
| 119 | --- |
| 120 | |
| 121 | ### enable() |
| 122 | |
| 123 | Enables an existing authentication configuration. |
| 124 | |
| 125 | ```python |
| 126 | def enable(nanoid: str) -> auth_config_update_status_response.AuthConfigUpdateStatus... |
| 127 | ``` |
| 128 | |
| 129 | **Parameters** |
| 130 | |
| 131 | | Name | Type | Description | |
| 132 | |------|------|-------------| |
| 133 | | `nanoid` | `str` | The ID of the auth config to enable. | |
| 134 | |
| 135 | **Returns** |
| 136 | |
| 137 | `auth_config_update_status_response.AuthConfigUpdateStatus...` — The status update result with success and message fields. |
| 138 | |
| 139 | --- |
| 140 | |
| 141 | ### disable() |
| 142 | |
| 143 | Disables an existing authentication configuration. |
| 144 | |
| 145 | ```python |
| 146 | def disable(nanoid: str) -> auth_config_update_status_response.AuthConfigUpdateStatus... |
| 147 | ``` |
| 148 | |
| 149 | **Parameters** |
| 150 | |
| 151 | | Name | Type | Description | |
| 152 | |------|------|-------------| |
| 153 | | `nanoid` | `str` | The ID of the auth config to disable. | |
| 154 | |
| 155 | **Returns** |
| 156 | |
| 157 | `auth_config_update_status_response.AuthConfigUpdateStatus...` — The status update result with success and message fields. |
| 158 | |
| 159 | --- |
| 160 | |
| 161 | [View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/auth_configs.py#L31) |