Members
Members represent the relationship between user and organization. It is possible to add an existing user from another organization to further organizations.
Get Members
GET "https://account.ezeep.com/partner/v1/organizations/<organization_id>/members/"
Attribute | Type | Parameter | Required | Description |
---|---|---|---|---|
organization_id | str | path | Yes | Organization UUID |
expand | str | query | No | Expand the field to its fully serialised counterpart. If available, multiple fields can be expanded. |
limit | int | query | No | Number of results to return per page. |
offset | int | query | No | The initial index from which to return the results. |
Example Request
curl --location 'https://account.ezeep.com/partner/v1/organizations/b568feca-f8ad-11ed-be56-0242ac120002/members/?expand=user' \
--header 'Authorization: Bearer ezJ0eXAiOiJKV1QeLCJhbGdiOiJSUzI1NiJ9....'
Status Code | Description |
---|---|
200 |
OK |
Example Response
{
"count": 1,
"next": null,
"previous": null,
"results":
[
{
"user":
{
"id": "7bb660df-6ef7-4654-cd38-89583f2f5bca",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"created": "2023-05-08T09:00:56.664969Z",
"is_verified": true,
"preferred_language": "en"
},
"roles":
[
"admin"
]
}
]
}
Add Members
Use this endpoint to add existing users from other organizations to this organization. Note only users from an organisation that you manage can be added to a new organization. To add users from organizations you do not manage, use the userInvitation Endpoint. The users can then accept the invitation with an existing or new ezeep account.
GET "https://account.ezeep.com/partner/v1/organizations/<organization_id>/members/"
Attribute | Type | Parameter | Required | Description |
---|---|---|---|---|
organization_id | str | path | Yes | Organization UUID |
Example Request
curl --location 'https://account.ezeep.com/partner/v1/organizations/b568feca-f8ad-11ed-be56-0242ac120002/members/?expand=user' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ezJ0eXAiOiJKV1QeLCJhbGdiOiJSUzI1NiJ9....' \
--data
'{
"user": "7bb660df-6ef7-4654-cd38-89583f2f5bca",
"roles":
[
"admin"
]
}'
Status Code | Description |
---|---|
201 |
Created |
Example Response
{
"user": "7bb660df-6ef7-4654-cd38-89583f2f5bca",
"roles":
[
"admin"
]
}
Member Of An Organization
GET "https://account.ezeep.com/partner/v1/organizations/<organization_id>/members/<user_id>"
Attribute | Type | Parameter | Required | Description |
---|---|---|---|---|
organization_id | str | path | Yes | Organization UUID |
user_id | str | path | Yes | User UUID |
expand | str | query | No | Expand the field to its fully serialised counterpart. If available, multiple fields can be expanded. |
Example Request
curl --location 'https://account.ezeep.com/partner/v1/organizations/b568feca-f8ad-11ed-be56-0242ac120002/members/7bb660df-6ef7-4654-cd38-89583f2f5bca/?expand=user' \
--header 'Authorization: Bearer ezJ0eXAiOiJKV1QeLCJhbGdiOiJSUzI1NiJ9....'
Status Code | Description |
---|---|
200 |
OK |
Example Response
{
"user":
{
"id": "7bb660df-6ef7-4654-cd38-89583f2f5bca",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"created": "2023-05-08T09:00:56.664969Z",
"is_verified": true,
"preferred_language": "en"
},
"roles":
[
"admin"
]
}
Update Member Role
PATCH "https://account.ezeep.com/partner/v1/organizations/<organization_id>/members/<user_id>"
Attribute | Type | Parameter | Required | Description |
---|---|---|---|---|
organization_id | str | path | Yes | Organization UUID |
user_id | str | path | Yes | User UUID |
Example Request
curl --location --request PATCH 'https://account.ezeep.com/partner/v1/organizations/b568feca-f8ad-11ed-be56-0242ac120002/members/7bb660df-6ef7-4654-cd38-89583f2f5bca/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ezJ0eXAiOiJKV1QeLCJhbGdiOiJSUzI1NiJ9....' \
--data
'{
"roles":
[
"user"
]
}'
Status Code | Description |
---|---|
200 |
OK |
Example Response
{
"user":
{
"id": "7bb660df-6ef7-4654-cd38-89583f2f5bca",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"created": "2023-05-08T09:00:56.664969Z",
"is_verified": true,
"preferred_language": "en"
},
"roles":
[
"user"
]
}
Remove Member
Note that deleting the membership also deletes the user if the user is not in any other membership. Furthermore, there must always be at least one admin in the organization.
DELETE "https://account.ezeep.com/partner/v1/organizations/<organization_id>/members/<user_id>"
Attribute | Type | Parameter | Required | Description |
---|---|---|---|---|
organization_id | str | path | Yes | Organization UUID |
user_id | str | path | Yes | User UUID |
Example Request
curl --location --request DELETE 'https://account.ezeep.com/partner/v1/organizations/b568feca-f8ad-11ed-be56-0242ac120002/members/7bb660df-6ef7-4654-cd38-89583f2f5bca/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ezJ0eXAiOiJKV1QeLCJhbGdiOiJSUzI1NiJ9....'
Status Code | Description |
---|---|
204 |
No Content |
Example Response
No Response