@@ -141,3 +141,68 @@ async def find(
141141 )
142142
143143return response .data
144+
145+ def create_many (
146+ self ,
147+ * ,
148+ source :dict ,
149+ target :dict ,
150+ type :Optional [str ]= None ,
151+ direction :Optional [str ]= None ,
152+ many_to_many :Optional [bool ]= None ,
153+ transaction :Optional [Union [Transaction ,str ]]= None ,
154+ )-> dict :
155+ """Bulk create relationships by matching keys or many-to-many cartesian.
156+
157+ Modes:
158+ 1. Key-match (default): requires source.key and target.key, creates relationships where source[key] = target[key].
159+ 2. many_to_many=True: cartesian across filtered sets (requires where filters on both source & target and omits keys).
160+
161+ Args:
162+ source (dict): { label: str, key?: str, where?: dict }
163+ target (dict): { label: str, key?: str, where?: dict }
164+ type (str, optional): Relationship type override.
165+ direction (str, optional): 'in' | 'out'. Defaults to 'out' server-side when omitted.
166+ many_to_many (bool, optional): Enable cartesian mode (requires filters, disallows keys).
167+ transaction (Transaction|str, optional): Transaction context.
168+
169+ Returns:
170+ dict: API response payload.
171+ """
172+ headers = Transaction ._build_transaction_header (transaction )
173+ payload :dict = {"source" :source ,"target" :target }
174+ if type :
175+ payload ["type" ]= type
176+ if direction :
177+ payload ["direction" ]= direction
178+ if many_to_many is not None :
179+ payload ["manyToMany" ]= many_to_many
180+ return self .client ._make_request (
181+ "POST" ,"/relationships/create-many" ,payload ,headers
182+ )
183+
184+ def delete_many (
185+ self ,
186+ * ,
187+ source :dict ,
188+ target :dict ,
189+ type :Optional [str ]= None ,
190+ direction :Optional [str ]= None ,
191+ many_to_many :Optional [bool ]= None ,
192+ transaction :Optional [Union [Transaction ,str ]]= None ,
193+ )-> dict :
194+ """Bulk delete relationships using same contract as create_many.
195+
196+ See create_many for argument semantics.
197+ """
198+ headers = Transaction ._build_transaction_header (transaction )
199+ payload :dict = {"source" :source ,"target" :target }
200+ if type :
201+ payload ["type" ]= type
202+ if direction :
203+ payload ["direction" ]= direction
204+ if many_to_many is not None :
205+ payload ["manyToMany" ]= many_to_many
206+ return self .client ._make_request (
207+ "POST" ,"/relationships/delete-many" ,payload ,headers
208+ )