Edit

Upload attachment content

Namespace: microsoft.graph.security.caseManagement

Important

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.

Upload binary content for an attachment. Create the attachment metadata first by using Create case attachment.

The maximum file size is 100 MB. Upload files in chunks of no more than 1 MB. For files larger than 1 MB, send one PUT request for each chunk until all byte ranges are uploaded.

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) CaseManagement.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application CaseManagement.ReadWrite.All Not available.

Important

For delegated access using work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role that grants the permissions required for this operation. This API supports the following built-in roles:

  • Global Reader
  • Security Reader
  • Security Operator
  • Security Administrator

HTTP request

PUT /security/caseManagement/cases/{caseId}/attachments/{attachmentId}/content

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Range The zero-based, inclusive byte range of the chunk and the total file size, in the format bytes {start}-{end}/{total}. The total must match the attachment fileSize. Required.
Content-Type application/octet-stream. Required.

Request body

Supply a binary content chunk of no more than 1 MB.

Response

When all chunks are uploaded successfully, this method returns a 201 Created response code and no response body.

After upload completes, the service asynchronously scans the attachment for malware. The content isn't available to download until scanning completes successfully.

Examples

Request

The following example uploads an 11-byte file in one chunk.

PUT https://graph.microsoft.com/beta/security/caseManagement/cases/{caseId}/attachments/{attachmentId}/content
Content-Type: application/octet-stream
Content-Range: bytes 0-10/11

hello world

Response

The following example shows the response after the upload completes.

HTTP/1.1 201 Created