Archive instead
Most writable archivable resources useisArchived. Locations use DELETE to archive, and deliveries have /archive and /restore commands. Read-only organization lists do not expose archive writes. For projects, set isArchived:
- Resources with collision handling can give the record’s name or identifier an
- (archived <timestamp>)suffix so it stops colliding with your active records, where<timestamp>is the archive time in epoch milliseconds. Restoring strips the suffix, and picks the next free variant if something has taken the original name meanwhile. Match the suffix with a pattern rather than a literal string. archivedAtis stamped with the current time, and cleared again on restore, for the resources that carry the field. Each resource page lists its own fields: People and Stages both carryisArchivedandarchivedAt.- Models with an archive-aware default filter hide archived records from reads,
including reads by id. Plain link/reporting models can expose an
isArchivedfield without applying that default; their resource pages call this out.
isArchived eq false, so
ask for archived records explicitly when you want them:
isArchived replaces the default rather than narrowing it, and repeating the
parameter matches either value, so one request can return both:
Archiving in bulk
PATCH /<resource>/bulk archives everything matching a filter, which is the safe
counterpart to the bulk delete that does not exist:
Not every resource is archivable. Work sessions and QC records have no
isArchived field. Documents do support archive and restore through isArchived; the Hub archived view uses archived=true.What each delete actually does
Deletes differ per resource, and the differences matter. Some cascade, some relink first, some are refused outright.Resources added with materials and delivery
Deleting a deliverable relinks before it removes
This is the one delete with real machinery behind it, because losing hours or QC history silently would be worse than refusing the request. Before the rows go:- Work sessions on any node in the subtree are moved onto the nearest surviving ancestor, so the hours stay attributed to something real.
- QC inspection sets are moved the same way.
- Dependency links touching any deleted node are removed with it.
400
if the subtree has any work sessions or QC entries:
Bulk delete does not exist
On writable factory resources,DELETE /<resource>/bulk returns 403. Read-only resources do not register that route. A broad filter can never
wipe out a table in one call, by design. Archive them in bulk instead, or delete
them one at a time on the resources where a single delete is allowed at all. People
are not one of them: DELETE /worker/{id} returns 403 too.
Why a delete comes back as 409
A409 with code: "FK_VIOLATION" means another record still points at the one
you are deleting, and the database is protecting it:
Picking between them
Archive when
The work happened. You need the history for payroll, QC, or reporting, and you
only want it out of the way. This is nearly always the right answer.
Delete when
The record was a mistake: a duplicate order, a test project, a node created with
the wrong type. Nothing real depends on it yet.