Sensitivity label cannot be assigned since provided sensitivity label is not available or supported.

Sandeep Y 0 Reputation points
2024-09-26T19:02:38.06+00:00

Hello,

When using the assignSensitivityLabel API call to assign an existing sensitivity label to a target file, I am getting an HTTP 400 response with the following error:

The label definitely exists and I use the ID as provided by the sensitivityLabels retrieval API endpoint.

What am I doing wrong?

{'error': {'code': 'invalidRequest',
  'message': 'Sensitivity label cannot be assigned since provided sensitivity label is not available or supported.',
  'innerError': {'code': 'badArgument',
   'date': '2024-09-26T18:46:35',
   'request-id': 'a06824da-0daf-4110-96b5-256744ced329',
   'client-request-id': 'a06824da-0daf-4110-96b5-256744ced329'}}}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,241 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,138 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Yakun Huang-MSFT 6,340 Reputation points Microsoft Vendor
    2024-09-27T06:28:39.0266667+00:00

    Hi @Sandeep Y

    According to your error message, check the related documents. The error may be caused by the following conditions:

    1.According to the documentation, there are several file types that support adding sensitivity labels. Please check whether your file is supported.

    User's image

    2.According to the documentation, it is also not possible to add sensiticity labels to your files when they are protected.

    User's image

    3.Finally, it's worth checking if you have sensitivity tags enabled for SharePoing and OneDrive.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


  2. Sandeep Y 0 Reputation points
    2024-09-30T17:34:11.42+00:00

    Hi @Yakun Huang-MSFT ,

    Thanks for your inputs here. I still cannot make it work:

    1. The target file is a docx indeed.
    2. The target file is not protected since I do not get a 423 response code. I get a 400 response code with the error details specified in the original question above.
    3. Sensitivity tags are indeed enabled as I do not see the yellow modal (as per the link) in the Purview dashboard. I also see the option to assign my published sensitivity tag to the file when open in Office for the web.

    Is there anything else that I can provide to help debug this? Thanks for your help here.

    0 comments No comments

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.