Skip to content

Update a workspace work item type's audiences ​

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

Attach the audiences in add to a workspace 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 workspace type restricts every work item of that type in every project that uses it. 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.

This route changes workspace types only. A type that a project owns returns 404 here. Change it with Update a work item type's audiences. Unlike the other workspace type writes, this one 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.

pk:requiredstring (uuid)

The id of the workspace 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 ​

workspaces.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 edit the workspace's work item types.
404not_foundNo such workspace type, the type belongs to a project, or it's outside your tenant.
405method_not_allowedYou sent PUT. Use PATCH.
406not_acceptableThe Accept header asks for a representation the API can't produce.
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 workspace work item type's audiences
bash
curl -X PATCH \
  "https://api.plane.so/api/v2/workspaces/my-team/work-item-types/833d4a05-ec1d-469f-8c9d-73f354f44481/audiences/" \
  -H "X-Api-Key: $PLANE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "add": ["8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312"],
  "remove": ["33d89ed2-712a-4fc0-93cf-91eedbba5ef1"]
}'
Response200
json
{
  "audiences": [
    {
      "id": "8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312",
      "name": "Security response",
      "logo_props": {},
      "is_active": true
    }
  ]
}
Response400
json
{
  "type": "invalid_request",
  "code": "invalid_request",
  "detail": "One or more fields failed validation.",
  "errors": [
    {
      "field": "remove",
      "code": "invalid",
      "message": "Listed in both add and remove: ['8bcf2c8f-7bd0-4d0c-bdc6-82df9fa1f312']"
    }
  ]
}

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 first.