An error occurred: app.66b0ff530019305177ae@service.cloud.appwrite.io (role: applications) missing
- 0
- Cloud

When creating jwt token I get this error
An error occurred: app.66b0ff530019305177ae@service.cloud.appwrite.io (role: applications) missing scope (account)
Here's my code.
try { $session = $account->createEmailPasswordSession($email, $password); $jwt = $account->createJWT();
return $context->res->json([
'status' => 'success',
'session' => $session,
'jwt' => $jwt
]);
} catch (Exception $e) {
$context->log('General Exception: ' . $e->getMessage());
return $context->res->json([
'status' => 'error',
'message' => 'An error occurred: ' . $e->getMessage()
]);
}
Session gets created successfully but jwt token returns the above error

Did you set an API key?

Yes I did. Everything was working perfectly until I add this line $jwt = $account->createJWT();

If I comment it out my code works without any issue

Try removing the API key

(Unless there are other places in your code you need it?)
Recommended threads
- Retreive collection from archived projec...
Hey there, so I archivef a project on 1st September 2025 and now I need the data from one of its collections. Any way I can retrieve it?
- Exposing project id and endpoint on GitH...
Is it best practice to expose your project id and endpoint in your appwrite.js file when publishing an NextJS or Angular project. If you use a .env file, that i...
- Insights🐛 Bug Report: Missing Tables AP...
Hi. First time appwrite user. i'm building a new mobile app with react-native & expo and decided to use appwrite as a tech for this app. i found the react-nativ...
