You can use the /oauth2PermissionGrants endpoint for that, but you do need the DelegatedPermissionGrant.ReadWrite.All scope (NOT covered in Directory.ReadWrite.All).
If you want to grant consent for specific users only, read here: https://www.michev.info/blog/post/6080/how-to-manage-entra-id-delegate-permissions-for-specific-users