@@ -39,6 +39,24 @@ export class Connections extends APIResource {
3939 return this . _client . post ( '/v3/connections/list' , { body, ...options } ) ;
4040 }
4141
42+ /**
43+ * Delete all connections for a specific provider and container tags
44+ *
45+ * @example
46+ * ```ts
47+ * const connection = await client.connections.delete(
48+ * 'notion',
49+ * );
50+ * ```
51+ */
52+ delete (
53+ provider : 'notion' | 'google-drive' | 'onedrive' ,
54+ body : ConnectionDeleteParams | null | undefined = { } ,
55+ options ?: RequestOptions ,
56+ ) : APIPromise < ConnectionDeleteResponse > {
57+ return this . _client . delete ( path `/v3/connections/${ provider } ` , { body, ...options } ) ;
58+ }
59+
4260 /**
4361 * Get connection details
4462 *
@@ -98,6 +116,22 @@ export namespace ConnectionListResponse {
98116 }
99117}
100118
119+ export interface ConnectionDeleteResponse {
120+ deletedConnections : Array < ConnectionDeleteResponse . DeletedConnection > ;
121+
122+ deletedCount : number ;
123+
124+ success : boolean ;
125+ }
126+
127+ export namespace ConnectionDeleteResponse {
128+ export interface DeletedConnection {
129+ id : string ;
130+
131+ provider : string ;
132+ }
133+ }
134+
101135export interface ConnectionGetResponse {
102136 id : string ;
103137
@@ -117,14 +151,8 @@ export namespace ConnectionListDocumentsResponse {
117151 export interface ConnectionListDocumentsResponseItem {
118152 id : string ;
119153
120- content : string | null ;
121-
122154 createdAt : string ;
123155
124- metadata : Record < string , unknown > | null ;
125-
126- source : string | null ;
127-
128156 status : string ;
129157
130158 summary : string | null ;
@@ -134,8 +162,6 @@ export namespace ConnectionListDocumentsResponse {
134162 type : string ;
135163
136164 updatedAt : string ;
137-
138- url : string | null ;
139165 }
140166}
141167
@@ -154,6 +180,13 @@ export interface ConnectionListParams {
154180 containerTags ?: Array < string > ;
155181}
156182
183+ export interface ConnectionDeleteParams {
184+ /**
185+ * Optional comma-separated list of container tags to filter connections by
186+ */
187+ containerTags ?: Array < string > ;
188+ }
189+
157190export interface ConnectionListDocumentsParams {
158191 /**
159192 * Optional comma-separated list of container tags to filter documents by
@@ -165,10 +198,12 @@ export declare namespace Connections {
165198 export {
166199 type ConnectionCreateResponse as ConnectionCreateResponse ,
167200 type ConnectionListResponse as ConnectionListResponse ,
201+ type ConnectionDeleteResponse as ConnectionDeleteResponse ,
168202 type ConnectionGetResponse as ConnectionGetResponse ,
169203 type ConnectionListDocumentsResponse as ConnectionListDocumentsResponse ,
170204 type ConnectionCreateParams as ConnectionCreateParams ,
171205 type ConnectionListParams as ConnectionListParams ,
206+ type ConnectionDeleteParams as ConnectionDeleteParams ,
172207 type ConnectionListDocumentsParams as ConnectionListDocumentsParams ,
173208 } ;
174209}
0 commit comments