Series: Part 2 of 2 – SharePoint Automation in Power Automate

← Read Part 1: Triggers & Standard Actions


Introduction

Welcome back! In Part 1, you mastered triggers (what starts your flow) and standard actions (pre-built, no-code operations).

But what if you need to:

  • Rename a list without using the deprecated action?
  • Batch 50 item updates in one call?
  • Grant custom permissions to a folder?
  • Query data across sites?

Enter the Send an HTTP request to SharePoint action — your golden key to the full SharePoint REST API.

This action gives you 100% control. No more “I wish Power Automate had this action.” If SharePoint’s REST API can do it — you can do it.

In this advanced guide, we’ll:

  1. Master the HTTP action setup.
  2. Explore every major REST API endpoint with real Power Automate examples.
  3. Build pro-level patterns like batching, cross-site calls, and error handling.

Let’s go beyond the standard connector.


Section 1: Getting Started with the HTTP Action

What Is “Send an HTTP request to SharePoint”?

It’s a generic action that sends any HTTP request (GET, POST, PUT, DELETE, etc.) directly to SharePoint’s REST API.

InputRequired?Description
Site AddressYesTarget SharePoint site URL
MethodYesGET, POST, PATCH, DELETE, MERGE
UriYesREST endpoint (e.g., /_api/web/lists)
HeadersOptionalJSON: Accept, Content-Type, X-RequestDigest
BodyOptionalJSON payload for POST/PATCH

Authentication? Handled automatically via the SharePoint connector.


Step-by-Step: Your First HTTP Request

Goal: Get all lists in a site using REST (no standard action needed).

Flow Steps:

  1. Trigger: Manually trigger a flow
  2. Action: Send an HTTP request to SharePoint
    • Site: https://contoso.sharepoint.com/sites/HR
    • Method: GET
    • Uri: /_api/web/lists
    • Headers: { "Accept": "application/json;odata=verbose" }
  3. Parse JSON (to read results)
    • Schema (generate from sample): { "type": "object", "properties": { "d": { "type": "object", "properties": { "results": { "type": "array", "items": { /* List object */ } } } } } }
  4. Apply to eachresults → Log list Title

Output: Array of all lists with IDs, titles, item counts, etc.


Critical Headers You’ll Use Every Time

HeaderValueWhen to Use
Acceptapplication/json;odata=verboseAlways (for full JSON response)
Content-Typeapplication/json;odata=verbosePOST/PATCH bodies
X-RequestDigestFrom /_api/contextinfoRequired for POST/PATCH/DELETE
If-Match* or ETagPrevent overwrite conflicts
X-HTTP-MethodMERGE or DELETEUse with POST to simulate PATCH/DELETE

How to Get X-RequestDigest (Form Digest)

Must-have for write operations.

Add this action first:

  • Method: POST
  • Uri: /_api/contextinfo
  • Headers: Accept: application/json;odata=verbose

Extract digest:

body('Send_an_HTTP_request_to_SharePoint')?['d']?['GetContextWebInformation']?['FormDigestValue']


Store in a variable: varDigest


Section 2: All Available SharePoint REST API Calls

Here’s your complete cheat sheetevery major endpoint with:

  • Method
  • Endpoint
  • Purpose
  • Power Automate Uri
  • Example Body/Headers
  • Real Flow Snippet

Use odata=verbose for clarity. Switch to odata=nometadata in production for speed.


1. Site & Web Operations

MethodEndpointPurposeUri in FlowExample
GET/_api/webGet current site info/_api/webReturns Title, URL, ServerRelativeUrl
GET/_api/siteRoot site info/_api/siteUseful for tenant root
POST/_api/web/webinfos/addCreate subsite/_api/web/webinfos/addBody below

Create Subsite Example:

{
  "parameters": {
    "__metadata": { "type": "SP.WebInfoCreationInformation" },
    "Url": "projects",
    "Title": "Project Portal",
    "Description": "Team project site",
    "Language": 1033,
    "WebTemplate": "STS#3"
    }
}


2. Lists & Libraries

MethodEndpointPurposeUriNotes
GET/_api/web/listsAll lists/_api/web/listsFilter: $filter=Hidden eq false
GET/_api/web/lists/GetByTitle('Docs')Get by title/_api/web/lists/GetByTitle('Documents')Case-sensitive
POST/_api/web/listsCreate list/_api/web/listsBody: {"__metadata":{"type":"SP.List"},"Title":"Tasks","BaseTemplate":100}
POST + MERGE/_api/web/lists/GetByTitle('List')Update listSameIf-Match: *
POST + DELETE/_api/web/lists/GetByTitle('List')Delete listSameRequires site collection admin

3. Items (CRUD)

MethodEndpointPurposeUri Example
GET/_api/web/lists/GetByTitle('Tasks')/itemsAll itemsAdd $top=100, $filter=Status eq 'Open'
POST/_api/web/lists/GetByTitle('Tasks')/itemsCreateBody: {"__metadata":{"type":"SP.Data.TasksListItem"},"Title":"Fix bug"}
GET/_api/web/lists/GetByTitle('Tasks')/items(5)Get by ID
POST + MERGE/_api/web/lists/GetByTitle('Tasks')/items(5)UpdateIf-Match: *
POST + DELETE/_api/web/lists/GetByTitle('Tasks')/items(5)Delete

Update Item with Dynamic Type:

{
  "__metadata": {
    "type": "SP.Data.TasksListItem"
  },
  "Status": "In Progress"
}


How to get __metadata.type?

Do a GET on one item → copy from response.


4. Files & Folders

MethodEndpointPurposeUriNotes
GET/_api/web/GetFileByServerRelativeUrl('/sites/HR/Docs/report.pdf')File metadataUse encoded path
GET/_api/web/GetFileByServerRelativeUrl('/...')/$valueDownload fileBinary outputUse Compose + base64ToBinary
POST/_api/web/GetFolderByServerRelativeUrl('/Docs')/files/add(url='new.docx',overwrite=true)Upload small fileBody: binary content< 2MB
PUT/_api/web/GetFileByServerRelativeUrl('/Docs/big.pdf')/$valueUpload large fileBinary bodyUse chunkedUpload for >10MB
POST/_api/web/foldersCreate folderBody: {"__metadata":{"type":"SP.Folder"},"Name":"2025"}Nested OK

Upload File via HTTP (Small < 2MB):

  • Method: POST
  • Uri: /_api/web/GetFolderByServerRelativeUrl('/Documents')/files/add(url='@fileName',overwrite=true)
  • Body: body('Get_file_content') (from previous action)

5. Permissions & Sharing

MethodEndpointPurposeExample
GET/_api/web/lists/GetByTitle('Docs')/items(1)/roleassignmentsView permissions
POST/_api/web/lists/GetByTitle('Docs')/items(1)/breakroleinheritance(copyRoleAssignments=true)Break inheritance
POST/_api/web/lists/GetByTitle('Docs')/items(1)/roleassignments/addroleassignment(principalid=12,roledefid=1073741827)Grant Editroledefid: 1073741826=Read, 1827=Edit, 1829=Full

6. Cross-Site & Batch Requests

Cross-Site Call

Use SP.AppContextSite(@target):

/_api/SP.AppContextSite(@target)/web/title?@target='<https://othersite.sharepoint.com/sites/Team>'

Batch Requests (Run 100 ops in 1 call)

Structure:

--batch_{guid}
Content-Type: multipart/mixed; boundary=changeset_{guid}

--changeset_{guid}
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /_api/web/lists/GetByTitle('Tasks')/items HTTP/1.1
{ "Title": "Task 1" }

--changeset_{guid}--
--batch_{guid}--


Use Compose action to build full batch body.

See full example: MS Docs Batch


7. Search, Social, Fields & More

EndpointPurpose
/_api/search/query?querytext='contract'Site search
/_api/web/lists/GetByTitle('Tasks')/fieldsGet all columns
/_api/social.following/followedFollowed sites
/_api/web/Lists/GetByTitle('List')/ContentTypesContent types

Section 3: Advanced Tips & Real-World Examples

Example 1: Batch Create 50 List Items

Use batch + changeset → 1 HTTP call instead of 50

Example 2: Auto-Provision Project Site

  1. HTTP: Create subsite
  2. HTTP: Create “Tasks” list
  3. HTTP: Grant access to the project team
  4. HTTP: Upload template files

Example 3: Sync Metadata Across Sites

  • Trigger: File created
  • HTTP (cross-site): Update item in central tracker

Troubleshooting Cheat Sheet

ErrorCauseFix
403 ForbiddenPermissionsRun as site owner or check path (in uri – /sites not sites)
400 Bad RequestWrong __metadata.typeCopy from GET response
411 Length RequiredMissing digestAdd X-RequestDigest
429 Too Many RequestsThrottlingAdd Delay or reduce concurrency
Invalid JSONMalformed bodyUse json() expression
412 ETag Valuemissing If-Match: * in HeaderAdd If-Match: * in Header

Conclusion & Next Steps

You now own the full SharePoint REST API in Power Automate.

You Can Now:


Call any SharePoint endpoint


Batch hundreds of operations


Work cross-site


Replace deprecated actions


Build enterprise-grade automations



Your Action Plan

  1. Try this now: Use HTTP to create a list called TestList_{{utcNow}}
  2. Build a batch flow for bulk item creation
  3. Replace one deprecated action in an old flow
  4. Join the community: Share your HTTP flow on the Power Automate Community

Resources


What will you build with HTTP actions?

Comment below — let’s feature your flow in the next post! 🔥


Leave a comment

Copyright © 2025 Dynamics Services Group