Workspace API
Add View Records
Add records to a Static View with POST /workspace/views/{id}/records/add and /add/batch.
POST https://api.parcelengineering.com/api/v1/workspace/views/{id}/records/addPOST https://api.parcelengineering.com/api/v1/workspace/views/{id}/records/add/batchAdds one or more record IDs to a Static View. Dynamic Views are rejected with 400 view_type_mismatch. Adds are idempotent: an ID already in the View reports ok.
Add costs 0 credits. Requires workspace:write.
The Workspace API requires the Pro plan. A request from a non-Pro workspace or a non-member receives 403 forbidden.
Path parameters
| Parameter | Description |
|---|---|
id | UUID of the Static View. |
Request body
Single:
{ "record_id": "8a1f3c2e-0001-4b7d-9e5a-000000000001" }Batch:
{ "inputs": [ { "record_id": "8a1f3c2e-0001-4b7d-9e5a-000000000001" }, { "record_id": "9b2e4d3f-0002-4b7d-9e5a-000000000002" } ]}1–100 inputs. Each record must exist in the View’s dataset and be visible to the workspace under the same pre-write rules as the web table. A candidate membership cannot authorize itself.
Example
curl -X POST \ https://api.parcelengineering.com/api/v1/workspace/views/a1b2c3d4-0001-4e8d-bf6a-000000000001/records/add \ -H "Authorization: Bearer pcl_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "record_id": "8a1f3c2e-0001-4b7d-9e5a-000000000001" }'const response = await fetch( 'https://api.parcelengineering.com/api/v1/workspace/views/a1b2c3d4-0001-4e8d-bf6a-000000000001/records/add', { method: 'POST', headers: { 'Authorization': 'Bearer pcl_your_api_key', 'Content-Type': 'application/json', }, body: JSON.stringify({ record_id: '8a1f3c2e-0001-4b7d-9e5a-000000000001', }), });
const { data, metadata } = await response.json();Response
{ "data": { "view_id": "a1b2c3d4-0001-4e8d-bf6a-000000000001", "results": [ { "index": 0, "record_id": "8a1f3c2e-0001-4b7d-9e5a-000000000001", "status": "ok" } ] }, "metadata": { "credits": 0, "succeeded": 1, "failed": 0 }}Errors
| Code | Status | When |
|---|---|---|
view_not_found | 404 | Unknown View. |
view_type_mismatch | 400 | Parent is Dynamic. |
record_not_found | (per item) | ID missing from the dataset. |
record_not_visible | (per item) | Record exists but is not visible to the workspace. |