Organization Users

List users of an organization

get

Gets the list of all users that belong to the specified organization

Path parameters
organisationIdstring · uuidRequired

Unique ID of the organization

Example: 123e4567-e89b-12d3-a456-426614174000
Query parameters
pageinteger · min: 1Optional

Page number for pagination

Default: 1Example: 1
limitinteger · min: 1 · max: 100Optional

Number of items per page

Default: 20Example: 20
rolestring · enumOptional

Filter by specific role

Example: memberPossible values:
statusstring · enumOptional

Filter by specific status

Example: activePossible values:
searchstringOptional

Search users by name or email

Example: john
Responses
200

List of users retrieved successfully

application/json
get
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
  }
}

Add user to an organization

post

Adds a new user to the specified organization

Path parameters
organisationIdstring · uuidRequired

Unique ID of the organization

Example: 123e4567-e89b-12d3-a456-426614174000
Body
userIdstring · uuidOptional

Unique ID of the existing user to add (optional, if user already exists)

Example: 456e7890-e89b-12d3-a456-426614174001
emailstring · emailRequired

Email of the user

Example: john.doe@example.com
firstNamestringRequired

First name of the user

Example: John
lastNamestringRequired

Last name of the user

Example: Doe
avatarstring · uriOptional

URL of the user's avatar (optional)

Example: https://example.com/avatars/john.jpg
rolestring · enumRequired

Role of the user in the organization

Example: memberPossible values:
sendInvitationbooleanOptional

Whether to send invitation email to the user

Default: trueExample: true
customMessagestring · max: 500Optional

Custom message for the invitation

Example: ¡Bienvenido al equipo de desarrollo!
expiresAtstring · date-timeOptional

Membership expiration date (optional)

Example: 2024-12-31T23:59:59Z
Responses
201

User successfully added to organization

application/json
post
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"
  }
}

Get user membership information

get

Gets the membership information of a specific user in the organization

Path parameters
organisationIdstring · uuidRequired

Unique ID of the organization

Example: 123e4567-e89b-12d3-a456-426614174000
userIdstring · uuidRequired

Unique ID of the user

Example: 456e7890-e89b-12d3-a456-426614174001
Responses
200

Membership information retrieved successfully

application/json
get
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"
  }
}

Update user membership

put

Updates the role and permissions of a user in the organization

Path parameters
organisationIdstring · uuidRequired

Unique ID of the organization

Example: 123e4567-e89b-12d3-a456-426614174000
userIdstring · uuidRequired

Unique ID of the user

Example: 456e7890-e89b-12d3-a456-426614174001
Body
rolestring · enumOptional

New role for the user

Example: adminPossible values:
statusstring · enumOptional

Membership status

Example: activePossible values:
expiresAtstring · date-timeOptional

New membership expiration date

Example: 2024-12-31T23:59:59Z
Responses
200

Membership updated successfully

application/json
put
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"
  }
}

Remove user from an organization

delete

Removes a specific user from the organization

Path parameters
organisationIdstring · uuidRequired

Unique ID of the organization

Example: 123e4567-e89b-12d3-a456-426614174000
userIdstring · uuidRequired

Unique ID of the user to remove

Example: 456e7890-e89b-12d3-a456-426614174001
Responses
200

User successfully removed

application/json
delete
DELETE /memberships/orgs/{organisationId}/users/{userId} HTTP/1.1
Host: api.example.com
Accept: */*
{
  "success": true,
  "message": "User successfully removed from organization"
}