# SharePoint on boxd

> SharePoint is a Microsoft platform for document management and intranets, enabling teams to collaborate, store, and organize content securely and effectively.

- Page: https://boxd.sh/integrations/share-point/
- CLI: `run share-point` (98 commands, 17 marked common)
- SDK: `import { sharePoint } from "@boxd/run"`; every parameter and response type is at `@boxd/run/share-point`
- Triggers: none
- Connect: `run auth share-point` (Sign in with SharePoint), or https://app.boxd.sh/integrations/detail/share_point
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth share-point      # once: prints a link to connect your account
run share-point           # list its commands
run share-point list-sites
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, sharePoint } from "@boxd/run";

every("1 hour", async () => {
  const result = await sharePoint.listSites({});
  console.log(result);
});
```

Run it with `run share-point.run.ts`. SharePoint has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run share-point <command> --help` lists the optional ones. "common" marks what `run share-point` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `add-attachment-to-list-item` | `sharePoint.addAttachmentToListItem()` | `--file-name` `--item-id` `--list-title` | 4 | Add an attachment to a SharePoint list item |
| `add-field-link-to-content-type` | `sharePoint.addFieldLinkToContentType()` | `--contenttypeid` `--field-internal-name` `--listid` | 3 | Add a field link to a list content type |
| `add-role-assignment-to-item` | `sharePoint.addRoleAssignmentToItem()` | `--item-id` `--list-title` `--principal-id` `--role-definition-id` | 1 | Add a role assignment to a list item |
| `add-role-assignment-to-list` | `sharePoint.addRoleAssignmentToList()` | `--list-title` `--principal-id` `--role-definition-id` | 1 | Add a role assignment to a SharePoint list |
| `break-role-inheritance-on-item` | `sharePoint.breakRoleInheritanceOnItem()` | `--item-id` `--list-title` | 3 | Break permission inheritance on a list item |
| `break-role-inheritance-on-list` | `sharePoint.breakRoleInheritanceOnList()` | `--clear-subscopes` `--copy-role-assignments` `--list-title` | 1 | Breaks permission inheritance on a SharePoint list, allowing you to set unique permissions |
| `check-in-file` | `sharePoint.checkInFile()` | `--server-relative-path` | 3 | Check in a file |
| `create-content-type` | `sharePoint.createContentType()` | `--name` | 4 | Create a new content type in SharePoint |
| `create-drive-item-sharing-link` | `sharePoint.createDriveItemSharingLink()` | `--driveItem-id` `--drive-id` `--type` | 4 | Create a sharing link for a drive item in SharePoint or OneDrive |
| `create-list-field` | `sharePoint.createListField()` | `--field-type-kind` `--list-guid` `--static-name` `--title` | 3 | Create a new field (column) in a SharePoint list |
| `create-list-item-by-id` ·common | `sharePoint.createListItemById()` | `--fields` `--list-id` `--metadata-type` | 1 | Create a new item in a SharePoint list using the list's GUID |
| `create-list-item-in-folder` | `sharePoint.createListItemInFolder()` | `--folder-url` `--list-title` `--values` | 2 | Create a list item in a specific folder within a SharePoint list |
| `create-web` | `sharePoint.createWeb()` | `--title` `--url` | 5 | Create a new SharePoint subsite under the current site |
| `delete-drive-item-version-content` | `sharePoint.deleteDriveItemVersionContent()` | `--drive-id` `--driveitem-id` `--driveitemversion-id` | 0 | Delete content for a specific version of a drive item in SharePoint |
| `delete-file-item` | `sharePoint.deleteFileItem()` | `--server-relative-url` | 2 | Deletes a file from a SharePoint document library permanently |
| `delete-folder` | `sharePoint.deleteFolder()` | `--server-relative-url` | 2 | Deletes a folder from a SharePoint document library |
| `delete-list` | `sharePoint.deleteList()` | `--list-guid` | 2 | Delete a SharePoint list |
| `delete-list-by-title` | `sharePoint.deleteListByTitle()` | `--list-title` | 2 | Delete a SharePoint list by its title |
| `delete-list-item` | `sharePoint.deleteListItem()` | `--item-id` `--list-title` | 2 | Delete a SharePoint list item |
| `delete-list-items` | `sharePoint.deleteListItems()` | `--item-ids` `--list-title` | 2 | Delete multiple SharePoint list items in bulk |
| `delete-recycle-bin-item-permanent` | `sharePoint.deleteRecycleBinItemPermanent()` | `--recyclebinitemid` | 1 | Permanently delete a SharePoint Recycle Bin item |
| `download-file-by-server-relative-url` | `sharePoint.downloadFileByServerRelativeUrl()` | `--server-relative-url` | 1 | Download a file by server-relative URL |
| `ensure-user` | `sharePoint.ensureUser()` | — | 4 | Ensures a user exists in a SharePoint site by their login name |
| `follow` | `sharePoint.follow()` | `--actor-type` | 4 | Follow a SharePoint user, document, site, or tag |
| `get-all-folders` | `sharePoint.getAllFolders()` | — | 7 | Retrieve all folders in the SharePoint web |
| `get-changes` | `sharePoint.getChanges()` | `--list-id` `--query` | 1 | Retrieve changes from SharePoint list change log |
| `get-content-type` | `sharePoint.getContentType()` | `--content-type-id` | 1 | Retrieve a single SharePoint content type by its ID |
| `get-content-types` | `sharePoint.getContentTypes()` | — | 7 | Retrieves all content types from the current SharePoint site |
| `get-content-types-for-list` | `sharePoint.getContentTypesForList()` | `--list-guid` | 1 | Retrieve all content types for a specific SharePoint list by GUID |
| `get-context-info` | `sharePoint.getContextInfo()` | — | 1 | Retrieve SharePoint context information including the form digest value |
| `get-current-user` | `sharePoint.getCurrentUser()` | — | 1 | Retrieve the current user for the site |
| `get-drive-item-analytics` | `sharePoint.getDriveItemAnalytics()` | `--drive-id` `--drive-item-id` | 2 | Get analytics for a SharePoint drive item |
| `get-file-by-server-relative-url` ·common ·deprecated | `sharePoint.getFileByServerRelativeUrl()` | `--server-relative-path-decoded` | 3 | Use GetSiteDriveItemByPath instead |
| `get-folder-by-server-relative-url` ·deprecated | `sharePoint.getFolderByServerRelativeUrl()` | `--server-relative-url` | 3 | Use get-site-drive-item-by-path instead |
| `get-group-users` | `sharePoint.getGroupUsers()` | `--group-name` | 7 | Retrieves all users who are members of a specified SharePoint group |
| `get-group-users-by-id` | `sharePoint.getGroupUsersById()` | `--group-id` | 7 | Retrieve all users in a specific SharePoint site group by group ID |
| `get-item-attachment-content` | `sharePoint.getItemAttachmentContent()` | `--file-name` `--item-id` `--list-title` | 1 | Download an attachment from a SharePoint list item |
| `get-list-by-guid` | `sharePoint.getListByGuid()` | `--list-guid` | 3 | Retrieve a SharePoint list by its GUID |
| `get-list-by-title` | `sharePoint.getListByTitle()` | `--list-title` | 3 | Retrieve a SharePoint list by its title |
| `get-list-content-type-by-id` | `sharePoint.getListContentTypeById()` | `--content-type-id` `--list-id` | 1 | Retrieve a specific content type from a SharePoint list by its ID |
| `get-list-item-by-id` | `sharePoint.getListItemById()` | `--item-id` `--list-title` | 3 | Retrieve a SharePoint list item by ID |
| `get-list-item-version` | `sharePoint.getListItemVersion()` | `--item-id` `--list-guid` `--version-id` | 1 | Retrieve a specific version of a SharePoint list item |
| `get-list-items` | `sharePoint.getListItems()` | `--list-title` | 7 | Retrieve items from a SharePoint list |
| `get-list-items-by-guid` | `sharePoint.getListItemsByGuid()` | `--list-guid` | 7 | Retrieve items from a SharePoint list using its GUID |
| `get-my-followed` | `sharePoint.getMyFollowed()` | `--types` | 1 | Get entities the current user is following |
| `get-my-followers` | `sharePoint.getMyFollowers()` | — | 1 | Retrieves the list of users who are following the authenticated user in SharePoint |
| `get-role-definitions` | `sharePoint.getRoleDefinitions()` | — | 7 | List role definitions at the web level |
| `get-site-by-hostname` ·common | `sharePoint.getSiteByHostname()` | `--hostname` | 0 | Retrieve SharePoint site information by hostname or URL |
| `get-site-by-id` ·common | `sharePoint.getSiteById()` | `--site-id` | 2 | Retrieve information about a SharePoint site (web) by its unique identifier |
| `get-site-collection-info` | `sharePoint.getSiteCollectionInfo()` | — | 2 | Fetch site collection metadata (URL, ID, root web URI) only, not list item or document-level details |
| `get-site-drive-item-by-path` ·common | `sharePoint.getSiteDriveItemByPath()` | `--item-path` | 3 | Retrieve a file or folder by its server-relative path in a SharePoint site |
| `get-site-page-content` ·common | `sharePoint.getSitePageContent()` | — | 4 | Retrieve modern SharePoint Site Pages content by reading list item fields |
| `get-site-root` ·common | `sharePoint.getSiteRoot()` | — | 2 | Retrieves metadata about the root web of a SharePoint site collection |
| `get-user-effective-permissions-on-web` | `sharePoint.getUserEffectivePermissionsOnWeb()` | `--login-name` | 1 | Get a user's effective permissions on the current SharePoint site (Web) |
| `get-web-info` | `sharePoint.getWebInfo()` | — | 3 | Retrieve information about the current SharePoint web (site) using REST API |
| `get-webhook-subscription` | `sharePoint.getWebhookSubscription()` | `--list-id` `--subscription-id` | 1 | Retrieve a specific webhook subscription by ID from a SharePoint list |
| `get-webhook-subscriptions` | `sharePoint.getWebhookSubscriptions()` | `--list-id` | 1 | Retrieve all webhook subscriptions on a SharePoint list |
| `is-followed` | `sharePoint.isFollowed()` | `--actor-type` | 4 | Check if the current user is following a specified actor |
| `list-all-lists` | `sharePoint.listAllLists()` | — | 7 | Retrieves all lists in the current SharePoint web/site |
| `list-drive-children` | `sharePoint.listDriveChildren()` | `--drive-id` | 5 | List children (files and folders) in a SharePoint drive using REST API v2.0 |
| `list-drive-recent-items` | `sharePoint.listDriveRecentItems()` | `--drive-id` | 2 | List recently modified items in a SharePoint drive using Microsoft Graph API |
| `list-drives-rest-api` | `sharePoint.listDrivesRestApi()` | — | 6 | Retrieve drives using SharePoint REST API v2.0 |
| `list-files-in-folder` | `sharePoint.listFilesInFolder()` | `--folder-name` | 6 | List files within a SharePoint folder (non-recursive; does not enumerate subfolders) |
| `list-item-attachments` | `sharePoint.listItemAttachments()` | `--item-id` `--list-title` | 1 | List all attachments for a SharePoint list item |
| `list-list-columns` | `sharePoint.listListColumns()` | `--list-id` | 5 | List all column definitions in a SharePoint list |
| `list-recycle-bin-items` | `sharePoint.listRecycleBinItems()` | — | 7 | List items in the SharePoint Recycle Bin |
| `list-site-drives` ·common | `sharePoint.listSiteDrives()` | — | 4 | Retrieve all document libraries (drives) in a SharePoint site |
| `list-site-groups` | `sharePoint.listSiteGroups()` | — | 7 | List SharePoint site groups for a site collection |
| `list-site-users` | `sharePoint.listSiteUsers()` | — | 7 | List users in the site collection |
| `list-sites` ·common | `sharePoint.listSites()` | — | 3 | Retrieve all SharePoint sites accessible to the user |
| `list-subfolders-in-folder` ·common | `sharePoint.listSubfoldersInFolder()` | `--folder-server-relative-url` | 4 | List immediate child folders within a SharePoint folder |
| `log-event` | `sharePoint.logEvent()` | `--event-type-id` `--item-id` `--scope-id` `--site-id` `--user` | 1 | Log custom usage analytics events in SharePoint for tracking user activities |
| `recycle-file` | `sharePoint.recycleFile()` | `--file-relative-url` `--folder-relative-url` | 1 | Move a file to the Recycle Bin |
| `recycle-list-item` | `sharePoint.recycleListItem()` | `--item-id` `--list-id` | 1 | Move a list item to the Recycle Bin |
| `rename-folder` | `sharePoint.renameFolder()` | `--new-name` `--server-relative-folder-url` | 3 | Renames a SharePoint folder by updating its list item metadata |
| `render-list-data-as-stream` | `sharePoint.renderListDataAsStream()` | `--list-server-relative-url` | 3 | Retrieve list items from SharePoint with rich metadata and formatting |
| `restore-drive-item-version` | `sharePoint.restoreDriveItemVersion()` | `--driveItemVersion-id` `--driveItem-id` `--drive-id` | 0 | Restore a previous version of a SharePoint drive item |
| `restore-recycle-bin-item` | `sharePoint.restoreRecycleBinItem()` | `--recyclebinitemid` | 1 | Restore a SharePoint Recycle Bin item |
| `search-files` ·common | `sharePoint.searchFiles()` | `--query` | 5 | Search for files across all SharePoint sites and OneDrive using Keyword Query Language |
| `search-query` | `sharePoint.searchQuery()` | `--querytext` | 6 | Search SharePoint content using Keyword Query Language (KQL) |
| `search-suggest` | `sharePoint.searchSuggest()` | `--querytext` | 11 | Get search query suggestions |
| `sharepoint-check-out-file` | `sharePoint.sharepointCheckOutFile()` | `--server-relative-path` | 1 | Check out a file in a document library |
| `sharepoint-create-folder` | `sharePoint.sharepointCreateFolder()` | `--folder-name` | 3 | Creates a new folder in SharePoint using the REST API |
| `sharepoint-create-list` | `sharePoint.sharepointCreateList()` | `--name` `--template` | 2 | Creates a new list in SharePoint using the REST API |
| `sharepoint-create-list-item` | `sharePoint.sharepointCreateListItem()` | `--item-properties` `--list-name` | 1 | Creates a new item in a SharePoint list |
| `sharepoint-create-user` ·deprecated | `sharePoint.sharepointCreateUser()` | `--email` | 4 | Use ensure-user instead (supports email param directly) |
| `sharepoint-find-user` | `sharePoint.sharepointFindUser()` | `--email` | 1 | Searches for a user in the SharePoint site by email address and returns their profile information if found |
| `sharepoint-remove-user` | `sharePoint.sharepointRemoveUser()` | `--email` | 1 | Removes a user from SharePoint |
| `undo-checkout-file` | `sharePoint.undoCheckoutFile()` | `--server-relative-path` | 1 | Undo a file checkout, discarding any changes made while checked out |
| `update-content-type` | `sharePoint.updateContentType()` | `--content-type-id` | 6 | Update a SharePoint content type's properties such as name, description, group, or hidden status |
| `update-drive-item` | `sharePoint.updateDriveItem()` | `--server-relative-url` | 3 | Update the properties of a drive item (file or folder) in SharePoint using SharePoint REST API |
| `update-file-item` ·common | `sharePoint.updateFileItem()` | `--fields` `--server-relative-url` | 3 | Update metadata fields on a SharePoint file item via its ListItemAllFields |
| `update-list` ·common | `sharePoint.updateList()` | `--list-guid` | 7 | Update properties of an existing SharePoint list |
| `update-list-item` ·common | `sharePoint.updateListItem()` | `--fields` `--item-id` `--list-title` | 3 | Update fields on an existing SharePoint list item |
| `update-site` ·common | `sharePoint.updateSite()` | — | 7 | Update properties of the current SharePoint site (web) |
| `upload-file` | `sharePoint.uploadFile()` | `--folder-relative-url` | 6 | Upload a file to a SharePoint document library or folder |
| `upload-from-url` ·common | `sharePoint.uploadFromUrl()` | `--file-url` | 7 | Fetch a file from a URL and upload it to SharePoint |
| `validate-credential` ·common | `sharePoint.validateCredential()` | — | 1 | Validate SharePoint credentials by attempting to retrieve the current user information |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
