ArangoDB Manual Pages


HTTP Interface for User Management

User Management

This is an introduction to ArangoDB's Http interface for managing users.

The interface provides a simple means to add, update, and remove users. All users managed through this interface will be stored in the system collection _users.

This specialised interface intentionally does not provide all functionality that is available in the regular document REST API.

Operations on users may become more restricted than regular document operations, and extra privilege and security security checks may be introduced in the future for this interface.

POST /_api/user
(creates user)
POST /_api/user
The following data need to be passed in a JSON representation in the body of the POST request:
  • username: The name of the user as a string. This is mandatory.
  • passwd: The user password as a string. If no password is specified, the empty string will be used.
  • active: an optional flag that specifies whether the user is active. If not specified, this will default to true.
  • extra: an optional JSON object with arbitrary extra data about the user.
If the user can be added by the server, the server will respond with HTTP 201.In case of success, the returned JSON object has the following properties:
  • error: boolean flag to indicate that an error occurred (false in this case)
  • code: the HTTP status code
If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with HTTP 400.The body of the response will contain a JSON object with additional error details. The object has the following attributes:
  • error: boolean flag to indicate that an error occurred (true in this case)
  • code: the HTTP status code
  • errorNum: the server error number
  • errorMessage: a descriptive error message

PUT /_api/user
(replaces user)
PUT /_api/user/username
Replaces the data of an existing user. The name of an existing user must be specified in username.The following data can to be passed in a JSON representation in the body of the POST request:
  • passwd: The user password as a string. Specifying a password is mandatory, but the empty string is allowed for passwords.
  • active: an optional flag that specifies whether the user is active. If not specified, this will default to true.
  • extra: an optional JSON object with arbitrary extra data about the user.
If the user can be replaced by the server, the server will respond with HTTP 200.In case of success, the returned JSON object has the following properties:
  • error: boolean flag to indicate that an error occurred (false in this case)
  • code: the HTTP status code
If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with HTTP 400. If the specified user does not exist, the server will respond with HTTP 404.The body of the response will contain a JSON object with additional error details. The object has the following attributes:
  • error: boolean flag to indicate that an error occurred (true in this case)
  • code: the HTTP status code
  • errorNum: the server error number
  • errorMessage: a descriptive error message

PATCH /_api/user
(updates user)
PATCH /_api/user/username
Partially updates the data of an existing user. The name of an existing user must be specified in username.The following data can be passed in a JSON representation in the body of the POST request:
  • passwd: The user password as a string. Specifying a password is optional. If not specified, the previously existing value will not be modified.
  • active: an optional flag that specifies whether the user is active. If not specified, the previously existing value will not be modified.
  • extra: an optional JSON object with arbitrary extra data about the user. If not specified, the previously existing value will not be modified.
If the user can be updated by the server, the server will respond with HTTP 200.In case of success, the returned JSON object has the following properties:
  • error: boolean flag to indicate that an error occurred (false in this case)
  • code: the HTTP status code
If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with HTTP 400. If the specified user does not exist, the server will respond with HTTP 404.The body of the response will contain a JSON object with additional error details. The object has the following attributes:
  • error: boolean flag to indicate that an error occurred (true in this case)
  • code: the HTTP status code
  • errorNum: the server error number
  • errorMessage: a descriptive error message

DELETE /_api/user
(removes a user)
DELETE /_api/user/username
Removes an existing user, identified by username.If the user can be removed by the server, the server will respond with HTTP 202.In case of success, the returned JSON object has the following properties:
  • error: boolean flag to indicate that an error occurred (false in this case)
  • code: the HTTP status code
If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with HTTP 400. If the specified user does not exist, the server will respond with HTTP 404.The body of the response will contain a JSON object with additional error details. The object has the following attributes:
  • error: boolean flag to indicate that an error occurred (true in this case)
  • code: the HTTP status code
  • errorNum: the server error number
  • errorMessage: a descriptive error message

GET /_api/user
(fetches a user)
GET /_api/user/username
Fetches data about the specified user.The call will return a JSON document with at least the following attributes on success:
  • username: The name of the user as a string.
  • active: an optional flag that specifies whether the user is active.
  • extra: an optional JSON object with arbitrary extra data about the user.