{ "basePath": "/", "swaggerVersion": "1.1", "apiVersion": "0.1", "apis": [ { "operations": [ { "errorResponses": [ { "reason": "is returned if the edge was created successfully and waitForSync was true.

", "code": "201" }, { "reason": "is returned if the edge was created successfully and waitForSync was false.

", "code": "202" }, { "reason": "is returned if the body does not contain a valid JSON representation of an edge, or if the collection specified is not an edge collection. The response body contains an error document in this case.

", "code": "400" }, { "reason": "is returned if the collection specified by collection is unknown. The response body contains an error document in this case.

", "code": "404" } ], "parameters": [ { "dataType": "Json", "paramType": "body", "required": true, "name": "edge-document", "description": "A JSON representation of the edge document must be passed as the body of the POST request. This JSON object may contain the edge's document key in the _key attribute if needed.

" }, { "dataType": "String", "paramType": "query", "required": true, "name": "collection", "description": "Creates a new edge in the collection identified by collection name.

" }, { "dataType": "Boolean", "paramType": "query", "required": false, "name": "createCollection", "description": "If this parameter has a value of true or yes, then the collection is created if it does not yet exist. Other values will be ignored so the collection must be present for the operation to succeed.

Note: This flag is not supported in a cluster. Using it will result in an error.

" }, { "dataType": "Boolean", "paramType": "query", "required": false, "name": "waitForSync", "description": "Wait until the edge document has been synced to disk.

" }, { "dataType": "String", "paramType": "query", "required": true, "name": "from", "description": "The document handle of the start point must be passed in from handle.

" }, { "dataType": "String", "paramType": "query", "required": true, "name": "to", "description": "The document handle of the end point must be passed in to handle.

" } ], "notes": "Creates a new edge document in the collection named collection. A JSON representation of the document must be passed as the body of the POST request.

The from and to handles are immutable once the edge has been created.

In all other respects the method works like POST /document.

", "summary": "Create edge", "httpMethod": "POST", "examples": "

Create an edge and read it back:



shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/edge/?collection=edges&from=vertices/1&to=vertices/2 <<EOF\n{ \n  \"name\" : \"Emil\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1641882677\"\nlocation: /_db/_system/_api/document/edges/1641882677\n\n{ \n  \"error\" : false, \n  \"_id\" : \"edges/1641882677\", \n  \"_rev\" : \"1641882677\", \n  \"_key\" : \"1641882677\" \n}\nshell> curl --dump - http://localhost:8529/_api/edge/edges/1641882677\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"1641882677\"\n\n{ \n  \"name\" : \"Emil\", \n  \"_id\" : \"edges/1641882677\", \n  \"_rev\" : \"1641882677\", \n  \"_key\" : \"1641882677\", \n  \"_from\" : \"vertices/1\", \n  \"_to\" : \"vertices/2\" \n}\n



", "nickname": "CreateEdge" } ], "path": "/_api/edge" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the edge was found

", "code": "200" }, { "reason": "is returned if the \"If-None-Match\" header is given and the edge has the same version

", "code": "304" }, { "reason": "is returned if the edge or collection 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. The response will also contain the found document's current revision in the _rev attribute. Additionally, the attributes _id and _key will be returned.

", "code": "412" } ], "parameters": [ { "dataType": "String", "paramType": "path", "required": true, "name": "document-handle", "description": "The handle of the edge document.

" }, { "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 edge is returned if it has a different revision than the given etag. Otherwise an 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 edge 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 edge identified by document-handle. The returned edge contains a few special attributes: