web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SharePoint REST API _a...
Power Automate
Answered

SharePoint REST API _api/sitepages/pages(49)/SavePageAsDraft Call Hangs Indefinitely

(0) ShareShare
ReportReport
Posted on by 29

Hi everyone,

I'm encountering an issue with the SharePoint Online REST API when trying to save a page using the following endpoint:

_api/sitepages/pages(49)/SavePageAsDraft

Problem:

The API call keeps running indefinitely and doesn't complete, even after several hours. Here are the details of my setup:

  • API Call Body:

     
    json
    {
    "__metadata": { "type": "SP.Data.SitePagesItem" },
    "CanvasContent1": "@{outputs('Translate_text_into_another_language_2')?['body/responsev2/predictionOutput/text']}"
    }

    (The CanvasContent1 value resolves to a string dynamically in my workflow.)

  • Headers:

    • Authorization: Bearer <token>
    • Content-Type: application/json;odata=verbose
    • Accept: application/json;odata=verbose

What I’ve Tried:

  1. Testing with a minimal payload like:

     
    json
    {
    "__metadata": { "type": "SP.Data.SitePagesItem" },
    "CanvasContent1": "Test content"
    }

    The issue persists even with this simplified payload.

  2. Ensuring that my access token is valid and has the necessary permissions.

  3. Verifying that other API calls (like GET requests to _api/sitepages) work fine.

  4. Setting timeouts on my client to avoid indefinite hanging (though this doesn’t solve the root issue).

Questions:

  1. Has anyone encountered similar issues with the SavePage API endpoint in SharePoint Online?
  2. Are there any specific configurations or known limitations of this endpoint that might cause it to hang?
  3. Could this be related to the size or complexity of the CanvasContent1 field? If so, how can I debug or optimize it?

Any guidance or suggestions would be greatly appreciated!

Thanks in advance for your help!

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at
    Hi @Noek,
     
    Can you try a different value in the type property of the __metadata?
     
    Try the below instead:
    "__metadata":{"type":"SP.Publishing.SitePage"}
     
  • Noek Profile Picture
    29 on at
     
    I changed this and still the flow is running a long time. 
    I'm doing it with th code below. i'm going to let my flow run and see which error I'm getting afterwards. Or if you have any other tips.
     
    "__metadata":{"type":"SP.Publishing.SitePage"}
    "CanvasContent1": "Test content"
  • Verified answer
    Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at
    Hi @Noek,
     
    You are missing a comma between the two properties. Additionally, the CanvasContent1 property expects an array with sections and web parts for the page.
     
    Below is an example which adds a Text web part with some text.
     
    {
      "__metadata": {
        "type": "SP.Publishing.SitePage"
      },
      "CanvasContent1":"[{\"controlType\":4,\"id\":\"ed2476c7-994a-4a07-a322-8afe873c05f2\",\"innerHTML\":\"<p>Power Automate ftw!<br></p>\",\"position\":{\"zoneIndex\":1,\"sectionIndex\":1,\"controlIndex\":0.5,\"sectionFactor\":8,\"layoutIndex\":1},\"addedFromPersistedData\":true}]",
      "Title": "Page with Text Web Part"
    }
     


    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, Bluesky profile or Youtube Channel

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard