APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
The schedule creation process conforms to the One API guideline for resource based long running operations (RELO).
When clients use the PUT method, if the schedule is provisioned, the operation replaces the schedule; otherwise, the operation starts the schedule provisioning process in the background.
During schedule provisioning, clients can use the GET method to get the schedule and look at the provisionStatus property for the current state of the provisioning. If the provisioning failed, clients can get additional information from the provisionStatusCode property.
Clients can also inspect the configuration of the schedule.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
PUT https://graph.microsoft.com/beta/teams/{teamId}/schedule
Content-type: application/json
{
"enabled": true,
"timeZone": "America/Chicago"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Schedule
{
Enabled = true,
TimeZone = "America/Chicago",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Schedule.PutAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
mgc-beta teams schedule put --team-id {team-id} --body '{\
"enabled": true,\
"timeZone": "America/Chicago"\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewSchedule()
enabled := true
requestBody.SetEnabled(&enabled)
timeZone := "America/Chicago"
requestBody.SetTimeZone(&timeZone)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
schedule, err := graphClient.Teams().ByTeamId("team-id").Schedule().Put(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Schedule schedule = new Schedule();
schedule.setEnabled(true);
schedule.setTimeZone("America/Chicago");
Schedule result = graphClient.teams().byTeamId("{team-id}").schedule().put(schedule);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Schedule;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Schedule();
$requestBody->setEnabled(true);
$requestBody->setTimeZone('America/Chicago');
$result = $graphServiceClient->teams()->byTeamId('team-id')->schedule()->put($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.schedule import Schedule
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Schedule(
enabled = True,
time_zone = "America/Chicago",
)
result = await graph_client.teams.by_team_id('team-id').schedule.put(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Schedule
{
Enabled = true,
TimeZone = "America/Chicago",
ProvisionStatus = OperationStatus.Completed,
ProvisionStatusCode = null,
OpenShiftsEnabled = true,
SwapShiftsRequestsEnabled = true,
OfferShiftRequestsEnabled = true,
TimeOffRequestsEnabled = true,
StartDayOfWeek = DayOfWeekObject.Tuesday,
ActivitiesIncludedWhenCopyingShiftsEnabled = true,
IsCrossLocationShiftsEnabled = true,
IsCrossLocationShiftRequestApprovalRequired = true,
TimeClockEnabled = true,
TimeClockSettings = new TimeClockSettings
{
ApprovedLocation = new GeoCoordinates
{
Altitude = 1024.13d,
Latitude = 26.13246d,
Longitude = 24.34616d,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Schedule.PutAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewSchedule()
enabled := true
requestBody.SetEnabled(&enabled)
timeZone := "America/Chicago"
requestBody.SetTimeZone(&timeZone)
provisionStatus := graphmodels.COMPLETED_OPERATIONSTATUS
requestBody.SetProvisionStatus(&provisionStatus)
provisionStatusCode := null
requestBody.SetProvisionStatusCode(&provisionStatusCode)
openShiftsEnabled := true
requestBody.SetOpenShiftsEnabled(&openShiftsEnabled)
swapShiftsRequestsEnabled := true
requestBody.SetSwapShiftsRequestsEnabled(&swapShiftsRequestsEnabled)
offerShiftRequestsEnabled := true
requestBody.SetOfferShiftRequestsEnabled(&offerShiftRequestsEnabled)
timeOffRequestsEnabled := true
requestBody.SetTimeOffRequestsEnabled(&timeOffRequestsEnabled)
startDayOfWeek := graphmodels.TUESDAY_DAYOFWEEK
requestBody.SetStartDayOfWeek(&startDayOfWeek)
activitiesIncludedWhenCopyingShiftsEnabled := true
requestBody.SetActivitiesIncludedWhenCopyingShiftsEnabled(&activitiesIncludedWhenCopyingShiftsEnabled)
isCrossLocationShiftsEnabled := true
requestBody.SetIsCrossLocationShiftsEnabled(&isCrossLocationShiftsEnabled)
isCrossLocationShiftRequestApprovalRequired := true
requestBody.SetIsCrossLocationShiftRequestApprovalRequired(&isCrossLocationShiftRequestApprovalRequired)
timeClockEnabled := true
requestBody.SetTimeClockEnabled(&timeClockEnabled)
timeClockSettings := graphmodels.NewTimeClockSettings()
approvedLocation := graphmodels.NewGeoCoordinates()
altitude := float64(1024.13)
approvedLocation.SetAltitude(&altitude)
latitude := float64(26.13246)
approvedLocation.SetLatitude(&latitude)
longitude := float64(24.34616)
approvedLocation.SetLongitude(&longitude)
timeClockSettings.SetApprovedLocation(approvedLocation)
requestBody.SetTimeClockSettings(timeClockSettings)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
schedule, err := graphClient.Teams().ByTeamId("team-id").Schedule().Put(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Schedule schedule = new Schedule();
schedule.setEnabled(true);
schedule.setTimeZone("America/Chicago");
schedule.setProvisionStatus(OperationStatus.Completed);
schedule.setProvisionStatusCode(null);
schedule.setOpenShiftsEnabled(true);
schedule.setSwapShiftsRequestsEnabled(true);
schedule.setOfferShiftRequestsEnabled(true);
schedule.setTimeOffRequestsEnabled(true);
schedule.setStartDayOfWeek(DayOfWeek.Tuesday);
schedule.setActivitiesIncludedWhenCopyingShiftsEnabled(true);
schedule.setIsCrossLocationShiftsEnabled(true);
schedule.setIsCrossLocationShiftRequestApprovalRequired(true);
schedule.setTimeClockEnabled(true);
TimeClockSettings timeClockSettings = new TimeClockSettings();
GeoCoordinates approvedLocation = new GeoCoordinates();
approvedLocation.setAltitude(1024.13d);
approvedLocation.setLatitude(26.13246d);
approvedLocation.setLongitude(24.34616d);
timeClockSettings.setApprovedLocation(approvedLocation);
schedule.setTimeClockSettings(timeClockSettings);
Schedule result = graphClient.teams().byTeamId("{team-id}").schedule().put(schedule);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Schedule;
use Microsoft\Graph\Beta\Generated\Models\OperationStatus;
use Microsoft\Graph\Beta\Generated\Models\DayOfWeek;
use Microsoft\Graph\Beta\Generated\Models\TimeClockSettings;
use Microsoft\Graph\Beta\Generated\Models\GeoCoordinates;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Schedule();
$requestBody->setEnabled(true);
$requestBody->setTimeZone('America/Chicago');
$requestBody->setProvisionStatus(new OperationStatus('completed'));
$requestBody->setProvisionStatusCode(null);
$requestBody->setOpenShiftsEnabled(true);
$requestBody->setSwapShiftsRequestsEnabled(true);
$requestBody->setOfferShiftRequestsEnabled(true);
$requestBody->setTimeOffRequestsEnabled(true);
$requestBody->setStartDayOfWeek(new DayOfWeek('tuesday'));
$requestBody->setActivitiesIncludedWhenCopyingShiftsEnabled(true);
$requestBody->setIsCrossLocationShiftsEnabled(true);
$requestBody->setIsCrossLocationShiftRequestApprovalRequired(true);
$requestBody->setTimeClockEnabled(true);
$timeClockSettings = new TimeClockSettings();
$timeClockSettingsApprovedLocation = new GeoCoordinates();
$timeClockSettingsApprovedLocation->setAltitude(1024.13);
$timeClockSettingsApprovedLocation->setLatitude(26.13246);
$timeClockSettingsApprovedLocation->setLongitude(24.34616);
$timeClockSettings->setApprovedLocation($timeClockSettingsApprovedLocation);
$requestBody->setTimeClockSettings($timeClockSettings);
$result = $graphServiceClient->teams()->byTeamId('team-id')->schedule()->put($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.schedule import Schedule
from msgraph_beta.generated.models.operation_status import OperationStatus
from msgraph_beta.generated.models.day_of_week import DayOfWeek
from msgraph_beta.generated.models.time_clock_settings import TimeClockSettings
from msgraph_beta.generated.models.geo_coordinates import GeoCoordinates
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Schedule(
enabled = True,
time_zone = "America/Chicago",
provision_status = OperationStatus.Completed,
provision_status_code = None,
open_shifts_enabled = True,
swap_shifts_requests_enabled = True,
offer_shift_requests_enabled = True,
time_off_requests_enabled = True,
start_day_of_week = DayOfWeek.Tuesday,
activities_included_when_copying_shifts_enabled = True,
is_cross_location_shifts_enabled = True,
is_cross_location_shift_request_approval_required = True,
time_clock_enabled = True,
time_clock_settings = TimeClockSettings(
approved_location = GeoCoordinates(
altitude = 1024.13,
latitude = 26.13246,
longitude = 24.34616,
),
),
)
result = await graph_client.teams.by_team_id('team-id').schedule.put(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.