Add a folder to Favourites

Add a folder shortcut through Dosya's REST API, because current web and mobile clients expose file favourites but no folder-favourite control.

Last reviewed

The current data model supports personal folder favourites, but the reviewed web and mobile file menus do not provide an Add to favourites control for folders. Use a personal group for a fully graphical workflow. Advanced users can create the folder pointer through the REST API.

A folder favourite references the existing folder. It does not copy its contents, change its parent, consume more storage, or grant access to anybody else.

Folder favourite REST flow from workspace and folder identifiers to a personal pointer verified in the mobile list or API response.
Create one folder pointer with a full-scope, workspace-pinned API credential, then read it back without changing the folder tree. Open full-size screenshot.

Before you start

  • Prefer Add to group when you need a client-only shortcut. Groups are available for folders in browser and mobile file menus.
  • For the POST route, obtain the workspace ID and live folder ID. Use a bearer API key with full scope, API access, and a pin to that same workspace; restricted read, upload, clipper, or wp_site scopes cannot perform this POST.
  • The key owner must be an unconfined workspace member. POST checks membership, target visibility, and the target’s enclosing full-lock chain, but it does not require the role’s Files page permission.
  • Reading the result is stricter: GET /api/favourites refuses a confined member and requires Files page access before it returns visible, unlocked rows.
  • Keep the credential out of terminal history, screenshots, and support messages.

Steps

  1. Put the secret in a protected environment variable and send this request with your real identifiers:

    curl --fail-with-body --request POST "https://api.dosya.dev/api/favourites" \
      -H "Authorization: Bearer $DOSYA_API_KEY" \
      -H "Content-Type: application/json" \
      --data '{"workspace_id":"ws_...","folder_id":"fld_..."}'
  2. A successful first addition returns HTTP 201 with an object containing ok: true and the new favourite-row ID.

  3. Verify with GET /api/favourites?workspace_id=ws_… If the role has Files page access, the matching object appears in the folders array with its real folder_id, folder_name, parent ID, and creation time.

  4. On mobile, Settings → Favourites can render folder rows returned by this API. The browser sidebar currently reads only the response’s files array, so it will not display the folder entry.

  5. Open the folder from mobile or through its normal Files path and confirm the original breadcrumb and contents.

A second POST for the same account and folder returns HTTP 409 with “Already in favourites.” An unknown or hidden target answers “Folder not found.” An enclosing full lock produces “folder_locked,” and a credential tied to another workspace receives “This API key is pinned to a different workspace.”

Organization controls illustrating the supported Add to group alternative for a folder when a graphical favourite control is unavailable.
For everyday navigation, a personal group exposes the folder shortcut in current graphical clients. Open full-size screenshot.

Expected result

The server stores one personal favourite row for the folder, and the source folder remains at its previous location with unchanged content and permissions. A caller that passes the GET membership and Files-access gates can read it, and mobile can display that returned row; the current browser sidebar cannot.

Removal is reversible and affects only the pointer: call DELETE /api/favourites with the same workspace_id and folder_id, then POST again if you need to restore it.

Troubleshooting

There is no folder star in Files. That is the expected current client behavior. Choose Add to group or use the REST request above.

POST is refused before reaching the folder. Confirm that the bearer key has full scope and API surface access. Non-GET REST operations default to full scope unless the route has an explicit narrower override, and favourites POST has none.

GET returns “Not a member” or a Files-access refusal. Confirm the workspace ID, key pin, active membership, absence of folder confinement, and the role’s Files page grant. These GET rules do not retroactively invalidate a successful POST pointer.

The request reports a duplicate. Do not retry. Read the existing favourite row instead; the server enforces one pointer per user and folder.

Was this helpful?

Loading helpfulness results…

Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.

Questions and replies

Ask about the steps in this guide. Questions are reviewed before publication.

Keep account details, credentials and private files out of public questions. Use private support for those.

Loading questions…

    Sign in to your Dosya account to ask a question.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.