Create Bookings Business pages using MgGraph

Peter 280 Reputation points
2025-05-24T15:54:51.75+00:00

Hi

I am trying to create Bookings Business pages for several users using New-MgBookingBusiness.
The cmd Get-MgBookingBusiness lists all existing booking pages.

Itried to create a new booking page using the following cmd:

Connect-MgGraph -ContextScope Process -Scopes "Bookings.Manage.All", "Bookings.Read.All", "Bookings.ReadWrite.All", "BookingsAppointment.ReadWrite.All"
$params = @{
displayName = "Fourth Coffee"
address = @{
postOfficeBox = "P.O. Box 123"
street = "4567 Main Street"
city = "Buffalo"
state = "NY"
countryOrRegion = "USA"
postalCode = "98052"
}
phone = "206-555-0100"
email = "******@fourthcoffee.com"
#webSiteUrl = "https://www.fourthcoffee.com"
#defaultCurrencyIso = "USD"
}
New-MgBookingBusiness -BodyParameter $params

And I get the following error:

New-MgBookingBusiness : Internal Server Error
Status: 500 (InternalServerError)
ErrorCode: InternalServerError
Date: 2025-05-24T15:43:21
Headers:
Transfer-Encoding             : chunked
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : d684f0b0-3816-41af-b741-9ca87b4c8daa
client-request-id             : 3a8f2d47-d507-47b7-81a8-0515708eb507
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"US North","Slice":"E","Ring":"3","ScaleUnit":"001","RoleInstance":"ZRH2EPF000000E8"}}
Date                          : Sat, 24 May 2025 15:43:21 GMT
In Zeile:16 Zeichen:1
+ New-MgBookingBusiness -BodyParameter $params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ Headers = , b...okingBusiness }:<>f__AnonymousType0`2) [New-MgBookingBusiness_Create], Exception
    + FullyQualifiedErrorId : InternalServerError,Microsoft.Graph.PowerShell.Cmdlets.NewMgBookingBusiness_Create

Any idea?

Regards
Peter

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. SrideviM 5,710 Reputation points Microsoft External Staff Moderator
    2025-05-26T08:57:12.75+00:00

    Hello Peter,

    I understand you're trying to create a Bookings Business using New-MgBookingBusiness and are running into a 500 Internal Server Error.

    This error usually occurs when the signed-in user doesn’t fully meet the API’s requirements. The Microsoft Bookings API only supports delegated access using a work or school account.

    Application type permissions and personal Microsoft accounts are not supported:

    User's image

    The user must have a Microsoft 365 license that includes Microsoft Bookings, and the license must be fully provisioned. Even if the license is assigned, the API will fail if provisioning has not completed.

    You can verify the license status using:

    $me = Get-MgUser -UserId (Get-MgContext).Account
    Get-MgUserLicenseDetail -UserId $me.Id | Select-Object -ExpandProperty ServicePlans | Where-Object { $_.ServicePlanName -like "*Bookings*" }
    

    User's image

    If the ProvisioningStatus is not Success, that would likely be the cause of the error.

    In my test, I removed the -ContextScope Process parameter and signed in with a user who has a valid license and admin role. The API call returned a successful response:

    Connect-MgGraph -Scopes "Bookings.Manage.All", "Bookings.Read.All", "Bookings.ReadWrite.All", "BookingsAppointment.ReadWrite.All"
    
    $params = @{
    displayName = "Fourth Coffee"
    address = @{
    postOfficeBox = "P.O. Box 123"
    street = "4567 Main Street"
    city = "Buffalo"
    state = "NY"
    countryOrRegion = "USA"
    postalCode = "98052"
    }
    phone = "206-555-0100"
    email = "******@fourthcoffee.com"
    #webSiteUrl = "https://www.fourthcoffee.com"
    #defaultCurrencyIso = "USD"
    }
    
    New-MgBookingBusiness -BodyParameter $params
    

    User's image

    Let me know if you’re still running into issues or have additional questions.

    Hope this helps!


    If this answers your query, do click Accept Answer and Yes for was this answer helpful, which may help members with similar questions.

    User's image

    If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.