HTTP interface for administration

You can get information about ArangoDB servers, toggle the maintenance mode, shut down server nodes, and start actions like compaction

Information

Get the server version

GET /_db/{database-name}/_api/version
Returns the server name and version number. The response is a JSON object with the following attributes:
Path Parameters
  • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database.

Query Parameters
  • If set to true and if the user account you authenticate with has administrate access to the _system database, the response contains a details attribute with additional information about included components and their versions. The attribute names and internals of the details object may vary depending on platform and ArangoDB version.

HTTP Headers
    Responses
    • is returned in all cases.

        Response Body application/json object
      • an optional JSON object with additional details. This is returned only if the details query parameter is set to true in the request.

        • The CPU architecture, i.e. 64bit

        • false - this is not running on an ARM cpu

        • has this been compiled with the asan address sanitizer turned on? (should be false)

        • do we have assertions compiled in (=> developer version)

        • which boost version do we bind

        • the date when this binary was created

        • reference to the git-ID this was compiled from

        • which compiler did we use

        • C++ standards version

        • false for production binaries

        • currently only little is supported

        • false for production binaries (the facility to invoke fatal errors is disabled)

        • which method do we use to handle fd-sets, poll should be here on linux.

        • if not poll the fd setsize is valid for the maximum number of file descriptors

        • The full version string

        • the host ID

        • Which version of ICU do we bundle

        • true if we use jemalloc

        • false if this is a production binary

        • The mode arangod runs in. Possible values: server, console, script

        • which openssl version do we link?

        • the host os - linux, windows or darwin

        • epoll

        • the rocksdb version this release bundles

        • the ArangoDB release version

        • number of bytes for integers

        • number of bytes for void pointers

        • do we have a SSE 4.2 enabled cpu?

        • does this system support unaligned memory access?

        • the bundled V8 javascript engine version

        • the version of the used velocypack implementation

        • the version of the bundled zlib

      • will always contain arango

      • the server version string. The string has the format major.minor.sub. major and minor will be numeric, and sub may contain a number or a textual version.

    Examples

    Return the version information

    curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/version'
    Show output

    Return the version information with details

    curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/version?details=true'
    Show output

    Get the storage engine type

    GET /_db/{database-name}/_api/engine
    Returns the storage engine the server is configured to use. The response is a JSON object with the following attributes:
    Path Parameters
    • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database.

    Query Parameters
      HTTP Headers
        Responses
        • is returned in all cases.

            Response Body application/json object
          • will be rocksdb

        Examples

        Return the active storage engine:

        curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/engine'
        Show output

        Get the system time

        GET /_db/{database-name}/_admin/time
        The call returns an object with the time attribute. This contains the current system time as a Unix timestamp with microsecond precision.
        Path Parameters
        • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database.

        Query Parameters
          HTTP Headers
            Responses
            • Time was returned successfully.

                Response Body application/json object
              • the HTTP status code

              • boolean flag to indicate whether an error occurred (false in this case)

              • The current system time as a Unix timestamp with microsecond precision of the server

            Get server status information

            GET /_db/{database-name}/_admin/status
            Returns status information about the server.
            Path Parameters
            • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database. If the --server.harden startup option is enabled, administrate access to the _system database is required.

            Query Parameters
              HTTP Headers
                Responses
                • Status information was returned successfully.

                    Response Body application/json object
                  • Information about the Agency. Cluster only (Coordinators and DB-Servers).

                    • Information about the communication with the Agency. Cluster only (Coordinators and DB-Servers).

                      • A list of possible Agency endpoints.

                  • Information about the Agents. Cluster only (Agents)

                    • The endpoint of the queried Agent.

                    • Server ID of the queried Agent.

                    • Server ID of the leading Agent.

                    • Whether the queried Agent is the leader.

                    • The current term number.

                  • Information about the Coordinators. Cluster only (Coordinators)

                    • The server ID of the Coordinator that is the Foxx master.

                    • Whether the queried Coordinator is the Foxx master.

                  • Whether the Foxx API is enabled.

                  • A host identifier defined by the HOST or NODE_NAME environment variable, or a fallback value using a machine identifier or the cluster/Agency address.

                  • A hostname defined by the HOSTNAME environment variable.

                  • ArangoDB Edition, either "community" or "enterprise".

                  • Either "server" or "console". Deprecated, use operationMode instead.

                  • Either "server" or "console".

                  • The process ID of arangod.

                  • Always "arango".

                  • Information about the server status.

                    • The address of the server, e.g. tcp://[::1]:8530. Cluster only (Coordinators and DB-Servers).

                    • Whether the maintenance mode is enabled.

                    • The persisted ID, e. g. "CRDN-e427b441-5087-4a9a-9983-2fb1682f3e2a". Cluster only (Agents, Coordinators, and DB-Servers).

                    • Startup and recovery information.

                      You can check for changes to determine whether progress was made between two calls, but you should not rely on specific values as they may change between ArangoDB versions. The values are only expected to change during the startup and shutdown, i.e. while maintenance is true.

                      You need to start arangod with the --server.early-connections startup option enabled to be able to query the endpoint during the startup process. If authentication is enabled, then you need to use the super-user JWT for the request because the user management is not available during the startup.

                      • Internal name of the feature that is currently being prepared, started, stopped or unprepared.

                      • Name of the lifecycle phase the instance is currently in. Normally one of "in prepare", "in start", "in wait", "in shutdown", "in stop", or "in unprepare".

                      • Current recovery sequence number value, if the instance is currently recovering. If the instance is already past the recovery, this attribute will contain the last handled recovery sequence number.

                    • Whether writes are disabled.

                    • The reboot ID. Changes on every restart. Cluster only (Agents, Coordinators, and DB-Servers).

                    • Either "SINGLE", "COORDINATOR", "PRIMARY" (DB-Server), or "AGENT".

                    • The server ID, e.g. "CRDN-e427b441-5087-4a9a-9983-2fb1682f3e2a". Cluster only (Coordinators and DB-Servers).

                    • Either "STARTUP", "SERVING", or "SHUTDOWN". Cluster only (Coordinators and DB-Servers).

                    • Whether writes are enabled. Deprecated, use readOnly instead.

                  • The server version as a string.

                Examples

                curl --header 'accept: application/json' --dump - 'http://localhost:8529/_admin/status'
                Show output

                Return whether or not a server is available

                GET /_admin/server/availability

                Return availability information about a server.

                This is a public API so it does not require authentication. It is meant to be used only in the context of server monitoring.

                Responses
                • This API will return HTTP 200 in case the server is up and running and usable for arbitrary operations, is not set to read-only mode and is currently not a follower in case of an Active Failover deployment setup.

                • HTTP 503 will be returned in case the server is during startup or during shutdown, is set to read-only mode or is currently a follower in an Active Failover deployment setup.

                  In addition, HTTP 503 will be returned in case the fill grade of the scheduler queue exceeds the configured high-water mark (adjustable via startup option --server.unavailability-queue-fill-grade), which by default is set to 75 % of the maximum queue length.

                Get the required database version (deprecated)

                GET /_admin/database/target-version
                This endpoint is deprecated and should no longer be used. It will be removed from version 3.12.0 onward. Use GET /_api/version instead.

                Returns the database version that this server requires. The version is returned in the version attribute of the result.

                Responses
                • Is returned in all cases.

                Get information about the deployment

                GET /_db/_system/_admin/support-info

                Retrieves deployment information for support purposes. The endpoint returns data about the ArangoDB version used, the host (operating system, server ID, CPU and storage capacity, current utilization, a few metrics) and the other servers in the deployment (in case of cluster deployments).

                As this API may reveal sensitive data about the deployment, it can only be accessed from inside the _system database. In addition, there is a policy control startup option --server.support-info-api that controls if and to whom the API is made available.

                Responses
                  • Response Body application/json object
                  • ISO 8601 datetime string of when the information was requested.

                  • An object with at least a type attribute, indicating the deployment mode.

                    In case of a "single" server, additional information is provided in the top-level host attribute.

                    In case of a "cluster", there is a servers object that contains a nested object for each Coordinator and DB-Server, using the server ID as key. Each object holds information about the ArangoDB instance as well as the host machine. There are additional attributes for the number of agents, coordinators, dbServers, and shards.

                  • An object that holds information about the ArangoDB instance as well as the host machine. Only set in case of single servers.

                • The support info API is turned off.

                Examples

                Query support information from a single server

                curl --header 'accept: application/json' --dump - 'http://localhost:8529/_admin/support-info'
                Show output

                Query support information from a cluster

                curl --header 'accept: application/json' --dump - 'http://localhost:8529/_admin/support-info'
                Show output

                Server mode

                Return whether or not a server is in read-only mode

                GET /_db/{database-name}/_admin/server/mode

                Return mode information about a server. The json response will contain a field mode with the value readonly or default. In a read-only server all write operations will fail with an error code of 1004 (ERROR_READ_ONLY). Creating or dropping of databases and collections will also fail with error code 11 (ERROR_FORBIDDEN).

                This API requires authentication.

                Path Parameters
                • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database.

                Query Parameters
                  HTTP Headers
                    Responses
                    • This API will return HTTP 200 if everything is ok

                    Set the server mode to read-only or default

                    PUT /_db/{database-name}/_admin/server/mode

                    Update mode information about a server. The JSON response will contain a field mode with the value readonly or default. In a read-only server all write operations will fail with an error code of 1004 (ERROR_READ_ONLY). Creating or dropping of databases and collections will also fail with error code 11 (ERROR_FORBIDDEN).

                    This is a protected API. It requires authentication and administrative server rights.

                    Path Parameters
                    • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database and administrate access to the _system database.

                    Query Parameters
                      HTTP Headers
                        Request Body application/json object
                        • The mode of the server readonly or default.

                        Responses
                        • This API will return HTTP 200 if everything is ok

                        • if the request was not authenticated as a user with sufficient rights

                        License

                        The endpoints for license management allow you to view the current license status and update the license of your ArangoDB Enterprise Edition deployment.

                        Get information about the current license

                        GET /_db/{database-name}/_admin/license
                        View the license information and status of an Enterprise Edition instance. Can be called on single servers, Coordinators, and DB-Servers.
                        Path Parameters
                        • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database. If the --server.harden startup option is enabled, administrate access to the _system database is required.

                        Query Parameters
                          HTTP Headers
                            Responses
                            • Returns the license information.

                                Response Body application/json object
                              • The properties of the license.

                                • The expires key lists the expiry date as Unix timestamp (seconds since January 1st, 1970 UTC).

                              • The hash value of the license.

                              • The encrypted license key in Base64 encoding, or "none" in the Community Edition.

                              • The status key allows you to confirm the state of the installed license on a glance. The possible values are as follows:

                                • good: The license is valid for more than 2 weeks.
                                • expiring: The license is valid for less than 2 weeks.
                                • expired: The license has expired. In this situation, no new Enterprise Edition features can be utilized.
                                • read-only: The license is expired over 2 weeks. The instance is now restricted to read-only mode.

                              • Whether the server is performing a database upgrade.

                              • The license version number.

                            Examples

                            curl --header 'accept: application/json' --dump - 'http://localhost:8529/_admin/license'
                            Show output

                            Set a new license

                            PUT /_db/{database-name}/_admin/license
                            Set a new license for an Enterprise Edition instance. Can be called on single servers, Coordinators, and DB-Servers.
                            Path Parameters
                            • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database. If the --server.harden startup option is enabled, administrate access to the _system database is required.

                            Query Parameters
                            • Set to true to change the license even if it expires sooner than the current one.

                            HTTP Headers
                              Request Body application/json string
                                The request body has to contain the Base64-encoded string wrapped in double quotes.
                              Responses
                              • License successfully deployed.

                                  Response Body application/json object
                                  • The HTTP status code.

                                  • A flag indicating that no error occurred.

                              • If the license expires earlier than the previously installed one, or if the supplied license string is invalid.

                                  Response Body application/json object
                                • The HTTP status code.

                                • A flag indicating that an error occurred.

                                • A descriptive error message.

                                • The ArangoDB error number.

                              • If you try to apply a license in the Community Edition.

                                  Response Body application/json object
                                • The HTTP status code.

                                • A flag indicating that an error occurred.

                                • A descriptive error message.

                                • The ArangoDB error number.

                              Examples

                              curl --header 'accept: application/json' --dump - --data '"eyJncmFudCI6...(Base64-encoded license string)..."' -X PUT http://localhost:8529/_admin/license
                              
                              Show output

                              Shutdown

                              Start the shutdown sequence

                              DELETE /_db/{database-name}/_admin/shutdown
                              This call initiates a clean shutdown sequence. Requires administrative privileges.
                              Path Parameters
                              • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database and administrate access to the _system database.

                              Query Parameters
                              • Introduced in: v3.7.12, v3.8.1, v3.9.0

                                If set to true, this initiates a soft shutdown. This is only available on Coordinators. When issued, the Coordinator tracks a number of ongoing operations, waits until all have finished, and then shuts itself down normally. It will still accept new operations.

                                This feature can be used to make restart operations of Coordinators less intrusive for clients. It is designed for setups with a load balancer in front of Coordinators. Remove the designated Coordinator from the load balancer before issuing the soft-shutdown. The remaining Coordinators will internally forward requests that need to be handled by the designated Coordinator. All other requests will be handled by the remaining Coordinators, reducing the designated Coordinator’s load.

                                The following types of operations are tracked:

                                • AQL cursors (in particular streaming cursors)
                                • Transactions (in particular stream transactions)
                                • Pregel runs (conducted by this Coordinator)
                                • Ongoing asynchronous requests (using the x-arango-async: store HTTP header)
                                • Finished asynchronous requests, whose result has not yet been collected
                                • Queued low priority requests (most normal requests)
                                • Ongoing low priority requests

                              HTTP Headers
                                Responses
                                • is returned in all cases, OK will be returned in the result buffer on success.

                                Query the soft shutdown progress

                                GET /_db/{database-name}/_admin/shutdown

                                Introduced in: v3.7.12, v3.8.1, v3.9.0

                                This call reports progress about a soft Coordinator shutdown (see documentation of DELETE /_admin/shutdown?soft=true). In this case, the following types of operations are tracked:

                                • AQL cursors (in particular streaming cursors)
                                • Transactions (in particular stream transactions)
                                • Pregel runs (conducted by this Coordinator)
                                • Ongoing asynchronous requests (using the x-arango-async: store HTTP header)
                                • Finished asynchronous requests, whose result has not yet been collected
                                • Queued low priority requests (most normal requests)
                                • Ongoing low priority requests

                                This API is only available on Coordinators.

                                Path Parameters
                                • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database and administrate access to the _system database.

                                Query Parameters
                                  HTTP Headers
                                    Responses
                                    • The response indicates the fact that a soft shutdown is ongoing and the number of active operations of the various types. Once all numbers have gone to 0, the flag allClear is set and the Coordinator shuts down automatically.

                                        Response Body application/json object
                                      • Number of AQL cursors that are still active.

                                      • Whether all active operations finished.

                                      • Number of finished asynchronous requests, whose result has not yet been collected.

                                      • Number of queued low priority requests.

                                      • Number of ongoing low priority requests.

                                      • Number of ongoing asynchronous requests.

                                      • Number of ongoing Pregel jobs.

                                      • Whether a soft shutdown of the Coordinator is in progress.

                                      • Number of ongoing transactions.

                                    Miscellaneous actions

                                    Compact all databases

                                    PUT /_admin/compact
                                    This command can cause a full rewrite of all data in all databases, which may take very long for large databases. It should thus only be used with care and only when additional I/O load can be tolerated for a prolonged time.

                                    This endpoint can be used to reclaim disk space after substantial data deletions have taken place, by compacting the entire database system data.

                                    The endpoint requires superuser access.

                                    Request Body application/json object
                                    • whether or not compacted data should be moved to the minimum possible level. The default value is false.

                                    • Whether or not to compact the bottommost level of data. The default value is false.

                                    Responses
                                    • Compaction started successfully

                                    • if the request was not authenticated as a user with sufficient rights

                                    Examples

                                    curl -X PUT --header 'accept: application/json' --dump - 'http://localhost:8529/_admin/compact'
                                    Show output

                                    Reload the routing table

                                    POST /_db/{database-name}/_admin/routing/reload
                                    Reloads the routing information from the _routing system collection if it exists, and makes Foxx rebuild its local routing table on the next request.
                                    Path Parameters
                                    • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database.

                                    Query Parameters
                                      HTTP Headers
                                        Responses
                                        • The routing information has been reloaded successfully.

                                        Echo a request

                                        POST /_db/{database-name}/_admin/echo
                                        The call returns an object with the servers request information
                                        Path Parameters
                                        • The name of a database. Which database you use doesn’t matter as long as the user account you authenticate with has at least read access to this database.

                                        Query Parameters
                                          HTTP Headers
                                            Request Body application/json object
                                            • The request body can be of any type and is simply forwarded.

                                            Responses
                                            • Echo was returned successfully.

                                                Response Body application/json object
                                              • Whether the session is authorized

                                              • Attributes of the client connection

                                                • The IP address of the client

                                                • A server generated ID

                                                • The port of the TCP connection on the client-side

                                              • A list of the cookies you sent

                                              • The name of the database this request was executed on

                                              • The list of the HTTP headers you sent

                                              • Contents of the server internals struct

                                              • Whether the current user is an administrator

                                              • An object containing the query parameters

                                              • The relative path of this request (decoded, excluding /_admin/echo)

                                              • The type of the socket, one of "tcp/ip", "unix", "unknown"

                                              • The prefix of the database

                                              • The transport protocol, one of "http", "https", "velocystream"

                                              • The sent payload as a JSON-encoded Buffer object

                                              • A list of the percent-encoded URL path suffixes

                                              • Stringified version of the request body you sent

                                              • The HTTP method that was used for the request ("POST"). The endpoint can be queried using other verbs, too ("GET", "PUT", "PATCH", "DELETE").

                                              • Attributes of the server connection

                                                • The bind address of the endpoint this request was sent to

                                                • The endpoint this request was sent to

                                                • The port this request was sent to

                                              • A list of the decoded URL path suffixes. You can query the endpoint with arbitrary suffixes, e.g. /_admin/echo/foo/123

                                              • The raw request URL

                                              • The name of the current user that sent this request

                                            Execute a script

                                            POST /_db/{database-name}/_admin/execute

                                            Executes the JavaScript code in the body on the server as the body of a function with no arguments. If you have a return statement then the return value you produce will be returned as content type application/json. If the parameter returnAsJSON is set to true, the result will be a JSON object describing the return value directly, otherwise a string produced by JSON.stringify will be returned.

                                            Note that this API endpoint will only be present if the server was started with the option --javascript.allow-admin-execute true.

                                            The default value of this option is false, which disables the execution of user-defined code and disables this API endpoint entirely. This is also the recommended setting for production.

                                            Path Parameters
                                            • The name of the database.

                                            Query Parameters
                                              HTTP Headers
                                                Request Body application/json object
                                                • The request body is the JavaScript code to be executed.

                                                Responses
                                                • is returned when everything went well, or if a timeout occurred. In the latter case a body of type application/json indicating the timeout is returned. depending on returnAsJSON this is a json object or a plain string.

                                                • is returned if ArangoDB is not running in cluster mode.

                                                • is returned if ArangoDB was not compiled for cluster operation.

                                                Endpoints

                                                The /_api/endpoint endpoint is deprecated. For cluster deployments, you can use /_api/cluster/endpoints instead to find all current Coordinator endpoints. See Cluster.

                                                An ArangoDB server can listen for incoming requests on multiple endpoints.

                                                The endpoints are normally specified either in the arangod configuration file or on the command-line, using the --server.endpoint startup option. The default endpoint for ArangoDB is tcp://127.0.0.1:8529 (IPv4 localhost on port 8529 over the HTTP protocol).

                                                Note that all endpoint management operations can only be accessed via the default _system database and none of the other databases.

                                                List the endpoints of a single server (deprecated)

                                                GET /_db/_system/_api/endpoint
                                                This route should no longer be used. It is considered as deprecated from version 3.4.0 on.

                                                Returns an array of all configured endpoints the server is listening on.

                                                The result is a JSON array of JSON objects, each with "entrypoint" as the only attribute, and with the value being a string describing the endpoint.

                                                Retrieving the array of all endpoints is allowed in the system database only. Calling this action in any other database will make the server return an error.
                                                Responses
                                                • is returned when the array of endpoints can be determined successfully.

                                                • is returned if the action is not carried out in the system database.

                                                • The server will respond with HTTP 405 if an unsupported HTTP method is used.

                                                Examples

                                                curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/endpoint'
                                                Show output