{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the document was found
",
"code": "200"
},
{
"reason": "is returned if the document or collection was not found
",
"code": "404"
},
{
"reason": "is returned if the \"If-None-Match\" header is given and the document has same version
",
"code": "304"
},
{
"reason": "is returned if a \"If-Match\" header or rev is given and the found document has a different version
",
"code": "412"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": true,
"name": "document-handle",
"description": "The Handle of the Document.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "rev",
"description": "You can conditionally select a document based on a target revision id by using the rev URL parameter.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "lang",
"description": "Language of the data.
"
},
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "format",
"description": "False for unformated values (default: true).
"
},
{
"dataType": "String",
"paramType": "header",
"name": "If-None-Match",
"description": "If the \"If-None-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has a different revision than the given etag. Otherwise a HTTP 304 is returned.
"
},
{
"dataType": "String",
"paramType": "header",
"name": "If-Match",
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the etag in an attribute rev in the URL.
"
}
],
"notes": "Returns the document identified by document-handle. The returned document contains two special attributes: _id containing the document handle and _rev containing the revision.
",
"summary": "reads a document",
"httpMethod": "GET",
"examples": "",
"nickname": "readsADocument"
}
],
"path": "/_api/structure/{document-handle}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the document was found
",
"code": "200"
},
{
"reason": "is returned if the document or collection was not found
",
"code": "404"
},
{
"reason": "is returned if the \"If-None-Match\" header is given and the document has same version
",
"code": "304"
},
{
"reason": "is returned if a \"If-Match\" header or rev is given and the found document has a different version
",
"code": "412"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": true,
"name": "document-handle",
"description": "The Handle of the Document.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "rev",
"description": "You can conditionally select a document based on a target revision id by using the rev URL parameter.
"
},
{
"dataType": "String",
"paramType": "header",
"name": "If-Match",
"description": "You can conditionally get a document based on a target revision id by using the if-match HTTP header.
"
}
],
"notes": "Like GET, but only returns the header fields and not the body. You can use this call to get the current revision of a document or check if the document was deleted.
",
"summary": "reads a document header",
"httpMethod": "HEAD",
"examples": "",
"nickname": "readsADocumentHeader"
}
],
"path": "/_api/structure/{document-handle}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the document was deleted successfully and waitForSync was true.
",
"code": "200"
},
{
"reason": "is returned if the document was deleted successfully and waitForSync was false.
",
"code": "202"
},
{
"reason": "is returned if the collection or the document was not found. The response body contains an error document in this case.
",
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or rev is given and the current document has a different version
",
"code": "412"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": true,
"name": "document-handle",
"description": "Deletes the document identified by document-handle.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "rev",
"description": "You can conditionally delete a document based on a target revision id by using the rev URL parameter.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "policy",
"description": "To control the update behavior in case there is a revision mismatch, you can use the policy parameter. This is the same as when replacing documents (see replacing documents for more details).
"
},
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "waitForSync",
"description": "Wait until document has been sync to disk.
"
},
{
"dataType": "String",
"paramType": "header",
"name": "If-Match",
"description": "You can conditionally delete a document based on a target revision id by using the if-match HTTP header.
"
}
],
"notes": "The body of the response contains a JSON object with the information about the handle and the revision. The attribute _id contains the known document-handle of the updated document, the attribute _rev contains the known document revision.
If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync URL parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
",
"summary": "deletes a document",
"httpMethod": "DELETE",
"examples": "",
"nickname": "deletesADocument"
}
],
"path": "/_api/structure/{document-handle}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the document was created successfully and waitForSync was true.
",
"code": "201"
},
{
"reason": "is returned if the document was created successfully and waitForSync was false.
",
"code": "202"
},
{
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case.
",
"code": "400"
},
{
"reason": "is returned if collection or the document was not found
",
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or rev is given and the found document has a different version
",
"code": "412"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": true,
"name": "document-handle",
"description": "The Handle of the Document.
"
},
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "keepNull",
"description": "If the intention is to delete existing attributes with the patch command, the URL query parameter keepNull can be used with a value of false. This will modify the behavior of the patch command to remove any attributes from the existing document that are contained in the patch document with an attribute value of null.
"
},
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "waitForSync",
"description": "Wait until document has been sync to disk.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "rev",
"description": "You can conditionally patch a document based on a target revision id by using the rev URL parameter.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "policy",
"description": "To control the update behavior in case there is a revision mismatch, you can use the policy parameter.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "lang",
"description": "Language of the data.
"
},
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "format",
"description": "False for unformated values (default: true).
"
},
{
"dataType": "String",
"paramType": "header",
"name": "If-Match",
"description": "You can conditionally delete a document based on a target revision id by using the if-match HTTP header.
"
}
],
"notes": "Partially updates the document identified by document-handle. The body of the request must contain a JSON document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.
Setting an attribute value to null in the patch document will cause a value of null be saved for the attribute by default.
Optionally, the URL parameter waitForSync can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync URL parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync URL parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
The body of the response contains a JSON object with the information about the handle and the revision. The attribute _id contains the known document-handle of the updated document, the attribute _rev contains the new document revision.
If the document does not exist, then a HTTP 404 is returned and the body of the response contains an error document.
You can conditionally update a document based on a target revision id by using either the rev URL parameter or the if-match HTTP header. To control the update behavior in case there is a revision mismatch, you can use the policy parameter. This is the same as when replacing documents (see replacing documents for details).
",
"summary": "patches a document",
"httpMethod": "PATCH",
"examples": "",
"nickname": "patchesADocument"
}
],
"path": "/_api/structure/{document-handle}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the document was created successfully and waitForSync was true.
",
"code": "201"
},
{
"reason": "is returned if the document was created successfully and waitForSync was false.
",
"code": "202"
},
{
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case.
",
"code": "400"
},
{
"reason": "is returned if collection or the document was not found
",
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or rev is given and the found document has a different version
",
"code": "412"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": true,
"name": "document-handle",
"description": "The Handle of the Document.
"
},
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "waitForSync",
"description": "Wait until document has been sync to disk.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "rev",
"description": "You can conditionally replace a document based on a target revision id by using the rev URL parameter.
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "policy",
"description": "To control the update behavior in case there is a revision mismatch, you can use the policy parameter. This is the same as when replacing documents (see replacing documents for more details).
"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "lang",
"description": "Language of the data.
"
},
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "format",
"description": "False for unformated values (default: true).
"
},
{
"dataType": "String",
"paramType": "header",
"name": "If-Match",
"description": "You can conditionally replace a document based on a target revision id by using the if-match HTTP header.
"
}
],
"notes": "Completely updates (i.e. replaces) the document identified by document-handle. If the document exists and can be updated, then a HTTP 201 is returned and the \"ETag\" header field contains the new revision of the document.
If the new document passed in the body of the request contains the document-handle in the attribute _id and the revision in _rev, these attributes will be ignored. Only the URI and the \"ETag\" header are relevant in order to avoid confusion when using proxies.
Optionally, the URL parameter waitForSync can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync URL parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync URL parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
The body of the response contains a JSON object with the information about the handle and the revision. The attribute _id contains the known document-handle of the updated document, the attribute _rev contains the new document revision.
If the document does not exist, then a HTTP 404 is returned and the body of the response contains an error document.
There are two ways for specifying the targeted document revision id for conditional replacements (i.e. replacements that will only be executed if the revision id found in the database matches the document revision id specified in the request):