-3

When making a post request:

{
  "displayName": "My Team",
  "description": "",
  "visibility": "public",
  "members": [
    {
      "@odata.type": "#microsoft.graph.aadUserConversationMember",
      "userId": "**this_is_valid_i_checked**",
      "roles": [
        "owner"
      ],
      "email": "**this_user_has_a_license**",
      "[email protected]": "https://graph.microsoft.com/v1.0/users('**this_is_valid_i_checked**')",
      "[email protected]": "#microsoft.graph.aadUserConversationMember"
    }
  ],
  "[email protected]": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
}

I get:

{
  "error": {
    "code": "Forbidden",
    "message": "Failed to execute Templates backend request CreateTeamFromTemplateRequest. Request Url: https://teams.microsoft.com/fabric/apac/templates/api/team, Request Method: POST, Response Status Code: Forbidden, Response Headers: Strict-Transport-Security: max-age=2592000\r\nx-operationid: 613299497d5d4f689d0a45fad7ffbdf6\r\nx-telemetryid: 00-5e221501267c33453bc85a79dee8eb43-67faddc7aac300da-00\r\nX-MSEdge-Ref: Ref A: ABC3DEFEA55B491BBBF0B06EF20BE26E Ref B: MEL01EDGE0709 Ref C: 2025-09-19T08:41:35Z\r\nDate: Fri, 19 Sep 2025 08:41:37 GMT\r\n, ErrorMessage : {\"errors\":[{\"message\":\"Error when calling Middle Tier. Message: ''. Error code: 'Forbidden'. Status code: Forbidden.\",\"errorCode\":\"Unknown\"}],\"operationId\":\"613299497d5d4f689d0a45fad7ffbdf6\"}",
    "innerError": {
      "code": "AccessDenied",
      "message": "Failed to execute Templates backend request CreateTeamFromTemplateRequest. Request Url: https://teams.microsoft.com/fabric/apac/templates/api/team, Request Method: POST, Response Status Code: Forbidden, Response Headers: Strict-Transport-Security: max-age=2592000\r\nx-operationid: 613299497d5d4f689d0a45fad7ffbdf6\r\nx-telemetryid: 00-5e221501267c33453bc85a79dee8eb43-67faddc7aac300da-00\r\nX-MSEdge-Ref: Ref A: ABC3DEFEA55B491BBBF0B06EF20BE26E Ref B: MEL01EDGE0709 Ref C: 2025-09-19T08:41:35Z\r\nDate: Fri, 19 Sep 2025 08:41:37 GMT\r\n, ErrorMessage : {\"errors\":[{\"message\":\"Error when calling Middle Tier. Message: ''. Error code: 'Forbidden'. Status code: Forbidden.\",\"errorCode\":\"Unknown\"}],\"operationId\":\"613299497d5d4f689d0a45fad7ffbdf6\"}",
      "details": [
        {
          "code": "Unknown",
          "message": "Error when calling Middle Tier. Message: ''. Error code: 'Forbidden'. Status code: Forbidden.",
          "target": "Templates"
        }
      ],
      "date": "2025-09-19T08:41:38",
      "request-id": "61329949-7d5d-4f68-9d0a-45fad7ffbdf6",
      "client-request-id": "61329949-7d5d-4f68-9d0a-45fad7ffbdf6"
    }
  }
}

I have validated the user has a valid license and is active.

I have tried validating the user's licenses and subscriptions.

1
  • Worth mentioning, the user has all the appropriate permissions, namely ` Team.Create`. Commented Sep 21 at 7:56

1 Answer 1

1

Your JSON payload is attempting to update read-only properties of the member resource. It is also attempts to bind a template to a member ([email protected]) which isn't supported (not really sure what it would do).

The TL;DR here is that when you're binding a resource, you only provide the URI to the resource.

{
  "displayName": "My Team",
  "members": [
    {
      "@odata.type": "#microsoft.graph.aadUserConversationMember",
      "roles": [
        "owner"
      ],
      "[email protected]": "https://graph.microsoft.com/v1.0/users('**this_is_valid_i_checked**')",
    }
  ],
  "[email protected]": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
}

The userId and email properties are read-only virtual properties. They simply reflect data from the bound user resource so callers don't need to constantly $expand the user resources. Aside from being the most two most common properties callers might need, the user resource is large and expanding it would require additional calls on the backend.

As an aside, you can drop the description and visibility properties. Teams are public by default and description is an optional property.

Sign up to request clarification or add additional context in comments.

2 Comments

The default values are there because I'm trying to reproduce in a minimal way. I have tried without the binding elements (i.e replicating your body) and I get the same result :(
To be clear, it isn't the binding elements that are the problem, it is the userId and email properties. You can't assign read-only properties.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.