Get a work item type's audiences
GET/api/v2/workspaces/{slug}/projects/{project_id}/work-item-types/{pk}/audiences/
Get the audiences attached to a work item type. Each active one restricts every work item of the type, except work items that have active audiences of their own. Audiences are listed oldest attachment first, active and inactive alike.
This reads any type the project uses, including a workspace type imported into the project. You can only change the audiences of a type the project owns here. A workspace type's audiences are changed with Update a workspace work item type's audiences.
Reads work in either work item type mode.
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 that uses the type.
pk:requiredstring (uuid)The id of the work item type.
Response
audiencesarray of object. The audiences attached to the type, each withid,name,logo_props, andis_active. An empty array means the type restricts nothing.
Scopes
projects.work_item_types: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 role or token scope can't read this project's work item types. |
404 | not_found | No such type in this project, no such workspace or project, or it's outside your tenant. |
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. |
Get a work item type's audiences
bash
curl -X GET \
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b/work-item-types/d0367de2-020a-42b1-a9cc-aba9ae4ad8af/audiences/" \
-H "X-Api-Key: $PLANE_API_KEY"python
import requests
response = requests.get(
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b"
"/work-item-types/d0367de2-020a-42b1-a9cc-aba9ae4ad8af/audiences/",
headers={"X-Api-Key": "your-api-key"},
)
print(response.json())javascript
const response = await fetch(
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b" +
"/work-item-types/d0367de2-020a-42b1-a9cc-aba9ae4ad8af/audiences/",
{
headers: {
"X-Api-Key": "your-api-key",
},
},
);
const data = await response.json();Response200
json
{
"audiences": [
{
"id": "8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312",
"name": "Security response",
"logo_props": {},
"is_active": true
}
]
}
