POST /links
Description
Adds a new link and returns a JSON object containing the newly created link ID.
This route processes HTTP POST requests sent to the /links endpoint.
Payload
The server expects a JSON object with the following properties:
| Name | Type | Description |
|---|---|---|
source | number or string | Required. The ID of the starting point of the link. |
target | number or string | Required. The ID of the ending point of the link. |
relation | string | Required. Specifies the type of relationship the link represents. |
Example:
{
"source": 1,
"target": 2,
"relation": "relatesTo"
}
Response
The response returns a JSON object with the ID of the newly created link.
Example:
{
"id": 1
}
The HTTP status code indicates whether the request was successful (response.status == 200) or encountered an error (response.status == 500).
Related articles: