diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 791ab0fe0e..5ef8eb5021 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -225,6 +225,13 @@ Http::init() API_KEY_ACCOUNT => ACTOR_TYPE_KEY_ACCOUNT, default => ACTOR_TYPE_KEY_ORGANIZATION, }); + + if ($apiKey->getType() === API_KEY_STANDARD || $apiKey->getType() === API_KEY_ORGANIZATION) { + $userClone + ->setAttribute('$id', $dbKey->getId()) + ->setAttribute('$sequence', $dbKey->getSequence()); + } + $auditContext->user = $userClone; }