Skip to content

needAuth/User


Create one

POST
/user/create

This route is used to create a new user

Authorizations

bearer
Type
HTTP (bearer)

Parameters

Header Parameters

Authorization*

The jwt token created upon login

Type
string
Required
Example"Bearer jwtToken"

Request Body

application/json
JSON
{
"email": "informatique@polyflyx.com",
"username": "user-1768",
"firstname": "Thomas",
"lastname": "Samot",
"password": "123456",
"roleIds": [
],
"rightIds": [
]
}

Responses

application/json
JSON
{
}

Playground

Server
Authorization
Headers
Body

Samples


Get user by id

GET
/user/{id}

Authorizations

bearer
Type
HTTP (bearer)

Parameters

Path Parameters

id*

The id of the user you're looking for

Type
string
Required
Example"{{$number.int(min=1)}}"

Responses

application/json
JSON
{
"email": "informatique@polyflyx.com",
"username": "user-1768",
"firstname": "Thomas",
"lastname": "Samot",
"roles": [
],
"rights": [
]
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Update one

PATCH
/user/{id}

This route is used to update a user

Authorizations

bearer
Type
HTTP (bearer)

Parameters

Header Parameters

Authorization*

The jwt token created upon login

Type
string
Required
Example"Bearer jwtToken"

Path Parameters

id*

The id of the user you want to update

Type
string
Required

Request Body

application/json
JSON
{
"email": "informatique@polyflyx.com",
"username": "user-1768",
"firstname": "Thomas",
"lastname": "Samot",
"password": "123456",
"roleIds": [
],
"rightIds": [
]
}

Responses

application/json
JSON
{
}

Playground

Server
Authorization
Headers
Variables
Key
Value
Body

Samples


Add role

POST
/user/{id}/role

This route is used to add roles to a user

Authorizations

bearer
Type
HTTP (bearer)

Parameters

Path Parameters

id*

The id of the user you want to add roles to

Type
integer
Required

Request Body

application/json
JSON
{
"roleIds": [
0
]
}

Responses

application/json
JSON
{
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples


Add right

POST
/user/{id}/right

This route is used to add rights to a user

Authorizations

bearer
Type
HTTP (bearer)

Parameters

Path Parameters

id*

The id of the user you want to add rights to

Type
integer
Required
Example"{{$number.int(min=1)}}"

Request Body

application/json
JSON
{
"rightIds": [
0
]
}

Responses

application/json
JSON
{
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples


Remove right

DELETE
/user/{id}/right

This route is used to remove rights from a user

Authorizations

bearer
Type
HTTP (bearer)

Parameters

Path Parameters

id*

The id of the user you want to remove the right from

Type
integer
Required

Request Body

application/json
JSON
{
"rightIds": [
0
]
}

Responses

application/json
JSON
{
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples


Powered by VitePress OpenAPI