40166: Unidentified client cannot modify own messages

unidentified_client_cannot_modify_own_messages

A message update or delete was rejected because the client is unidentified — it has no clientId — but holds only the "own" form of the relevant capability, message-update-own or message-delete-own, which can never apply to a client that has no messages of its own.

What you should do

Update the client to set a clientId, so it connects as an identified client which can own messages that an "own" capability can match; or grant the client the corresponding "any" capabilitymessage-update-any or message-delete-any — which permits acting on messages regardless of author.

Why it happens

The message-update-own and message-delete-own capabilities only permit a client to change messages it published itself, matched by clientId. An unidentified client has no clientId, and so no messages of its own, leaving an "own" capability with nothing it is permitted to act on.

What you'll see

The error is reported with code 40166 and HTTP status 401. The message names the operation and the capability required, for example Unable to update message: anonymous clients require the 'message-update-any' capability (they cannot have own messages, so 'message-update-own' does not apply), and the equivalent for delete with message-delete-any.