@@ -20,7 +20,7 @@ def set(
2020"""Update a record by ID."""
2121headers = Transaction ._build_transaction_header (transaction )
2222return self .client ._make_request (
23- "PUT" ,f"/api/v1/ records/{ record_id } " ,data ,headers
23+ "PUT" ,f"/records/{ record_id } " ,data ,headers
2424 )
2525
2626def update (
@@ -33,7 +33,7 @@ def update(
3333headers = Transaction ._build_transaction_header (transaction )
3434
3535return self .client ._make_request (
36- "PATCH" ,f"/api/v1/ records/{ record_id } " ,data ,headers
36+ "PATCH" ,f"/records/{ record_id } " ,data ,headers
3737 )
3838
3939def create (
@@ -63,7 +63,7 @@ def create(
6363"options" :options or {"returnResult" :True ,"suggestTypes" :True },
6464 }
6565response = self .client ._make_request (
66- "POST" ,"/api/v1/ records" ,payload ,headers
66+ "POST" ,"/records" ,payload ,headers
6767 )
6868return Record (self .client ,response .get ("data" ))
6969
@@ -93,7 +93,7 @@ def create_many(
9393"options" :options or {"returnResult" :True ,"suggestTypes" :True },
9494 }
9595response = self .client ._make_request (
96- "POST" ,"/api/v1/ records/import/json" ,payload ,headers
96+ "POST" ,"/records/import/json" ,payload ,headers
9797 )
9898return [Record (self .client ,record )for record in response .get ("data" )]
9999
@@ -120,7 +120,7 @@ def attach(
120120if options :
121121payload .update (typing .cast (typing .Dict [str ,typing .Any ],options ))
122122return self .client ._make_request (
123- "POST" ,f"/api/v1/ relationships/{ source_id } " ,payload ,headers
123+ "POST" ,f"/relationships/{ source_id } " ,payload ,headers
124124 )
125125
126126def detach (
@@ -146,19 +146,19 @@ def detach(
146146if options :
147147payload .update (typing .cast (typing .Dict [str ,typing .Any ],options ))
148148return self .client ._make_request (
149- "PUT" ,f"/api/v1/ relationships/{ source_id } " ,payload ,headers
149+ "PUT" ,f"/relationships/{ source_id } " ,payload ,headers
150150 )
151151
152152def delete (
153- self ,query :SearchQuery ,transaction :Optional [Transaction ]= None
153+ self ,search_query :SearchQuery ,transaction :Optional [Transaction ]= None
154154 )-> Dict [str ,str ]:
155155"""Delete records matching the query."""
156156headers = Transaction ._build_transaction_header (transaction )
157157
158158return self .client ._make_request (
159- "PUT " ,
160- "/api/v1/ records/delete" ,
161- typing .cast (typing .Dict [str ,typing .Any ],query or {}),
159+ "POST " ,
160+ "/records/delete" ,
161+ typing .cast (typing .Dict [str ,typing .Any ],search_query or {}),
162162headers ,
163163 )
164164
@@ -172,18 +172,18 @@ def delete_by_id(
172172
173173if isinstance (id_or_ids ,list ):
174174return self .client ._make_request (
175- "PUT " ,
176- "/api/v1/ records/delete" ,
175+ "POST " ,
176+ "/records/delete" ,
177177 {"limit" :1000 ,"where" : {"$id" : {"$in" :id_or_ids }}},
178178headers ,
179179 )
180180return self .client ._make_request (
181- "DELETE" ,f"/api/v1/ records/{ id_or_ids } " ,None ,headers
181+ "DELETE" ,f"/records/{ id_or_ids } " ,None ,headers
182182 )
183183
184184def find (
185185self ,
186- query :Optional [SearchQuery ]= None ,
186+ search_query :Optional [SearchQuery ]= None ,
187187record_id :Optional [str ]= None ,
188188transaction :Optional [Transaction ]= None ,
189189 )-> List [Record ]:
@@ -193,14 +193,14 @@ def find(
193193headers = Transaction ._build_transaction_header (transaction )
194194
195195path = (
196- f"/api/v1/ records/{ record_id } /search"
196+ f"/records/{ record_id } /search"
197197if record_id
198- else "/api/v1/ records/search"
198+ else "/records/search"
199199 )
200200response = self .client ._make_request (
201201"POST" ,
202202path ,
203- data = typing .cast (typing .Dict [str ,typing .Any ],query or {}),
203+ data = typing .cast (typing .Dict [str ,typing .Any ],search_query or {}),
204204headers = headers ,
205205 )
206206return [Record (self .client ,record )for record in response .get ("data" )]
@@ -224,7 +224,7 @@ def import_csv(
224224 }
225225
226226return self .client ._make_request (
227- "POST" ,"/api/v1/ records/import/csv" ,payload ,headers
227+ "POST" ,"/records/import/csv" ,payload ,headers
228228 )
229229
230230@staticmethod