Skip to content
Back

Team invite - 500 error - no email

  • 0
  • 2
  • Self Hosted
  • Flutter
  • Auth
Gac
8 Apr, 2026, 22:50

When executing

TypeScript
await _repository.teams.createMembership(
  teamId: event.listId,
  roles: ['member'],
  email: event.email,
  url: 'xxxx',
);

I see this in the appwrite container logs:

TypeScript
[0] /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php : 813 -> validate()

[1] /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php : 674 -> getArguments()

[2] /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php : 976 -> execute()

[3] /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php : 857 -> runInternal()

[4] /usr/src/code/app/http.php : 551 -> run()

[5] [internal function] :  -> {closure:/usr/src/code/app/http.php:513}()

Appwrite: 1.9.0 Flutter: 3.41.2

I have custom SMTP setup for the project and I was actually able to receive a few emails before it stopped working, and I haven't made a change to my code in any way.

I even removed all my functions as some of them had triggers on teams.create but still the same.

Is there any way to see more detailed logs?

Also attaching my appwrite doctor screenshot as it has some things that don't look right to me, but the console works and everything else seems to function.

TL;DR
Team invite is resulting in a 500 error with no email being received. Error traced to curl request with missing 'roles' parameter and invalid 'url' parameter. Solution: Edit the curl request to include 'roles' parameter and correct the 'url' value. Additionally, increase the rate limit for testing purposes and ensure the registered URL is set as a new Web platform on the project console dashboard.
9 Apr, 2026, 00:25

have you tried making membership via console? does it work there?

9 Apr, 2026, 08:35

Yes I can create it manually but I need programatic create and invite

9 Apr, 2026, 10:18

interesting, narrows down the problem. seems like some validation logic is failing

9 Apr, 2026, 10:18

one more test, can u try using some other sdk / direct curl call? this will isolate issue is in sdk or the api itself

9 Apr, 2026, 10:33

When trying to execute the request via curl I get:

TypeScript
{
  "message": "Param \"roles\" is not optional.",
  "code": 400,
  "type": "general_argument_invalid",
  "version": "1.9.0"
}

And this is how my curl request looks like:

TypeScript
curl -X POST https://appwrite.XXXX/v1/teams/XXXXX/memberships \
     -H "Content-Type: application/json" \
     -H "X-Appwrite-Response-Format: 1.9.0" \
     -H "X-Appwrite-Project: XXXXX" \
     -H "X-Appwrite-JWT: XXXXXXX" \
     -d '{
           "email": "igor@XXX",
           "roles": ["member"],
           "url": "https://example.com",
         }' -s | jq
9 Apr, 2026, 10:43

might be just a malformed curl request?

9 Apr, 2026, 10:50

I tried converting the one from official docs, if you can spot anything wrong with it do let me know

9 Apr, 2026, 11:02

try something like this

curl -X POST https://appwrite.XXXX/v1/teams/XXXXX/memberships
\ -H "Content-Type: application/json"
\ -H "X-Appwrite-Response-Format: 1.9.0"
\ -H "X-Appwrite-Project: XXXXX"
\ -H "X-Appwrite-JWT: XXXXXXX"
\ -d '{ "email": "igor@XXX", "roles": ["member"], "url": "https://example.com" }' -s | jq

9 Apr, 2026, 11:02

that trailing comma makes it invalid json

9 Apr, 2026, 11:02

and hence its not wokring

9 Apr, 2026, 11:03

will fix website docs 👍

9 Apr, 2026, 11:06

After using Postman to generate the request and fixing the trailing comma I think I found what the issue is:

TypeScript
{
    "message": "Invalid `url` param: Invalid URI. Register your new client (XXXX) as a new Web platform on your project console dashboard",
    "code": 400,
    "type": "general_argument_invalid",
    "version": "1.9.0"
}

But that info is not visible in sdk logs or anywhere else except this direct API call

I even have Membership res = await _repository.teams.createMembership(...); log(res.toString()) in my code and nothing is logged out.

9 Apr, 2026, 11:07

but if I specify my appwrites url that the email sends, also can the rate limit be increased on this endpoint somehow? Having only 10 req/hour is not good for development and testing.

9 Apr, 2026, 11:10

Also when trying to register this new URL as a platform what option should I pick ? As this url will probably point to a function which will execute the team invite accept logic

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