Organization Users
Gets the list of all users that belong to the specified organization
Unique ID of the organization
123e4567-e89b-12d3-a456-426614174000
Page number for pagination
1
Example: 1
Number of items per page
20
Example: 20
Filter by specific role
member
Possible values: Filter by specific status
active
Possible values: Search users by name or email
john
List 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-426614174000
Unique ID of the existing user to add (optional, if user already exists)
456e7890-e89b-12d3-a456-426614174001
Email of the user
john.doe@example.com
First name of the user
John
Last name of the user
Doe
URL of the user's avatar (optional)
https://example.com/avatars/john.jpg
Role of the user in the organization
member
Possible values: Whether to send invitation email to the user
true
Example: true
Custom message for the invitation
¡Bienvenido al equipo de desarrollo!
Membership expiration date (optional)
2024-12-31T23:59:59Z
User 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-426614174000
Unique ID of the user
456e7890-e89b-12d3-a456-426614174001
Membership 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-426614174000
Unique ID of the user
456e7890-e89b-12d3-a456-426614174001
New role for the user
admin
Possible values: Membership status
active
Possible values: New membership expiration date
2024-12-31T23:59:59Z
Membership 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-426614174000
Unique ID of the user to remove
456e7890-e89b-12d3-a456-426614174001
User 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"
}