Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Create a planner task with GraphAPI in Automate, in ANY Team

(0) ShareShare
ReportReport
Posted on by 37

Hi all, looking for a bit of assistance with Planner tasks via Graph.

 

I’m wanting to create a task in a planner that’s in a Team that I don’t belong to (hence Graph, rather than the “Create a task” action). I already know the Team ID, SP Site ID, Plan ID, Bucket ID, and I have a set of credentials (tenant, client, secret) which has lots of Graph (including Tasks.ReadWrite, Group.ReadWrite.All) permitted - but Application permissions aren't allowed for Create task. I have also tried the bearer token authorization. But I just can’t seem to get it to create the task when I don’t belong to the Team. It works fine when I belong to it, but I’m working on this for a different business area, so I don’t/won’t belong to the Team once this is done.

I know I could export the flow and get someone that IS in the Team to set it up on their account to run....however;

  • I can't guarantee that they'll always be in the Team
  • they won't have a premium automate account (I do)

 

Is there any way to create a task, in any team (when supplied with the required IDs)?

  • Nao_ Profile Picture
    121 on at
    Re: Create a planner task with GraphAPI in Automate, in ANY Team

    Hello @chris421 ,
    I have the same problem, did you found how to solve it ?
    Thanks!

  • chris421 Profile Picture
    37 on at
    Re: Create a planner task with Automate, in a Team I don't belong to

    Just adding in some further details and screenshots....

     

    chris421_1-1662028059336.png

    chris421_2-1662028085491.png

    Create planner task URL is:

    https://graph.microsoft.com/v1.0/planner/tasks

    Body is: 

    {
     "planId": "@{variables('BITeam_PlanID')}",
     "title": "@{outputs('Get_response_details')?['body/ra5443cd709864ddab6136a04e6796478']} @{formatDateTime(utcNow(),'ddMMyyHHmmss')}"
    }

     

    chris421_0-1662027979868.png

     

     

    {
     "statusCode": 401,
     "headers": {
     "Transfer-Encoding": "chunked",
     "Vary": "Accept-Encoding",
     "Strict-Transport-Security": "max-age=31536000",
     "request-id": "a14f2e35-db9e-439c-b805-77c9a50d889a",
     "client-request-id": "a14f2e35-db9e-439c-b805-77c9a50d889a",
     "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"West Europe\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"003\",\"RoleInstance\":\"AM1PEPF0001600F\"}}",
     "X-ProxyCluster": "neu-000.tasks.osi.office.net",
     "X-OfficeCluster": "neu-000.tasks.osi.office.net",
     "Date": "Wed, 24 Aug 2022 09:42:23 GMT",
     "Content-Type": "application/json",
     "Content-Length": "1572"
     },
     "body": {
     "error": {
     "code": "UnknownError",
     "message": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"/>\r\n<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div class=\"content-container\"><fieldset>\r\n <h2>401 - Unauthorized: Access is denied due to invalid credentials.</h2>\r\n <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\r\n </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n",
     "innerError": {
     "date": "2022-08-24T09:42:23",
     "request-id": "a14f2e35-db9e-439c-b805-77c9a50d889a",
     "client-request-id": "a14f2e35-db9e-439c-b805-77c9a50d889a"
     }
     }
     }
    }

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1