> ## 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 Task Sharing

> Replace a task's visibility and its shared people and teams.

This replaces the whole sharing state, so send the full desired lists — anyone omitted loses access. `access_level` is `read` or `write`.

## Body parameters

<ParamField body="visibility" type="enum" required>
  Who can see the task by default.
</ParamField>

<ParamField body="users" type="array">
  The complete set of people with access. Anyone omitted loses access.
</ParamField>

<ParamField body="teams" type="array">
  The complete set of teams with access. Any team omitted loses access.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.wordsmith.ai/api/v1/tasks/9f8e7d6c-5b4a-3210-9876-543210fedcba/sharing' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "visibility": "private",
    "users": [
      {
        "user_id": "11111111-2222-3333-4444-555555555555",
        "access_level": "write"
      }
    ],
    "teams": [
      {
        "team_id": "1a2b3c4d-5e6f-7081-9200-aabbccddeeff",
        "access_level": "read"
      }
    ]
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wordsmith.ai/api/v1/tasks/9f8e7d6c-5b4a-3210-9876-543210fedcba/sharing", {
    method: "PUT",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "visibility": "private",
      "users": [
        {
          "user_id": "11111111-2222-3333-4444-555555555555",
          "access_level": "write"
        }
      ],
      "teams": [
        {
          "team_id": "1a2b3c4d-5e6f-7081-9200-aabbccddeeff",
          "access_level": "read"
        }
      ]
    }),
  });
  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/sharing"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
  }
  payload = {
      "visibility": "private",
      "users": [
          {
              "user_id": "11111111-2222-3333-4444-555555555555",
              "access_level": "write"
          }
      ],
      "teams": [
          {
              "team_id": "1a2b3c4d-5e6f-7081-9200-aabbccddeeff",
              "access_level": "read"
          }
      ]
  }

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

<ResponseExample>
  ```json Response theme={null}
  {
    "visibility": "private",
    "users": [
      {
        "id": "11111111-2222-3333-4444-555555555555",
        "name": "Jane Doe",
        "email": "jane@example.com",
        "role": "assignee",
        "access_level": "write"
      }
    ],
    "teams": [
      {
        "id": "1a2b3c4d-5e6f-7081-9200-aabbccddeeff",
        "name": "Legal",
        "access_level": "read"
      }
    ]
  }
  ```
</ResponseExample>
