Users

Endpoints to work with the users of a partner.

Get users

GET /api/internal/v1/partners/:partner_id/users

Get the users of the given partner. The users are paginated and can be optionally searched by giving the search query parameter. The action must be performed by an authenticated user with permission users.read and partner access.

Path Parameters

Name
Type
Description

partner_id

integer

The id of the partner.

Query Parameters

Name
Type
Description

page

integer

The current page to display.

search

string

Filter users by the given string. It searches the users by first name, last name, and email address.

{
    data: [
        {
            id: 1,
            first_name: "John",
            last_name: "Doe",
            email: "[email protected]"
        },
        {
            id: 2,
            first_name: "Jane",
            last_name: "Doe",
            email: "[email protected]"
        }
    ],

    meta: {
        current_page: 1,
        from: 1,
        to: 2,
        per_page: 20,
        total: 2,
    },
    
    links: {
        first: "https://manager.apis.venuzle.com/api/internal/v1/partners/1/users?search=Doe&page=1",
        last: "https://manager.apis.venuzle.com/api/internal/v1/partners/1/users?search=Doe&page=1",
        prev: null,
        next: null
    }
}

Create a new user

POST /api/internal/v1/partners/:partner_id/users

Create a new user and attach it to the partner. If a user already exists with that email and is not attached to the given partner, it will be attached and the first_name and last_name differences will be ignored. The action must be performed by an authenticated user with permission users.create and partner access.

Path Parameters

Name
Type
Description

partner_id

integer

The id of the partner.

Request Body

Name
Type
Description

password

string

The password of the new user.

email

string

The email address of the new user.

last_name

string

The last name of the new user.

first_name

string

The first name of the new user.

{
    data: {
        id: 1,
        first_name: "John",
        last_name: "Doe",
        email: "[email protected]"
    }
}

Get user

GET /api/internal/v1/partners/:partner_id/users/:user_id

Get a user by its id. The action must be performed by an authenticated user with permission users.read and partner access.

Path Parameters

Name
Type
Description

user_id

integer

The id of the user.

partner_id

integer

The id of the partner.

{
    data: {
        id: 1,
        first_name: "John",
        last_name: "Doe",
        email: "[email protected]"
    }
}

Update user

PUT /api/internal/v1/partners/:partner_id/users/:user_id

Update the given user. The action must be performed by an authenticated user with permission users.update and partner access.

Path Parameters

Name
Type
Description

user_id

integer

The id of the user.

partner_id

integer

The id of the partner.

Request Body

Name
Type
Description

new_password_confirmation

string

Confirmation of the new user password.

new_password

string

The new password of the user.

email

string

The email of the user.

last_name

string

The last name of the user.

first_name

string

The first name of the user.

{}

Delete user

DELETE /api/internal/v1/partners/:partner_id/users/:user_id

Delete the given user. If the user is attached to multiple partners, it will be removed from the current partner only. The action must be performed by an authenticated user with permission users.delete and partner access.

Path Parameters

Name
Type
Description

user_id

integer

The user id which should be deleted.

partner_id

integer

The partner id.

{}

Get user partners

GET /api/internal/v1/partners/:partner_id/users/:user_id

Get the partners associated with the given user.

Path Parameters

Name
Type
Description

user_id

integer

partner_id

integer

Last updated

Was this helpful?