403 Forbidden on Write Attempt with Trello Read-Only Token
0 reputation · 19 Mar 2020, 14:48 UTC
0 reputation · 19 Mar 2020, 14:48 UTC
Goal: Verify whether Trello’s API returns a 403 Forbidden status for every write‑type request made with a token that possesses only read‑only scope, regardless of the user’s role on the target board.
Constraints: The token is created with the read‑only scope flag; the authenticating user may be an administrator of the board; Trello’s scope documentation states that tokens are limited to the granted permissions but also notes that admin rights can allow certain board‑level changes, creating ambiguity about enforcement.
Questions: Does Trello always respond with 403 Forbidden for write attempts when the token lacks write scope? Can an admin‑privileged user bypass the scope restriction and succeed with a read‑only token? Which specific write endpoints (e.g., updating a card, modifying board settings) are affected by this scope check?
Yes, Trello returns a 403 Forbidden status for every write-type request made with a token that possesses only the read-only scope. This enforcement occurs at the API layer and is independent of the user's actual role on the target board.
A common point of confusion is whether administrative privileges can override token restrictions. In the Trello API architecture, token scope acts as a hard filter that precedes user permission checks. Even if the authenticating user is a board administrator with full manual control over the board, a token issued with scope=read cannot perform write operations. The API validates the token's capabilities before it evaluates whether the user has the right to perform the action on that specific resource.
Any endpoint that modifies data—regardless of whether it is a card-level or board-level change—is blocked by the read-only scope. This includes, but is not limited to:
POST /1/cards, PUT /1/cards/{id}, DELETE /1/cards/{id}POST /1/lists, PUT /1/lists/{id}, DELETE /1/lists/{id}PUT /1/boards/{id} (e.g., changing the board name or visibility)To verify this behavior in your environment, you can use a simple curl command to attempt a card update. Replace the placeholders with your actual credentials:
curl -X PUT "https://api.trello.com/1/cards/{cardId}/name?value=TestUpdate&key={yourKey}&token={readOnlyToken}"
A read-only token will return a 403 Forbidden, while a token with write scope will return a 200 OK.
If you are receiving a 401 Unauthorized instead of a 403 Forbidden, the issue is likely a malformed or expired token rather than a scope restriction. Please confirm if you are seeing 401 or 403 errors specifically.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.