> ## Documentation Index
> Fetch the complete documentation index at: https://wordsmithai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Link

> Change the role or context of one link on a task.

The link is addressed by type and id in the path, as in [Unlink Item](/api-reference/tasks/remove-link). Only the fields you send are changed, and at least one is required. Returns the updated task.

A link the task does not have is a `404`. A `context` that does not fit the link type is a `400`. Added 2026-10-13.

## Body parameters

<ParamField body="role" type="enum">
  Why the task links to the item: `reference` (supporting context), `subject` (what the task is about) or `output` (produced by the task).
</ParamField>

<ParamField body="context" type="object">
  Fields specific to the link type. Only `review` links take one: `{"check_ids": [...]}` narrows the link to those checks of the review. Send null to clear it.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PATCH 'https://api.wordsmith.ai/api/v1/tasks/9f8e7d6c-5b4a-3210-9876-543210fedcba/links/review/8e1d2c3b-4a59-4687-9a0b-1c2d3e4f5a6b' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "role": "subject",
    "context": { "check_ids": ["liability-cap", "indemnity"] }
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wordsmith.ai/api/v1/tasks/9f8e7d6c-5b4a-3210-9876-543210fedcba/links/review/8e1d2c3b-4a59-4687-9a0b-1c2d3e4f5a6b", {
    method: "PATCH",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "role": "subject",
      "context": { "check_ids": ["liability-cap", "indemnity"] }
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.wordsmith.ai/api/v1/tasks/9f8e7d6c-5b4a-3210-9876-543210fedcba/links/review/8e1d2c3b-4a59-4687-9a0b-1c2d3e4f5a6b"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
  }
  payload = {
      "role": "subject",
      "context": {"check_ids": ["liability-cap", "indemnity"]}
  }

  response = requests.patch(url, headers=headers, json=payload)
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "9f8e7d6c-5b4a-3210-9876-543210fedcba",
    "display_id": "#12",
    "task_number": 12,
    "title": "Review the Acme NDA",
    "description": "Check the indemnity and termination clauses.",
    "additional_context": "Counterparty has pushed back twice on liability caps.",
    "status": "in_progress",
    "priority": "high",
    "team": {
      "id": "1a2b3c4d-5e6f-7081-9200-aabbccddeeff",
      "name": "Legal"
    },
    "creator": {
      "id": "11111111-2222-3333-4444-555555555555",
      "name": "Jane Doe",
      "email": "jane@example.com"
    },
    "assigned_to": {
      "id": "11111111-2222-3333-4444-555555555555",
      "name": "Jane Doe",
      "email": "jane@example.com"
    },
    "assigned_agent": null,
    "assigned_team": null,
    "matter": null,
    "complete_by": "2026-01-01T00:00:00Z",
    "tags": [
      "nda",
      "urgent"
    ],
    "source_channel": "web",
    "visibility": "customer",
    "archived": false,
    "draft": false,
    "involved_people": [
      {
        "id": "11111111-2222-3333-4444-555555555555",
        "name": "Jane Doe",
        "email": "jane@example.com",
        "role": "assignee",
        "access_level": "write"
      }
    ],
    "shared_teams": [],
    "linked_items": [
      {
        "type": "review",
        "id": "8e1d2c3b-4a59-4687-9a0b-1c2d3e4f5a6b",
        "display_name": "Acme NDA",
        "role": "subject",
        "context": {
          "check_ids": [
            "liability-cap",
            "indemnity"
          ]
        },
        "is_output": false
      }
    ],
    "input_files": [],
    "output_files": [],
    "created_at": "2025-12-31T00:00:00Z",
    "updated_at": "2025-12-31T01:00:00Z"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.