List an audience's effective users
Resolve an audience into the people it admits, paginated. An audience stores roles and user ids. This list tells you who those add up to right now.
A user is listed when any of these is true:
- They are a workspace owner or admin. Those members are admitted by every audience.
- Their id is in the audience's
member_ids. - They hold one of the audience's workspace roles.
- They hold one of the audience's project roles in any project, or in the project you name with
?project_id=.
Only active workspace members are listed, and a role grant that has expired doesn't count. The list doesn't depend on whether the audience is active.
Each row is the user's workspace membership, the same shape as List workspace members: the membership id, the user's member_id, and their workspace role and role_id. Add ?expand=member to get each user's display name, email, and avatar URL in the same call.
Assignees and subscribers aren't listed
A work item the audience restricts is also visible to its own assignees and subscribers, whoever they are. They differ from one work item to the next, so this list leaves them out. Read them from the work item with Get subscribers and its assignee_ids.
An audience you can't see returns 404. Seeing the audience is enough to list its effective users.
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 to resolve.
Query parameters
project_id:optionalstring (uuid)Count project-role holders in this project only. Use it to answer who can see a restricted work item in a given project. Without it, someone who holds one of the audience's project roles in any project is listed. It doesn't change the other three groups. A value that isn't a UUID returns 400.
Ordering
Rows come back in a fixed order, newest first by when each user joined the workspace, 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: id, member_id, role, role_id.
See Sparse fields.
expand:optionalstringComma-separated relations to embed alongside the ids: member (the user, with id, display_name, avatar_url, and email).
Each expanded relation gets its own key: ?expand=member keeps member_id and adds a member 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. A relation name is not a valid ?fields= value, a field name is not a valid ?expand= value, and field filtering never removes an expanded object. See Expanding relations.
Scopes
workspaces.audiences:read
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | project_id isn't a UUID, or an unknown name in fields or expand. |
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/effective-users/?project_id=4af68566-94a4-4eb3-94aa-50dc9427067b&expand=member" \
-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/effective-users/",
headers={"X-Api-Key": "your-api-key"},
params={"project_id": "4af68566-94a4-4eb3-94aa-50dc9427067b", "expand": "member"},
)
print(response.json())const params = new URLSearchParams({
project_id: "4af68566-94a4-4eb3-94aa-50dc9427067b",
expand: "member",
});
const response = await fetch(
`https://api.plane.so/api/v2/workspaces/my-team/audiences/8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312/effective-users/?${params}`,
{
headers: {
"X-Api-Key": "your-api-key",
},
},
);
const data = await response.json();{
"data": [
{
"id": "84c559e1-99eb-4972-93b6-0bccfd2cb2a2",
"member_id": "8ea770c7-d743-464a-9ede-788850dfa5e8",
"role": "security-analyst",
"role_id": "2d9928ef-5023-492a-aa63-98d19b8c52ca",
"member": {
"id": "8ea770c7-d743-464a-9ede-788850dfa5e8",
"display_name": "Mei Tanaka",
"avatar_url": null,
"email": "mei@example.com"
}
},
{
"id": "d95f9ae2-6144-435f-b138-e975776fff33",
"member_id": "7f2b9e04-6c1d-4a58-9e3b-0d4c8a2f6b71",
"role": "member",
"role_id": "b7d87763-9dbc-42cd-b4db-5860830962e6",
"member": {
"id": "7f2b9e04-6c1d-4a58-9e3b-0d4c8a2f6b71",
"display_name": "Devansh Kapoor",
"avatar_url": null,
"email": "devansh@example.com"
}
},
{
"id": "e5632f90-feb5-4e3d-9556-49efa8e182c3",
"member_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
"role": "owner",
"role_id": "b9c073fc-70e0-4c3b-82f8-845b8b174180",
"member": {
"id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
"display_name": "Priya Raghavan",
"avatar_url": "https://assets.plane.so/avatars/16c61a3a.png",
"email": "priya@example.com"
}
}
],
"next": null,
"previous": null,
"total_count": 3,
"pagination": {
"style": "offset"
}
}{
"data": [
{
"id": "84c559e1-99eb-4972-93b6-0bccfd2cb2a2",
"member_id": "8ea770c7-d743-464a-9ede-788850dfa5e8",
"role": "security-analyst",
"role_id": "2d9928ef-5023-492a-aa63-98d19b8c52ca"
},
{
"id": "d95f9ae2-6144-435f-b138-e975776fff33",
"member_id": "7f2b9e04-6c1d-4a58-9e3b-0d4c8a2f6b71",
"role": "member",
"role_id": "b7d87763-9dbc-42cd-b4db-5860830962e6"
},
{
"id": "e5632f90-feb5-4e3d-9556-49efa8e182c3",
"member_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
"role": "owner",
"role_id": "b9c073fc-70e0-4c3b-82f8-845b8b174180"
}
],
"next": null,
"previous": null,
"total_count": 3,
"pagination": {
"style": "offset"
}
}
