Endpoints for viewing user(s), creating a user, updating a user, enabling or disabling a user.
GET /api2/users adminGET /api2/users/{id} adminPOST /api2/users admin
PUT /api2/users/{id} admin
DELETE /api2/users/{id} admin
]
{
"id": 1,
"name": "admin",
"username": "admin",
"email": "admin@profitap.com",
"sshKey": "",
"role": "admin",
"enabled": true,
"creation_time": 1542373932,
"modification_time": 1542373932,
"last_access": 0
},
{
"id": 3,
"name": "guest",
"username": "guest",
"email": "guest@profitap.com",
"sshKey": null,
"role": "viewer",
"enabled": true,
"creation_time": 1542373932,
"modification_time": 1542373932,
"last_access": 0
}
]Each authenticated user (local or remote) has an associated opaque configuration blob, intended for client-owned settings (UI theme, layout, table column choices, etc.). The daemon stores the request body verbatim and returns it on demand — it does not parse or validate the payload.
For local users the blob lives on the user row and is removed when the user is deleted. For remote users (TACACS / RADIUS / LDAP / supervisor) the blob is keyed by (source, server_id, username) and is removed when the auth server is deleted, or after a configurable retention period of inactivity.
GET /api2/users/config viewerPUT /api2/users/config viewerGET /api2/users/config/retention_time adminPUT /api2/users/config/retention_time adminGET /api2/users/config
Retrieves the configuration blob for the user identified by the request's authorization token. The response body is the raw stored payload (last value passed to PUT /api2/users/config), returned with Content-Type: application/json regardless of what the client originally PUT. The body is empty when no config has been set.
Required Role: viewer
Authorization: <your-token>
If the caller is a remote user and the auth server identified by the token's (source, hostname, port) has since been deleted:
{
"statusCode": 401,
"error": "Unauthorized",
"message": "The auth server for this token no longer exists."
}PUT /api2/users/config
Stores the request body verbatim as the calling user's configuration blob. Overwrites any existing value. The daemon does not parse or validate the payload.
Required Role: viewer
Authorization: <your-token>
Content-Type: application/json
Any text payload. Typically a JSON document, but no schema is enforced.
{
"statusCode": 200,
"message": "Successfully updated user config."
}If the caller is a local user but no row with that username exists (e.g. the user was deleted between obtaining the token and the request):
{
"statusCode": 404,
"error": "Not Found",
"message": "Local user not found."
}If the caller is a remote user and the auth server has since been deleted:
{
"statusCode": 401,
"error": "Unauthorized",
"message": "The auth server for this token no longer exists."
}GET /api2/users/config/retention_time
Retrieves the current retention period (in days) for remote-user configuration entries. Remote users do not have a delete event from the daemon's perspective, so their cached configs are aged out after this many days of inactivity. Local users are unaffected.
Required Role: admin
Authorization: <your-token>
{
"retention_days": 30
}PUT /api2/users/config/retention_time
Configures the retention period (in days) for remote-user configuration entries. The setting is persisted and survives restarts.
Required Role: admin
Authorization: <your-token>
Content-Type: application/json
{
"retention_days": 30
}Valid range: 1 to 365 days
{
"statusCode": 200,
"message": "Successfully updated the user config retention."
}If retention_days is missing, has the wrong type, or is outside 1..365, a standard validation error is returned. Example for an out-of-range value:
{
"status_code": 400,
"error": "Bad Request",
"message": "The validation has failed.",
"response": "The validation has failed on retention_days: Retention must be between 1 and 365 days",
"validation": {
"errors": [
{
"path": "/",
"key": "retention_days",
"message": "Retention must be between 1 and 365 days",
"constraint": "user_config_retention_days_constraint"
}
]
}
}For a missing field the entry under validation.errors[] is:
{
"path": "/",
"key": "retention_days",
"message": "The retention_days field is required.",
"constraint": "missing_field"
}