Skip to content
Back

rror creating Appwrite user: User (role: guests) missing scopes (["users.write"])

  • 0
  • Functions
  • Web
  • REST API
martins4
5 Sep, 2025, 18:56

I do not understand, I have tryied everything tryable to make this error go away, I have absolutely no more ideas on how should I correct this. Anything can help. I even tryied using the dynamic api key that appwrite provides and does not work either. `` Initialize Appwrite client with dynamic API key from request headers """ # Get API key from request headers api_key = context.req.headers.get('x-appwrite-key')

TypeScript
if not api_key:
    # Fallback to environment variable or default key
    api_key = os.getenv('APPWRITE_API_KEY')
    context.log("Using fallback API key (no x-appwrite-key header found)")
else:
    context.log(f"Using dynamic API key from headers: {api_key[:20]}...")

# Initialize Appwrite client
client = Client()
client.set_endpoint('https://fra.cloud.appwrite.io/v1')
client.set_project('6567777aa4758208190f')
client.set_key(api_key)
client.set_self_signed(False)
TypeScript
Thanks in advance.
TL;DR
Developers are encountering an error creating an Appwrite user due to missing scopes. The user role is set as guests but lacks the necessary "users.write" scope. To resolve this, the developers need to ensure that the user has the required scope permissions. Additionally, it is recommended to format code using backticks for better readability.
Steven
5 Sep, 2025, 18:59

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more