
we have a function that we are attempting to create a document
const { databases } = await createAdminClient();
const newTournament = await databases.createDocument(
databaseId,
tournamentsCollectionId,
ID.unique(),
tournamentData
);
we are using our admin client const createAdminClient = async () => { const client = new Client() .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!) .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!) .setKey(process.env.NEXT_APPWRITE_KEY!);
return { get account() { return new Account(client); }, get databases() { return new Databases(client); }, get storage() { return new Storage(client); }, get users() { return new Users(client); }, }; };
this should allow us to overwrite all permissions. but we are getting this error Failed to create tournament: AppwriteException: The current user is not authorized to perform the requested action.

we have logged the database and client and we are not sure how we could be unauthorized to create a document. Any help to get this working would be great
Recommended threads
- File tokens regenerate each page reload
Hello, on appwrite 1.7.4, when I create a file token via the API Tokens(appwriteAdminClient)#createFileToken I get a secret, then when I check in the console t...
- CSV Import Shows Success but Data Not Ap...
I tried importing a CSV file into my PRODUCTS collection. The dashboard shows the message “Import to PRODUCTS completed successfully,” but no data appears in th...
- Console create row ui not passing ID.uni...
I'm getting an error saying the id is already used but it should be created with ID.unique() it doesn't seem to be reading the row ID field at all. I can't get ...
