Tasks
Update task sharing
Replace a task’s visibility and its shared people and teams.
PUT
/
api
/
v1
/
tasks
/
{task_id}
/
sharing
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"
}
]
}'
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);
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())
{
"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"
}
]
}
This replaces the whole sharing state, so send the full desired lists — anyone omitted loses access.
access_level is read or write.
user_id takes a user id, email address, name, or me for your API key’s user; team_id takes a team id or team name. A reference that matches more than one record is rejected with a 400 that lists the candidates, so pass the id to disambiguate.
Body parameters
The complete set of people with access. Anyone omitted loses access. Each entry is
{"user_id": "<user id, email, name or me>", "access_level": "read" | "write"}.The complete set of teams with access. Any team omitted loses access. Each entry is
{"team_id": "<team id or name>", "access_level": "read" | "write"}.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"
}
]
}'
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);
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())
{
"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"
}
]
}
⌘I
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"
}
]
}'
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);
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())
{
"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"
}
]
}