HumHub - User API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub user module API reference.

Authentication

Bearer

Security scheme type: JWT

BasicAuth

Security scheme type: HTTP
HTTP Authorization Scheme basic

User

API to access and manage user information.

Find all users

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

200

Successful operation

get /user
/api/v1/user

Response samples

Copy
Expand all Collapse all
{
  • "total": 76,
  • "page": 1,
  • "results":
    [
    ]
}

Add a new user to the installation

Request Body schema: application/json

User object to be added to the installation

account
required
object (Account)
profile
required
object (Profile)
password
required
object (Password)

Responses

default

Successful operation

post /user
/api/v1/user

Request samples

application/json
Copy
Expand all Collapse all
{
  • "account":
    {
    },
  • "profile":
    {
    },
  • "password":
    {
    }
}

Get user by user id

path Parameters
id
required
integer

The id of user

Responses

200

successful operation

400

Invalid user id supplied

404

User not found

get /user/{id}
/api/v1/user/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "displayname": "John Doe",
  • "account":
    {
    },
  • "profile":
    {
    }
}

Update an existing user

path Parameters
id
required
integer

The id of user

Request Body schema: application/json

Updated user object

account
object (Account)
profile
object (Profile)
password
object (Password)

Responses

200

successful operation, the updated user record

400

Invalid user supplied

404

User not found

put /user/{id}
/api/v1/user/{id}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "account":
    {
    },
  • "profile":
    {
    },
  • "password":
    {
    }
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "displayname": "John Doe",
  • "account":
    {
    },
  • "profile":
    {
    }
}

Soft deletes an user by id

path Parameters
id
required
integer

The id of user

Responses

200

successful operation

400

Invalid username supplied

404

User not found

delete /user/{id}
/api/v1/user/{id}

Hard deletes an user by id

path Parameters
id
required
integer

The id of user

Responses

200

successful operation

400

Invalid username supplied

404

User not found

delete /user/full/{id}
/api/v1/user/full/{id}

Group

Group API

Find all Groups

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

200

Successful operation

get /user/group
/api/v1/user/group

Response samples

Copy
Expand all Collapse all
{
  • "total": 76,
  • "page": 1,
  • "results":
    [
    ]
}

Adds a new group

Request Body schema: application/json

The added Group object

name
string
description
string
show_at_directory
boolean
show_at_registration
boolean
space_id
integer
sort_order
int

Responses

default

Successful operation

post /user/group
/api/v1/user/group

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "Example group",
  • "description": "Users of Example",
  • "show_at_directory": false,
  • "show_at_registration": false,
  • "space_id": 1,
  • "sort_order": 100
}

Get group by id

path Parameters
id
required
integer

The id of group

Responses

200

successful operation

400

Invalid group id supplied

404

Group not found

get /user/group/{id}
/api/v1/user/group/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "name": "Example group",
  • "description": "Users of Example",
  • "show_at_directory": false,
  • "show_at_registration": false,
  • "space_id": 1,
  • "sort_order": 100
}

List members

Lists all members of the given group id.

path Parameters
id
required
integer

The id of the group

Responses

200

Successful operation

404

Not found

get /user/group/{id}/member
/api/v1/user/group/{id}/member

Response samples

Copy
Expand all Collapse all
{}

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

default

Successful operation

put /user/group/{id}/member
/api/v1/user/group/{id}/member

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

default

Successful operation

delete /user/group/{id}/member
/api/v1/user/group/{id}/member

Invite

Invite new users to the HumHub installation

Session

User sessions

Deletes all sessions for a particular user

path Parameters
id
required
integer

The id of user

Responses

200

successful operation

400

Invalid username supplied

404

User not found

delete /user/session/all/{id}
/api/v1/user/session/all/{id}