Organization Users
Gets the list of all users that belong to the specified organization
Unique ID of the organization
123e4567-e89b-12d3-a456-426614174000Page number for pagination
1Example: 1Number of items per page
20Example: 20Filter by specific role
memberPossible values: Filter by specific status
activePossible values: Search users by name or email
johnList of users retrieved successfully
Internal server error
GET /memberships/orgs/{organisationId}/users HTTP/1.1
Host: api.example.com
Accept: */*
{
"data": [
{
"id": "abc12345-def6-7890-abcd-ef1234567890",
"userId": "456e7890-e89b-12d3-a456-426614174001",
"organisationId": "123e4567-e89b-12d3-a456-426614174000",
"user": {
"id": "456e7890-e89b-12d3-a456-426614174001",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"avatar": "https://example.com/avatars/john.jpg"
},
"role": "admin",
"permissions": [
"read",
"write",
"delete",
"admin"
],
"status": "active",
"joinedAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-20T14:45:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
}
}Adds a new user to the specified organization
Unique ID of the organization
123e4567-e89b-12d3-a456-426614174000Unique ID of the existing user to add (optional, if user already exists)
456e7890-e89b-12d3-a456-426614174001Email of the user
john.doe@example.comFirst name of the user
JohnLast name of the user
DoeURL of the user's avatar (optional)
https://example.com/avatars/john.jpgRole of the user in the organization
memberPossible values: Whether to send invitation email to the user
trueExample: trueCustom message for the invitation
¡Bienvenido al equipo de desarrollo!Membership expiration date (optional)
2024-12-31T23:59:59ZUser successfully added to organization
Internal server error
POST /memberships/orgs/{organisationId}/users HTTP/1.1
Host: api.example.com
Content-Type: application/json
Accept: */*
Content-Length: 219
{
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"role": "admin",
"permissions": [
"read",
"write",
"delete",
"admin"
],
"metadata": {
"department": "Engineering",
"position": "Team Lead",
"startDate": "2024-01-15"
}
}{
"id": "abc12345-def6-7890-abcd-ef1234567890",
"userId": "456e7890-e89b-12d3-a456-426614174001",
"organisationId": "123e4567-e89b-12d3-a456-426614174000",
"user": {
"id": "456e7890-e89b-12d3-a456-426614174001",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"avatar": "https://example.com/avatars/john.jpg"
},
"role": "admin",
"permissions": [
"read",
"write",
"delete",
"admin"
],
"status": "active",
"joinedAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"metadata": {
"department": "Engineering",
"position": "Team Lead",
"startDate": "2024-01-15"
}
}Gets the membership information of a specific user in the organization
Unique ID of the organization
123e4567-e89b-12d3-a456-426614174000Unique ID of the user
456e7890-e89b-12d3-a456-426614174001Membership information retrieved successfully
Internal server error
GET /memberships/orgs/{organisationId}/users/{userId} HTTP/1.1
Host: api.example.com
Accept: */*
{
"id": "abc12345-def6-7890-abcd-ef1234567890",
"userId": "456e7890-e89b-12d3-a456-426614174001",
"organisationId": "123e4567-e89b-12d3-a456-426614174000",
"user": {
"id": "456e7890-e89b-12d3-a456-426614174001",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"avatar": "https://example.com/avatars/john.jpg"
},
"role": "admin",
"permissions": [
"read",
"write",
"delete",
"admin"
],
"status": "active",
"joinedAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-20T14:45:00Z",
"metadata": {
"department": "Engineering",
"position": "Team Lead",
"startDate": "2024-01-15"
}
}Updates the role and permissions of a user in the organization
Unique ID of the organization
123e4567-e89b-12d3-a456-426614174000Unique ID of the user
456e7890-e89b-12d3-a456-426614174001New role for the user
adminPossible values: Membership status
activePossible values: New membership expiration date
2024-12-31T23:59:59ZMembership updated successfully
Internal server error
PUT /memberships/orgs/{organisationId}/users/{userId} HTTP/1.1
Host: api.example.com
Content-Type: application/json
Accept: */*
Content-Length: 156
{
"role": "admin",
"permissions": [
"read",
"write",
"delete",
"admin"
],
"metadata": {
"department": "Engineering",
"position": "Team Lead",
"promotionDate": "2024-01-20"
}
}{
"id": "abc12345-def6-7890-abcd-ef1234567890",
"userId": "456e7890-e89b-12d3-a456-426614174001",
"organisationId": "123e4567-e89b-12d3-a456-426614174000",
"user": {
"id": "456e7890-e89b-12d3-a456-426614174001",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"avatar": "https://example.com/avatars/john.jpg"
},
"role": "admin",
"permissions": [
"read",
"write",
"delete",
"admin"
],
"status": "active",
"joinedAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-20T14:45:00Z",
"metadata": {
"department": "Engineering",
"position": "Team Lead",
"promotionDate": "2024-01-20"
}
}Removes a specific user from the organization
Unique ID of the organization
123e4567-e89b-12d3-a456-426614174000Unique ID of the user to remove
456e7890-e89b-12d3-a456-426614174001User successfully removed
Internal server error
DELETE /memberships/orgs/{organisationId}/users/{userId} HTTP/1.1
Host: api.example.com
Accept: */*
{
"success": true,
"message": "User successfully removed from organization"
}