List an audience's work items
List the work items this audience is attached to directly, paginated, across every project in the workspace. Each row has the same shape as a row from List work items.
Only direct attachments are listed. A work item restricted through its work item type isn't here, even though the audience applies to it. To see those types, use List an audience's work item types.
Work items you can't see are left out, so two callers can get different lists for the same audience. Deleted work items are left out too, but the list isn't limited to active ones: archived work items, drafts, and triage work items the audience is attached to are included. Check archived_at and is_draft on each row.
An audience you can't see returns 404.
Read-only route
To attach or detach the audience, use Update a work item's audiences on each work item.
The list takes no filters and no search.
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.
pk:requiredstring (uuid)The audience whose work items you want to list.
Ordering
Rows come back in a fixed order, newest work item first, with id as the tiebreaker. The order is not configurable, and an order_by you send is ignored.
Pagination
per_page:optionalintegerPage size. Defaults to 50, maximum 200.
offset:optionalintegerNumber of rows to skip from the start of the result set. Maximum 10000. Use the next value from the response instead of computing offsets yourself.
count:optionalbooleanDefaults to true. Set to false to skip the COUNT(*) behind total_count. The field is then omitted from the response.
Response shaping
fields:optionalstringComma-separated list of fields to return on each row. Fields you don't request are left out of the response instead of coming back as null, so a missing key means you didn't ask for it and null means the value is null. id is always included, whether or not you name it.
Pass all to get every requestable field. An unknown field name returns 400 with the list of valid names and the closest match, so a typo is caught instead of being silently ignored.
Requestable here: archived_at, assignee_ids, completed_at, created_at, created_by_id, cycle_id, description_html, estimate_point_id, external_id, external_source, id, identifier, is_draft, label_ids, module_ids, name, parent_id, priority, project_id, sequence_id, sort_order, start_date, state_id, target_date, type_id, updated_at, updated_by_id.
Rows leave out description_html unless you name it here. Naming custom_fields returns 400, because it is only available on single-object responses.
See Sparse fields.
expand:optionalstringComma-separated relations to embed alongside the ids: assignees (the assigned users), cycle (the cycle it belongs to), estimate_point (its estimate point), labels (the applied labels), modules (the modules it belongs to), parent (its parent work item), state (the work item's state object), type (its work item type).
Expanded objects get their own key: ?expand=state keeps state_id and adds a state object next to it, so an id is never replaced by an object. An unknown value returns 400.
?fields= and ?expand= take separate sets of names. Relation names aren't valid in ?fields=, field names aren't valid in ?expand=, and field filtering never removes an expanded object: ?fields=id,name&expand=state returns id, name, and state. See Expanding relations.
Scopes
workspaces.audiences:read
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | An unknown name in fields or expand, or custom_fields in fields. |
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 doesn't allow this. |
404 | not_found | No such audience in this workspace, you can't view audiences, 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. |
curl -X GET \
"https://api.plane.so/api/v2/workspaces/my-team/audiences/8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312/work-items/?fields=id,name,identifier,project_id,archived_at" \
-H "X-Api-Key: $PLANE_API_KEY"import requests
response = requests.get(
"https://api.plane.so/api/v2/workspaces/my-team/audiences/8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312/work-items/",
headers={"X-Api-Key": "your-api-key"},
params={"fields": "id,name,identifier,project_id,archived_at"},
)
print(response.json())const params = new URLSearchParams({ fields: "id,name,identifier,project_id,archived_at" });
const response = await fetch(
`https://api.plane.so/api/v2/workspaces/my-team/audiences/8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312/work-items/?${params}`,
{
headers: {
"X-Api-Key": "your-api-key",
},
},
);
const data = await response.json();{
"data": [
{
"id": "47ed6fba-1a4d-4b19-8c67-28d835d2c2c7",
"name": "Rotate leaked staging API key",
"identifier": "PROJ-157",
"project_id": "4af68566-94a4-4eb3-94aa-50dc9427067b",
"archived_at": null
}
],
"next": null,
"previous": null,
"total_count": 1,
"pagination": {
"style": "offset"
}
}
