---
title: "Link two nodes on the supplier network graph"
method: POST
path: "/api/network-companies/graph/{id}/links"
tags: ["Companies", "Network", "Graph"]
---

# Link two nodes on the supplier network graph

`POST /api/network-companies/graph/{id}/links`

## Request

- Base URL: `https://api.retraced.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.retraced.com/api/network-companies/graph/{id}/links`
- Auth: none declared

Creates the directed link from `originNodeId` to `destinationNodeId` on one of the caller company's graphs and answers it with 201 in the `{ data, metadata }` envelope (legacy answered the bare record). Linking the same origin to the same destination again inserts nothing and answers the existing link. 404 `graph_not_found` unless the graph is the caller company's; 400 `invalid_network_graph_node` unless both are different nodes of the graph with at least one facility process.

## Path parameters

- `id` string, required

## Request body

- object
  - `originNodeId` string, required
  - `destinationNodeId` string, required

## Response `201`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required: True when the request succeeded.
  - `data` object, required
    - `id` string, required
    - `networkCompanyGraphId` string, required
    - `originNodeId` string, required
    - `destinationNodeId` string, required

## Other responses

- `400`: Default Response
- `401`: Default Response
- `403`: Default Response
- `404`: Default Response

## Changes

> 108 revisions in range; 2 not diffed.

- **2026-10-18** `4a6f524fc97b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/retraced/apis/api-reference/changes/api/network-companies/graph/:id/links/post.md)

---

[API](https://skmtc.dev/retraced/apis/api-reference.md) - [All operations](https://skmtc.dev/retraced/apis/api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/retraced/apis/api-reference/revisions/83309c4abd20?raw)
