All URIs are relative to http://portainer.domain/api
| Method | HTTP request | Description |
|---|---|---|
| userAdminCheck | GET /users/admin/check | Check administrator account existence |
| userAdminInit | POST /users/admin/init | Initialize administrator account |
| userCreate | POST /users | Create a new user |
| userDelete | DELETE /users/{id} | Remove a user |
| userInspect | GET /users/{id} | Inspect a user |
| userList | GET /users | List users |
| userMembershipsInspect | GET /users/{id}/memberships | Inspect a user memberships |
| userPasswordCheck | POST /users/{id}/passwd | Check password validity for a user |
| userUpdate | PUT /users/{id} | Update a user |
userAdminCheck()
Check administrator account existence
Check if an administrator account exists in the database. Access policy: public
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.userAdminCheck(callback);
This endpoint does not need any parameter.
null (empty response body)
User userAdminInit(body)
Initialize administrator account
Initialize the 'admin' user account. Access policy: public
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var body = new PortainerApi.UserAdminInitRequest(); // UserAdminInitRequest | User details
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userAdminInit(body, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| body | UserAdminInitRequest | User details |
UserSubset userCreate(body)
Create a new user
Create a new Portainer user. Only team leaders and administrators can create users. Only administrators can create an administrator user account. Access policy: restricted
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var body = new PortainerApi.UserCreateRequest(); // UserCreateRequest | User details
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userCreate(body, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| body | UserCreateRequest | User details |
userDelete(id)
Remove a user
Remove a user. Access policy: administrator
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var id = 56; // Number | User identifier
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.userDelete(id, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | User identifier |
null (empty response body)
User userInspect(id)
Inspect a user
Retrieve details about a user. Access policy: administrator
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var id = 56; // Number | User identifier
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userInspect(id, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | User identifier |
UserListResponse userList()
List users
List Portainer users. Non-administrator users will only be able to list other non-administrator user accounts. Access policy: restricted
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userList(callback);
This endpoint does not need any parameter.
UserMembershipsResponse userMembershipsInspect(id)
Inspect a user memberships
Inspect a user memberships. Access policy: authenticated
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var id = 56; // Number | User identifier
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userMembershipsInspect(id, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | User identifier |
UserPasswordCheckResponse userPasswordCheck(id, body)
Check password validity for a user
Check if the submitted password is valid for the specified user. Access policy: authenticated
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var id = 56; // Number | User identifier
var body = new PortainerApi.UserPasswordCheckRequest(); // UserPasswordCheckRequest | User details
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userPasswordCheck(id, body, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | User identifier | |
| body | UserPasswordCheckRequest | User details |
User userUpdate(id, body)
Update a user
Update user details. A regular user account can only update his details. Access policy: authenticated
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.UsersApi();
var id = 56; // Number | User identifier
var body = new PortainerApi.UserUpdateRequest(); // UserUpdateRequest | User details
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userUpdate(id, body, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | User identifier | |
| body | UserUpdateRequest | User details |