Cannot get complete status after using Graph API Copy

Kris Robbins 45 Reputation points
2025-08-07T06:17:43.4166667+00:00

We are using the Copy Graph API to copy a folder (and children).

This is working fine and we poll the returned URL (Location) for progress updates. This works fine as well and we can see that it is in Progress and Percentage complete. However, when copy is finished we cannot call the progress URL again to know it is complete. All calls once complete returns Unauthorised. It is as though the link expires immediately. Is this an error or is there another way to do this. Surely the URL should be valid at least for a short period after completion so we can check there were no errors.

Example API Call (short form - not complete)

string url = {_apiBaseUrl}v1.0/sites/{message.SiteId}/drives/{message.DriveId}/items/{message.FolderId}/copy

HttpResponseMessage response = await message.HttpClient.PostAsync(url, requestBodyJSONStringContent, cancellationToken);

response.Headers.TryGetValues("Location", out var locationHeader)

Loop below

var statusResponse = await httpClient.GetAsync(statusUrl);

var statusContent = await statusResponse.Content.ReadAsStringAsync();

Loop - Works fine until it complete as we get progress status and % complete (we don't know it is complete. We just start getting unauthorised. We can see that copy completed and all files are fine in SharePoint).

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

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.