Skip to content

Update a work item type's audiences ​

PATCH/api/v2/workspaces/{slug}/projects/{project_id}/work-item-types/{pk}/audiences/

Attach the audiences in add to a work item type and detach the ones in remove, then get back the type's full audience list. Audiences you don't name stay as they are.

An active audience on a type restricts every work item of that type. Work items that have active audiences of their own are unaffected, because a work item's own audiences override its type's. Only people the type's audiences admit can create work items of the type. For anyone else, setting this type on a work item returns 400, as if the type didn't exist.

Only types this project owns

The project route reads every type the project uses, but changes only the types it owns. A workspace type imported into the project returns 409 work_item_types_managed_at_workspace. Change its audiences with Update a workspace work item type's audiences instead. This check doesn't depend on the work item type mode.

Path parameters ​

slug:requiredstring

The 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 owns the type.

pk:requiredstring (uuid)

The id of the work item type.

Body parameters ​

add:optionalarray of string (uuid)

Audience ids to attach. Up to 100. Attaching an audience that is already attached changes nothing, and duplicate ids count once.

Every id must be an audience in this workspace. If one isn't, the request returns 400 and nothing is written. You can attach an inactive audience. It restricts nothing until it is turned on.

remove:optionalarray of string (uuid)

Audience ids to detach. Up to 100. Detaching an audience that isn't attached, or an id that names no audience, changes nothing.

An id in both add and remove is a 400. A body with neither field, such as {}, changes nothing and returns the current list.

Scopes ​

projects.work_item_types:write

Errors ​

StatusCodeCause
400invalid_requestadd or remove isn't an array of UUIDs, has more than 100 ids, or shares an id with the other. Or an id in add isn't an audience in this workspace.
401unauthorizedMissing or invalid credentials.
402payment_requiredWork item security isn't on your plan, or is switched off.
403forbiddenYour role or token scope can't configure this project's work item types.
404not_foundNo such type in this project, the type belongs to another project, or no such workspace or project.
405method_not_allowedYou sent PUT. Use PATCH.
406not_acceptableThe Accept header asks for a representation the API can't produce.
409work_item_types_managed_at_workspaceThe type is a workspace type. Change its audiences on the workspace route.
413payload_too_largeThe request body is over the size limit.
415unsupported_media_typeThe Content-Type isn't one this endpoint accepts.
429rate_limitedThrottled. Honor the Retry-After header before retrying.
Update a work item type's audiences
bash
curl -X PATCH \
  "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" \
  -H "Content-Type: application/json" \
  -d '{
  "add": ["8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312"]
}'
Response200
json
{
  "audiences": [
    {
      "id": "8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312",
      "name": "Security response",
      "logo_props": {},
      "is_active": true
    }
  ]
}
Response409
json
{
  "type": "conflict",
  "code": "work_item_types_managed_at_workspace",
  "detail": "This work item type belongs to the workspace. Change its audiences on the workspace work item types route."
}

What a PATCH changes ​

  • The response is the type's full audience list after the change, oldest attachment first.
  • Each audience the call attaches or detaches adds an attached or detached entry to that audience's activity. Work items of the type get no activity entry.
  • The change applies as one transaction. If any id in add fails, nothing is attached or detached.

You can restrict work items away from yourself

Attaching an active audience that doesn't admit you hides this type's work items from you, unless you are a workspace owner or admin, or the assignee or a subscriber of a given work item. Check List an audience's effective users with ?project_id= first.