We’re utilizing the organizations/{orgId}/invitations endpoint to invite users to an organization but we get a 400 error if the user already exists. Is there an endpoint that checks if the user exists and, if so, adds the member to the organization?
I tested with the POST https://{your domain}/api/v2/organizations/{org_id}/invitations endpoint with the below body scripts and did not see the error. The user existing in the organization received the invitation by email.
As far as I know, the only way to check if a user belongs to an organization via API is by sending the GET https://{your domain}/api/v2/organizations/{org_id}/members request to get the user list. This is the reference doc.
If you still observe this error, could you please provide your body scripts and the details of the error?