Skip to content

Term Store (Managed Metadata)

Work with the term store — the managed metadata service for consistent tagging across SharePoint and OneDrive: create taxonomy, export/import it, search, and clean up.


Prerequisites

Permission Description Reference
Sites.ReadWrite.All (delegated) Create/search/delete terms Sites permissions
TermStore.Read.All / TermStore.ReadWrite.All (app) Export / import the store TermStore permissions

Examples

Operation File API
Create groups, sets, terms create_terms.py termStore group create
Search the store by term label search_term.py store search
Export the full hierarchy to CSV/JSON export_store.py group list
Import a hierarchy from JSON import_store.py set create
Delete groups (clean up taxonomy) clear_store.py group delete

API reference

More examples

Script What it does
export_tree.py Export the term store hierarchy as nested JSON, then re-import it.