> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://support.atomicwork.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://support.atomicwork.com/_mcp/server.

# Link multiple entities at once

POST https://{tenant}.atomicwork.com/api/v1/entities/{entity_type}/{display_id}/links
Content-Type: application/json

Creates multiple relationships between the source entity and target entities.
Each link can be a different relationship type and direction.


Reference: https://support.atomicwork.com/api-reference/atomicwork-public-api/entities/postapi-v-1-entities-entity-type-display-id-links

## Authentication

- `X-Api-Key` header (required) — API Key authentication via header

## Request

### Path parameters

- `entity_type` (enum, required) — The entity type (e.g. REQUEST, CHANGE)
  - Allowed values: `REQUEST`, `SERVICE_REQUEST`, `QUESTION_REQUEST`, `INCIDENT_REQUEST`, `INCIDENT`, `PROBLEM_REQUEST`, `PROBLEM`, `USER`, `SERVICE_ITEM`, `CUSTOM_FORM`, `SURVEY`, `ASSET`, `CHANGE`, `CHANGE_TEMPLATE`, `CUSTOM_OBJECT`, `STANDALONE`, `EXTERNAL_WEBHOOK`
- `display_id` (string, required) — The display ID of the source entity (e.g. REQ-123, CHG-456)

### Headers

- `X-Workspace-Id` (string, optional)

### Body (application/json)

This endpoint expects an object.

- `reference_key` (string, required) — Reference key of the relationship (e.g., "relates", "blocks", "causes", or "implicit_causes")
- `entities` (list of ApiV1EntitiesEntityTypeDisplayIdLinksPostRequestBodyContentApplicationJsonSchemaEntitiesItems, required) — List of entity groups to link, each specifying a target entity type and its display IDs

## Response

### 200

Successful response

## Types

### ApiV1EntitiesEntityTypeDisplayIdLinksPostRequestBodyContentApplicationJsonSchemaEntitiesItems

A group of entities of the same type to link

- `entity_type` (enum, required) — The entity type of the target display IDs
  - Allowed values: `REQUEST`, `CHANGE`, `SERVICE_REQUEST`, `INCIDENT`, `PROBLEM`
- `display_ids` (list of string, required) — List of target entity display IDs to link (e.g., REQ-123, CHG-456)

## Examples

**Request**

```json
{
  "reference_key": "",
  "entities": [
    {
      "entity_type": "REQUEST",
      "display_ids": [
        "string"
      ]
    }
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python Entities_postapi_v1_entities__entity_type___display_id__links_example
import requests

url = "https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links"

payload = {
    "reference_key": "",
    "entities": [
        {
            "entity_type": "REQUEST",
            "display_ids": ["string"]
        }
    ]
}
headers = {
    "X-Workspace-Id": "{{workspace_id}}",
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Entities_postapi_v1_entities__entity_type___display_id__links_example
const url = 'https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links';
const options = {
  method: 'POST',
  headers: {
    'X-Workspace-Id': '{{workspace_id}}',
    'X-Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"reference_key":"","entities":[{"entity_type":"REQUEST","display_ids":["string"]}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Entities_postapi_v1_entities__entity_type___display_id__links_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links"

	payload := strings.NewReader("{\n  \"reference_key\": \"\",\n  \"entities\": [\n    {\n      \"entity_type\": \"REQUEST\",\n      \"display_ids\": [\n        \"string\"\n      ]\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Workspace-Id", "{{workspace_id}}")
	req.Header.Add("X-Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Entities_postapi_v1_entities__entity_type___display_id__links_example
require 'uri'
require 'net/http'

url = URI("https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Workspace-Id"] = '{{workspace_id}}'
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reference_key\": \"\",\n  \"entities\": [\n    {\n      \"entity_type\": \"REQUEST\",\n      \"display_ids\": [\n        \"string\"\n      ]\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Entities_postapi_v1_entities__entity_type___display_id__links_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links")
  .header("X-Workspace-Id", "{{workspace_id}}")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reference_key\": \"\",\n  \"entities\": [\n    {\n      \"entity_type\": \"REQUEST\",\n      \"display_ids\": [\n        \"string\"\n      ]\n    }\n  ]\n}")
  .asString();
```

```php Entities_postapi_v1_entities__entity_type___display_id__links_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links', [
  'body' => '{
  "reference_key": "",
  "entities": [
    {
      "entity_type": "REQUEST",
      "display_ids": [
        "string"
      ]
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
    'X-Workspace-Id' => '{{workspace_id}}',
  ],
]);

echo $response->getBody();
```

```csharp Entities_postapi_v1_entities__entity_type___display_id__links_example
using RestSharp;

var client = new RestClient("https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Workspace-Id", "{{workspace_id}}");
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"reference_key\": \"\",\n  \"entities\": [\n    {\n      \"entity_type\": \"REQUEST\",\n      \"display_ids\": [\n        \"string\"\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Entities_postapi_v1_entities__entity_type___display_id__links_example
import Foundation

let headers = [
  "X-Workspace-Id": "{{workspace_id}}",
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "reference_key": "",
  "entities": [
    [
      "entity_type": "REQUEST",
      "display_ids": ["string"]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://{tenant}.atomicwork.com/api/v1/entities/REQUEST/display_id/links")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```