Following Bitwarden API docs I am trying to create new member via Bitwarden API by making a POST request to /public/members endpoint. The user gets created properly when collections array is empty.
However whenever I try to assign Users access to a specific collection by passing non empty collections array:
{
"email": "[email protected]",
"collections": [
{
"id": "xxxxxx-xxx-xxxx-xxxx-xxxxxxxx",
"readOnly": true
}
],
"type": 2,
"accessAll": false,
"externalId": "testUser_id"
}
The response is 400 Bad Request
I get:
{
"Object": "error",
"Message": "This user has already been invited.",
"Errors": null
}
Regardless of the 400 Response I can see the user created in Bitwarden and the collection assigned properly.
I have double checked and this user wasn’t existing prior to making the call. I have also removed the user and invited him again which also returned 400.
Why am I getting 400 Bad request
here? Is that a bug on API side or an issue with my request?