HumHub - User API (1.0.0)

Download OpenAPI specification:

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub user module API reference.

User

API to access and manage user information.

Find all users

query Parameters
page
integer >= 0

The number of page of the result set.

limit
integer [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Add a new user to the installation

Request Body schema: application/json
required

User object to be added to the installation

required
object (Account)
required
object (Profile)
required
object (Password)

Responses

Request samples

Content type
application/json
{
  • "account": {
    },
  • "profile": {
    },
  • "password": {
    }
}

Get user by username

query Parameters
username
required
string

The username of user

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "display_name": "John Doe",
  • "account": {
    },
  • "profile": {
    }
}

Get user by email

query Parameters
email
required
string

The email of user

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "display_name": "John Doe",
  • "account": {
    },
  • "profile": {
    }
}

Add a new authentication client for a user

path Parameters
id
required
integer

The id of the user

Request Body schema: application/json
required

Authentication client details

source
required
string
sourceId
required
string

Responses

Request samples

Content type
application/json
{
  • "source": "google",
  • "sourceId": "1234567890"
}

Get user by authentication client

query Parameters
name
required
string

Authentication client name

id
required
string

Authentication client ID

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "display_name": "John Doe",
  • "account": {
    },
  • "profile": {
    }
}

Get user by user id

path Parameters
id
required
integer

The id of user

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "display_name": "John Doe",
  • "account": {
    },
  • "profile": {
    }
}

Update an existing user

path Parameters
id
required
integer

The id of user

Request Body schema: application/json
required

Updated user object

object (Account)
object (Profile)
object (Password)

Responses

Request samples

Content type
application/json
{
  • "account": {
    },
  • "profile": {
    },
  • "password": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "display_name": "John Doe",
  • "account": {
    },
  • "profile": {
    }
}

Soft deletes an user by id

Soft deletes the user (profile data and memberships are removed, the user's own content is kept).

Spaces owned by the user are transferred to the API user who performs the request, unless deleteSpaces=1 is given. Warning: with deleteSpaces=1 the owned spaces are deleted irrevocably, including the content of other users.

path Parameters
id
required
integer

The id of user

query Parameters
deleteSpaces
integer
Default: 0
Enum: 0 1

How to handle the spaces owned by the user:

  • 0 (default): the ownership of each owned space is transferred to the API user who performs the request.
  • 1: the owned spaces are deleted irrevocably, including all memberships and all content and files of other users in these spaces.

Responses

Hard deletes an user by id

Deletes the user completely, including the user's own content.

Spaces owned by the user are transferred to the API user who performs the request, unless deleteSpaces=1 is given. Warning: with deleteSpaces=1 the owned spaces are deleted irrevocably, including the content of other users.

path Parameters
id
required
integer

The id of user

query Parameters
deleteSpaces
integer
Default: 0
Enum: 0 1

How to handle the spaces owned by the user:

  • 0 (default): the ownership of each owned space is transferred to the API user who performs the request.
  • 1: the owned spaces are deleted irrevocably, including all memberships and all content and files of other users in these spaces.

Responses

Group

Group API

Find all Groups

query Parameters
page
integer >= 0

The number of page of the result set.

limit
integer [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Adds a new group

Request Body schema: application/json
required

The added Group object

name
string
description
string
show_at_directory
boolean
show_at_registration
boolean
sort_order
int

Responses

Request samples

Content type
application/json
{
  • "name": "Example group",
  • "description": "Users of Example",
  • "show_at_directory": false,
  • "show_at_registration": false,
  • "sort_order": 100
}

Get group by id

path Parameters
id
required
integer

The id of group

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Example group",
  • "description": "Users of Example",
  • "show_at_directory": false,
  • "show_at_registration": false,
  • "sort_order": 100
}

List members

Lists all members of the given group id.

path Parameters
id
required
integer

The id of the group

Responses

Response samples

Content type
{}

Add a new member

Adds new member to the given group

path Parameters
id
required
integer

The id of group

query Parameters
userId
required
integer

The id of user

isManager
boolean
Default: false

Is group manager

Responses

Removes a member

Removes a member from given group id.

path Parameters
id
required
integer

The id of group

query Parameters
userId
required
integer

The id of user

Responses

Invite

Invite new users to the HumHub installation

Invite new users

Request Body schema: application/json
required

Emails of people you want to invite

emails
required
Array of any

An array of email addresses

Responses

Request samples

Content type
application/json
{
  • "emails": [
    ]
}

Pending invites

Returns list of pending invites

Responses

Response samples

Content type
{}

Resend invite

Resends invitation email

Responses

Cancel invite

Cancels the invite, making the invitation URL no longer valid.

Responses

Session

User sessions

Deletes all sessions for a particular user

path Parameters
id
required
integer

The id of user

Responses