Archive & delete
Ptolemy distinguishes between soft deletion (archive) and permanent deletion (hard delete). Archives are reversible; hard deletes are not. Understanding the difference helps you choose the right operation for your use case.
Soft delete (archive)
Most resources support soft deletion via DELETE /{id}. This sets an archived_at timestamp on the record but preserves all data. Archived records:
?archived=true or include archived_at in your filter conditions.POST /{id}/restore to clear archived_at and return the record to active status.Restoring archived records
Any archived record can be restored using the POST /{id}/restore endpoint. Restoration clears archived_at and may backfill missing field values. The API returns 409 Conflict if:
- The record is not currently archived
- Restoring it would violate a uniqueness constraint (e.g. another record now has the same identifier)
Hard delete
Some resources support permanent deletion via DELETE /{id}?hard=true. Hard deletes are immediate and irreversible — there is no restore. Dependent records are cascaded according to the schema.
Querying archived records
To include archived records in list or filter results, use ?archived=true on GET endpoints, or add an archived_at condition to your filter body:
?hard=true) where supported.Tag archive behaviour
Tags follow a slightly different pattern. Archiving a tag archives all its descendants automatically (since a tag’s parent chain must be active for the tag to be meaningful). Restoring a tag, however, only restores that specific tag — descendants must be restored individually.
Archived tags cannot be assigned to instruments, but existing assignments are preserved. In filter queries, archived tags match only when you explicitly include archived_at conditions.