API reference · Hubtask API 0.1.0
retention
GET /legal-holds
The legal holds in force
A hold overrides every retention rule and every deletion a person asks for, so who placed one and why is part of what it is. Released holds are shown too when asked for: a hold that has been lifted is what an auditor reads to see that it was.
Query parameters
Responses
200The holds403An error per RFC 9457 Problem
curl -X GET "$HUBTASK_URL/legal-holds" \ -H "Authorization: Bearer $HUBTASK_TOKEN" POST /legal-holds
Place a legal hold
Stops anything under it being deleted: a retention rule, a person emptying their own trash, a hard delete somebody asked for. It outranks the workspace's own configured periods, which is why placing one is not an ordinary member's power. Auditable.
Request body application/json — LegalHoldCreate
Responses
curl -X POST "$HUBTASK_URL/legal-holds" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "scope": { "kind": "TENANT" }, "reason": "string"}' POST /legal-holds/{holdId}:release
Lift a legal hold
Records who lifted it, when, and why. Lifting is the moment the data under it becomes deletable again, so the reason is required rather than optional - "released" with no reason is the entry an auditor cannot act on. Auditable.
Path parameters
Request body application/json — LegalHoldRelease
Responses
curl -X POST "$HUBTASK_URL/legal-holds/{holdId}:release" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "reason": "string"}' GET /retention-policies
List the retention rules
Query parameters
Responses
200The rules
curl -X GET "$HUBTASK_URL/retention-policies" \ -H "Authorization: Bearer $HUBTASK_TOKEN" POST /retention-policies
Create a retention rule
New rules start in notify-only mode if their first run would affect more than 5% of the holdings. Extending beyond the data kind's upper bound requires a justification. Auditable.
Request body application/json — RetentionPolicy
Responses
201Created RetentionPolicy400An error per RFC 9457 Problem
curl -X POST "$HUBTASK_URL/retention-policies" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "018f6e2a-2b7c-7c1e-9b1a-3d5e6f7a8b9c", "scope": {}, "data_kind": "COMPLETED_ITEM", "condition": "string", "retain_days": 0, "action": "ARCHIVE", "then_after_days": 1, "then_action": "ARCHIVE", "grace_days": 14, "notify": {}, "justification": "string", "enabled": true, "export_target_id": "018f6e2a-2b7c-7c1e-9b1a-3d5e6f7a8b9c", "in_force": true}' PATCH /retention-policies/{policyId}
Correct a retention rule, or take it out of enforcement
Merge-patch: an absent key changes nothing. A rule that deletes data has to be correctable, and mode is what takes one out of enforcement without losing what it says - NOTIFY_ONLY reports what it would remove and removes nothing, which is where a new rule starts when its first run would affect more than 5% of the holdings, and where a rule somebody has doubts about belongs. Extending a period beyond the data kind's upper bound needs a justification, here as much as at creation, and the one stored is replaced rather than kept: the justification belongs to the period it justifies. The kind and the scope do not move. A rule that changed either would be a different rule under an old identifier, and the unique index over the pair is what makes "the rule for this kind at this level" a thing one can name at all. Auditable.
Path parameters
Headers
Request body application/merge-patch+json — RetentionPolicyUpdate
Responses
200Changed RetentionPolicy4XXAn error per RFC 9457 Problem
curl -X PATCH "$HUBTASK_URL/retention-policies/{policyId}" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H 'If-Match: "<the ETag you read>"' \ -H "Content-Type: application/merge-patch+json" \ -d '{ "condition": "string", "retain_days": 0, "action": "ARCHIVE", "then_after_days": 1, "then_action": "ARCHIVE", "grace_days": 1, "notify": {}, "justification": "string", "enabled": true, "export_target_id": "018f6e2a-2b7c-7c1e-9b1a-3d5e6f7a8b9c"}' DELETE /retention-policies/{policyId}
Withdraw a retention rule
The rule stops applying. What it already did stands - retention deletes, and a deletion is not undone by withdrawing the instruction that caused it - and what it had marked for a future pass is unmarked, because an entry counting down towards a rule nobody holds any more would be deleted by a rule that does not exist. Withdrawing one that is not there is not an error. Auditable.
Path parameters
Responses
204Withdrawn4XXAn error per RFC 9457 Problem
curl -X DELETE "$HUBTASK_URL/retention-policies/{policyId}" \ -H "Authorization: Bearer $HUBTASK_TOKEN" POST /retention-policies/{policyId}:preview
Determine the effect of a rule without executing it
Path parameters
Responses
200The preview
curl -X POST "$HUBTASK_URL/retention-policies/{policyId}:preview" \ -H "Authorization: Bearer $HUBTASK_TOKEN" POST /items/{itemId}:retain
Take an object out of the running retention period