Create a file or folder in SharePoint.

Creates a new file with optional content or an empty folder in a SharePoint document library.

yaml
type: "io.kestra.plugin.microsoft365.sharepoint.Create"

Create a folder in SharePoint

yaml
id: microsoft365_sharepoint_create_folder
namespace: company.team

tasks:
  - id: create_folder
    type: io.kestra.plugin.microsoft365.sharepoint.Create
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    siteId: "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
    driveId: "b!BCTBCKSP50iysCOFPU"
    parentId: "01BYE5RZ6QN3ZWBTURF3F43DSUNZYRZD5Q"
    name: "NewFolder"

Create a file with content in SharePoint

yaml
id: microsoft365_sharepoint_create_file
namespace: company.team

tasks:
  - id: create_file
    type: io.kestra.plugin.microsoft365.sharepoint.Create
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    siteId: "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
    driveId: "b!BCTBCKSP50iysCOFPU"
    parentId: "01BYE5RZ6QN3ZWBTURF3F43DSUNZYRZD5Q"
    name: "document.txt"
    content: "Hello, SharePoint!"
Properties

Azure Client ID

The client ID registered in Azure

Azure Client Secret

The client secret for the registered application

The name of the item.

The name of the file or folder to create.

Parent folder ID

The ID of the parent folder where the item will be created. Use 'root' for the root of the document library.

Sharepoint Site ID

The id of the

Azure Tenant ID

The Azure Active Directory tenant ID

The content of the file.

The content to be written to the new file. If not provided, an empty folder will be created.

Drive ID

The id of the document library within the SharePoint site. If not provided, the default document library will be used.

Default FILE
Possible Values
FILEFOLDER

Item type

Whether to create a FILE or FOLDER

The ID of the created item.

The name of the created item.

The web URL of the created item.