Skip to content

[bug]: User Cannot add Relation Through API With Access Token #10202

Open

Description

@svenakela

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When using an access token towards Plane, creating work item relations returns 403 for workspace Members who are project Admin, only workspace Owners can.

Environment

  • Plane Commercial v3.1.2, self-hosted
  • Public API (/api/v1) with personal API keys (X-API-Key)

Summary

Creating a work item relation through the API returns 403 "You don't have permission to create this workitem_relation" for every key owned by a workspace Member, even when that user is Admin of the project. The same request with a key owned by a workspace Owner returns 201. The same Member account can add the relation in the web UI without a problem.

The permissions matrix lists relations as a project-level permission that project Admins and Contributors have. So the API-key path seems to check the workspace role where it should check the project role.

Findings

  • The payload is fine. With the Owner key the same body gets 201, and invalid bodies get the normal 400 validation errors (rows 4–6).
  • Members are refused before validation. With a Member key even an empty body gets 403 (row 4), so the request is rejected before the body is read.
  • API key scopes are not the difference. All keys have scopes: [] (row 1). Only the workspace role differs.
  • The project role makes no difference for Members. Project Admin and project Contributor both get 403.
  • Only the API-key path is affected. The same Member account can create the relation in the web UI (row 10).
  • Members can still write through the API. Their keys create and update work items fine (row 2), and reading relations works (row 3).

Expected

A workspace Member who is project Admin, or Contributor, can create work item relations through the API, as the permissions matrix says and as the web UI allows.

Actual

Only workspace Owners can create relations through the API. Workspace Members get 403 workitem_relation whatever their project role is.

Notes

  • The error text workitem_relation doesn't appear in the open-source code. In the open-source code, the v1 relation endpoint uses the same permission check as creating a work item. The error seems to come from the Commercial permission engine (<resource_type>:<action>). The v2 permission grants docs say resource types the engine doesn't handle make every request return 403.
  • The v4.0.0 changelog doesn't mention relations, API keys or 403s, so it isn't clear whether an upgrade fixes this.
  • Workaround: give the API-key account the workspace Owner role. That gives it far more access than creating relations should need.

Steps to reproduce

POST /api/v1/workspaces/<workspace>/projects/<project_id>/work-items/<work_item_id>/relations/
Content-Type: application/json
X-API-Key: <key>

{"relation_type": "relates_to", "issues": ["<other_work_item_id>"]}
# Test Workspace Owner
project Admin
Workspace Member
project Admin
Workspace Member
project Contributor
1 GET /api/v2/users/me/ 200, principal_kind: "api_key", scopes: [] 200, scopes: [] 200, scopes: []
2 Create and update work items with the API key works works not tested
3 GET .../work-items/<id>/relations/ 200 200 200
4 POST .../relations/ with an empty body {} 400 relation_type and issues are required 403 workitem_relation 403 workitem_relation
5 POST .../relations/ with malformed JSON 400 JSON parse error not tested not tested
6 POST .../relations/ with relation_type: "nonsense" 400 not a valid choice not tested not tested
7 POST .../work-items/<id>/relations/ with a valid relates_to 201, relation shows on both items 403 workitem_relation (both Member accounts) 403 workitem_relation
8 POST .../issues/<id>/relations/ (old path), valid relates_to 201 403 workitem_relation not tested
9 POST .../relations/remove/ with {"related_issue": "<id>"} 204 not tested (nothing was created) not tested
10 Add the same relation in the web UI works works not tested

The project-Admin result in rows 4 and 7 is the same in two different projects.

Environment

Production

Browser

Google Chrome

Edition

Commercial

Version

v3.1.2

Activity

  1. added theissue type on Nov 5, 2026
  2. makeplane commented on Nov 5, 2026

    @makeplane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

planesync issues to Plane🐛bugSomething isn't working

Type

Fields

Edition

None yet

Version

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions