---
title: "Replace relationships between a Node and its linked Nodes"
method: PATCH
path: "/nodes/{node_id}/relationships/linked_nodes/"
tags: ["Nodes"]
---

# Replace relationships between a Node and its linked Nodes

`PATCH /nodes/{node_id}/relationships/linked_nodes/`

Replace all existing linked nodes for a node with a new set of linked nodes.
#### Permissions - The authenticated user must have write permissions on the node.
#### Request Body - A `data` array containing the new list of node resource identifier objects (`type` and `id`).
#### Returns - The updated list of linked nodes for the node.

## Path parameters

- `node_id` string, required

## Request body

- object
  - `data` object[]
    - `type` 'nodes', required — Must be `nodes`.
    - `id` string, required — The unique identifier for the node.

## Response `200`

Successfully replaced linked nodes for the node.

## Other responses

- `400` — Bad Request. The submitted data is invalid.
- `401` — Unauthorized. Authentication is required.
- `403` — Forbidden. You do not have permission to modify linked nodes for this node.
- `404` — Not Found. No node matches the given ID.

---

[API](https://skmtc.net/osf/apis/osf-apiv2-documentation.md) · [All operations](https://skmtc.net/osf/apis/osf-apiv2-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/osf/osf-apiv2-documentation/versions/ca701048eb0d/schema)
