Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Namespace: microsoft.graph
Request asynchronous cancellation of an agentic session. This operation uses the agentic session resource.
Permissions
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.
| Permission type | Least privileged permissions | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | Perception.Manage.All | Not available. |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | Perception.Manage.All | Not available. |
The signed-in user must have access to the requested resources. Granting an OAuth permission does not override the service's access controls.
HTTP request
POST /security/agenticSecurity/sessions/{session-id}/cancel
Request headers
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 202 Accepted response code, the current agentic session, and a Location header identifying the session. Acceptance doesn't mean cancellation has completed. Persisted session records aren't deleted.
Monitor cancellation
Get the same session to check its current state. You can use $select=id,status,statusDetail to request the identifier, overall processing status, and substatus. The Location URL also identifies this session.
- If status is
notStartedorrunning, cancellation isn't confirmed. Wait before reading the session again rather than polling in a tight loop. - A canceled session is reported as status
failedwith statusDetailstopped. See the session lifecycle table. - A
succeededsession completed successfully; that isn't evidence of cancellation. Afailedstatus with another or unavailable detail doesn't, by itself, confirm that cancellation caused the failure.
Use GET requests to monitor progress, not repeated cancellation requests. An HTTP 200 OK from Get session means the read succeeded, not that cancellation finished. No fixed cancellation duration is implied, and clients must handle unavailable optional detail values.
Examples
Request
The following example requests cancellation of a running investigation. The identifiers, session name, and response values are illustrative, not a captured live cancellation.
POST https://graph.microsoft.com/beta/security/agenticSecurity/sessions/6c27d97a-8003-4993-a6e3-e3a8b5a52d50/cancel
Response
The following example shows an accepted request while the session is still running.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/beta/security/agenticSecurity/sessions/6c27d97a-8003-4993-a6e3-e3a8b5a52d50
Content-Type: application/json
{
"id": "6c27d97a-8003-4993-a6e3-e3a8b5a52d50",
"status": "running",
"statusDetail": "inProgress",
"displayName": "Investigate incident 12345"
}