Loading TOC...

POST /admin/v1/instance-admin


Install the admin username and password, and initialize the security database and objects.

URL Parameters
format The format of the data in the response body. Allowed values: json or xml. If present, this parameter overrides the Accept header.
admin-username The user name to be configured as the admin user. You can either pass this parameter as form data in the request body, or provide this data in an XML or JSON payload. For details, see the Usage Notes.
admin-password The password to be configured as the admin user. You can either pass this parameter as form data in the request body, or provide this data in an XML or JSON payload. For details, see the Usage Notes.
realm The authentication realm of the admin user. The realms allow protected resources on a server to be partitioned into a set of protection spaces, each with its own authentication scheme. The realms are stored in the security database and used in computing digest authentication tokens.
Request Headers
Accept The expected MIME type of the request body. If the format parameter is present, it takes precedence over the Accept header. Only application/xml and application/json are supported.
Content-type The MIME type of the data in the request body, if any. Allowed values: application/xml, application/json, or application/x-www-form-urlencoded. The format request parameter takes precedence over this header if present.
Response Headers
Content-type The MIME type of the data in the response body. Use the Accept header or format request parameter to specify a preferred format. The format parameter takes precedence over the requesAccept header if both are present.


Upon success, MarkLogic Server returns status code 202 (Accepted) and the response body contains a timestamp and a link to the timestamp service. Use this information to detect when the server restart completes.

Required Privileges

If the security database has not yet been initialized, no authentication is required. If the security database has been already initialized, the request will fail with the status code 400, which is the expected behavior, because you only may initialize the security database once for a given instance of MarkLogic Server.

Usage Notes

This request must be directed to the MarkLogic Server Admin Interface on port 8001. For example: http://localhost:8001/admin/v1/instance-admin.

You must call POST /admin/v1/init or otherwise initialize MarkLogic Server prior to using this method.

You should only call this method on a standalone host (not intended to be part of a cluster), or the initial bootstrap host of a cluster. Do not use this method on additional hosts in a cluster. Instead, use the cluster join sequence shown in POST /admin/v1/cluster-config.

You can supply the admin user name and password using either XML, JSON or form data. If you choose form data, you must set the Content-type header to application/x-www-form-urlencoded If you choose XML or JSON, you can specify the content type using either the format request parameter or the Content-type header. Use the following templates for the POST body; admin-username and admin-password are the only required settings.

<instance-admin xmlns="http://marklogic.com/manage">

{ "admin-username" : "your-admin-username",
  "admin-password" : "your-admin-password",
  "realm" : "public"

Form Data (must be URL encoded):

If successful, this method causes MarkLogic Server to restart. You can use the timestamp and the link to the timestamp service to poll the status of the restart. For details, see GET /admin/v1/timestamp.

For details and a complete example, see Setting Up the First Host in a Cluster in the Scripting Administrative Tasks Guide.


$ curl -i -X POST \
    --data "admin-username=adminuser&admin-password=mypassword&realm=public" \

==> MarkLogic Server responds with headers and a response body similar
    to the following:

HTTP/1.1 202 Accepted
Content-type: application/xml
Location: /admin/v1/timestamp

<restart xmlns="http://marklogic.com/manage">
    <last-startup host-id="13544732455686476949">
    <message>Check for new timestamp to verify host restart.</message>

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.


The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.