Get a work item's audiences
Get the audiences that restrict a work item, and where they come from. Only people an audience admits, plus the work item's own assignees and subscribers, can see a restricted work item.
A work item's own audiences override its type's, and the two are never mixed. So the response lists the work item's own audiences when it has any, with source set to work_item. When it has none, it lists the audiences of its work item type, with source set to work_item_type.
Only active audiences restrict, so enforced_source tells you which level applies:
| The work item has | source | enforced_source | audiences |
|---|---|---|---|
| Own audiences, at least one active | work_item | work_item | Its own |
| Own audiences, all inactive | work_item | work_item_type if the type has an active one, otherwise null | Its own |
| No own audiences, and its type has some | work_item_type | work_item_type if one is active, otherwise null | The type's |
| No audiences at either level | work_item | null | [] |
enforced_source: null means the work item isn't restricted. Audiences are listed oldest attachment first.
This works on archived work items without ?archived=.
Path parameters
slug:requiredstringThe workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.
project_id:requiredstring (uuid)The project the work item belongs to.
pk:requiredstringThe work item's UUID or its identifier, such as PROJ-157.
Response
sourcestring. Whereaudiencescomes from.work_item: the work item's own attachments, which you change with Update a work item's audiences.work_item_type: inherited from its type, which you change on the type.enforced_sourcestring or null. The level that restricts the work item:work_item,work_item_type, ornullwhen nothing does. It can differ fromsourcewhen all of the work item's own audiences are inactive.audiencesarray of object. The audiences at thesourcelevel, active and inactive, each withid,name,logo_props, andis_active.
Scopes
projects.work_items:read
Errors
| Status | Code | Cause |
|---|---|---|
401 | unauthorized | Missing or invalid credentials. |
402 | payment_required | Work item security isn't on your plan, or is switched off. |
403 | forbidden | Your token scope can't read work items. |
404 | not_found | No such work item, it's outside your project or tenant, you can't view it, or it's a draft, a triage work item, or in an archived project. |
406 | not_acceptable | The Accept header asks for a representation the API can't produce. |
429 | rate_limited | Throttled. Honor the Retry-After header before retrying. |
curl -X GET \
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b/work-items/47ed6fba-1a4d-4b19-8c67-28d835d2c2c7/audiences/" \
-H "X-Api-Key: $PLANE_API_KEY"import requests
response = requests.get(
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b"
"/work-items/47ed6fba-1a4d-4b19-8c67-28d835d2c2c7/audiences/",
headers={"X-Api-Key": "your-api-key"},
)
print(response.json())const response = await fetch(
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b" +
"/work-items/47ed6fba-1a4d-4b19-8c67-28d835d2c2c7/audiences/",
{
headers: {
"X-Api-Key": "your-api-key",
},
},
);
const data = await response.json();{
"source": "work_item",
"enforced_source": "work_item",
"audiences": [
{
"id": "8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312",
"name": "Security response",
"logo_props": {},
"is_active": true
}
]
}{
"source": "work_item_type",
"enforced_source": "work_item_type",
"audiences": [
{
"id": "8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312",
"name": "Security response",
"logo_props": {},
"is_active": true
}
]
}{
"source": "work_item",
"enforced_source": null,
"audiences": []
}
