Forum Discussion
miguelisidoro
Oct 18, 2022Iron Contributor
How to delete a term from term store using PnP JS
Hello, How can we delete a term from a term store using PnP JS (v2 or v3) in a SPFx solution? I looked at https://pnp.github.io/pnpjs/sp/taxonomy/ and found nothing, Can you help? If it i...
ganeshsanap
Oct 19, 2022MVP
miguelisidoro Try SharePoint REST API if it works for you:
Endpoint : https://testinglala.sharepoint.com/_api/v2.1/termStore/groups/122d92ab-d7a8-479f-9888-8d4421f8218f/sets/8ed8c9ea-7052-4c1d-a4d7-b9c10bffea6f/terms/b8b3e828-cdf7-46b2-889e-f5f797a05aa3
Method : DELETE
Headers : {"Content-Type": "application/json",
"Authorization": "Bearer <Bearer Token>"}
References:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
miguelisidoro
Oct 19, 2022Iron Contributor
ganeshsanap thanks. I will use graph api: https://learn.microsoft.com/en-us/graph/api/termstore-term-delete?view=graph-rest-1.0&tabs=http