Workspace API
Follow
Follow and unfollow accounts and projects with POST /workspace/follow and /workspace/unfollow, and read follow status.
Following an account or project adds it to the workspace’s Following View for its dataset: “Following · Projects” or “Following · Accounts”. Each is a watched Static View, created the first time anyone in the workspace follows a record of that kind and favorited for the member who created it. Following is shared by the workspace. Every route costs 0 credits and works with a user JWT or an API key.
Any other Static View can be watched too (watched: true on Upsert View), so a record is followed when it is in at least one watched View. Unfollow removes a record from the Following View only; watched Views you made keep it, and the response names them.
A request from a non-member receives 403 forbidden.
Follow or unfollow
POST https://api.parcelengineering.com/api/v1/workspace/followPOST https://api.parcelengineering.com/api/v1/workspace/follow/batchPOST https://api.parcelengineering.com/api/v1/workspace/unfollowPOST https://api.parcelengineering.com/api/v1/workspace/unfollow/batchBody (single)
| Field | Type | Required | Description |
|---|---|---|---|
dataset | project | account | Yes | Contacts cannot be followed. |
record_id | string (UUID) | Yes | The project or account id. |
The batch routes take { "inputs": [ { "dataset", "record_id" }, ... ] } with 1-100 items; accounts and projects may mix. Results come back per item in input order, and one failure never aborts the rest. See Batch Writes.
Example
curl -X POST "https://api.parcelengineering.com/api/v1/workspace/follow" \ -H "Authorization: Bearer pk_live_..." \ -H "Content-Type: application/json" \ -d '{"dataset":"project","record_id":"p1e2f3a4-0001-4b7c-9e5d-000000000001"}'const response = await fetch('https://api.parcelengineering.com/api/v1/workspace/follow', { method: 'POST', headers: { 'Authorization': 'Bearer pk_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ dataset: 'project', record_id: 'p1e2f3a4-0001-4b7c-9e5d-000000000001' }),});
const { data, metadata } = await response.json();Response
{ "data": { "view": { "id": "a1b2c3d4-0001-4e8d-bf6a-000000000009", "dataset": "project", "view_type": "static", "name": "Following · Projects", "watched": true, "system_kind": "following_projects" }, "results": [ { "index": 0, "record_id": "p1e2f3a4-0001-4b7c-9e5d-000000000001", "status": "ok" } ], "changed": 1 }, "metadata": { "credits": 0, "succeeded": 1, "failed": 0 }}The View object is abbreviated here; it is the full View resource. Following is idempotent: a record that is already followed answers ok, and changed counts only the records this call followed (or, for unfollow, removed). A batch response carries data.views (the Following Views it touched) and per-item results that echo dataset. Unfollow responses add still_followed: each record that stays followed through another watched View, with those Views. Unfollow answers view: null when the workspace never followed anything of that kind.
Errors
| Code | Status | When |
|---|---|---|
bad_request | 400 | dataset is not project or account, or a batch item is malformed (per item). |
record_not_found | 200 (per item) | The id is not a project or account. |
view_name_conflict | 409 | One of your Views already uses the name “Following · Projects” or “Following · Accounts”. Rename it, then follow again. |
Follow status
GET https://api.parcelengineering.com/api/v1/workspace/follow/status?dataset=project&record_id={id}Lists every watched View the record is in, the Following View first. followed is true when there is at least one; system_view_id is the Following View when the record is in it.
{ "data": { "followed": true, "system_view_id": "a1b2c3d4-0001-4e8d-bf6a-000000000009", "via": [ { "view_id": "a1b2c3d4-0001-4e8d-bf6a-000000000009", "name": "Following · Projects", "system_kind": "following_projects" }, { "view_id": "a1b2c3d4-0001-4e8d-bf6a-000000000002", "name": "Open Deals", "system_kind": null } ] }, "metadata": { "credits": 0 }}