Adding an account to an organization via api returns 200 but user is not in the list
Hi, I am hitting this api to add a user to an organization https://kinde.com/api/docs/#add-organization-users and I am getting a 200. I try to list the users for that Organization right after, I am getting a list of user but the one I have just added is not in the list. Everything happens in the same function so I know I am listing the same org code. Could there possibly be an issue with this endpoint?
16 Replies
Hi @.Mass.,
We cannot recreate this issue, would you be willing to share your code where you perform this, so we can debug further?
Ok, thanks I must be doing something wrong then. I can provide a code snippet later today.
I can get my team to look into the code snippet first thing Monday.
Sounds good, thank you 👍
here is the function, the first post returns a 200 so I expect the accountId to be in the list of the following listing, however the account is not there
ok, the confusion is that the api docs states that a 200 ok means the user is added successfully, however I did a test with postman, I am getting a 200 with a message that says the user was not added
@.Mass. Would you mind sharing the body and URL you sent in postman? So we can try replicate this issue.
sure no problem,
Is the user already in the organization you are trying to add them to?
ok yes, so I get that the second time I add the user to the same org. Which I guess it's fine to return the 200
it works with postman so there is definitely an issue in my code. I am happy to close this and resolve it on my end. Thank you for your help
No worries, @.Mass. .
Please don't hesitate to reach out for any further issues you have,
this is very interesting. When I run the request via postman I get the
User successfully added
message the first time and No users added
the following times. However with that code snippet I consistently get the No users added
message.
even when the user is actually not part of the org. I'll keep investigatingOkay, if you get stuck please let me know.
ok I think I found the issue was in my headers, I changed
accept
to Accept
and contentType
to Content-Type
and the request is working as expected. I am getting the User successfully added
message now.Ah good to know you fixed the issue by changing the headers.
We will revisit the API docs to make sure this is more clear.
Please don't hesitate to reach out again if you have any more issues.
thank you
No worries!