You can apply sensitivity labels to messages by creating single-value properties. Sensitivity labels can be assigned by extending the PidTagSensitivity attribute, but the label values can only be values for three sensitivity levels. See this article for details.
To set extended properties, see Endpoints.
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.