Eternaltwin

Home | /api | v1 | users

/api/v1/users/:user_id/deleted_at

The deletion marker of an account, addressed as a resource so that it can be removed. Defined in crates/rest/src/users.rs.

Note the spelling: deleted_at, with an underscore, as it is in the router.

Deleting an account (DELETE /api/v1/users/:user_id) sets this field, closes the account's sessions and undoes its game links. Clearing it is the undo.

DELETE

Restores a deleted account.

Administrators only. The owner may delete their own account but may not bring it back: restoring it re-takes a username and re-attaches game accounts that somebody else may have claimed in the meantime, which is a decision for a moderator.

Takes no body.

Example

DELETE /api/v1/users/28dbb0bf-0fdc-40fe-ae5a-dde193f9fea8/deleted_at
Cookie: sid=b8be19ef-2d61-44de-b7d2-9c34ccb8a763
{
  "user": {
    "type": "User",
    "id": "28dbb0bf-0fdc-40fe-ae5a-dde193f9fea8",
    "created_at": "2021-01-15T14:17:14.015Z",
    "deleted_at": null,
    "display_name": {"current": {"value": "Alice"}},
    "is_administrator": false,
    "links": {
      "dinoparc_com": {"current": null, "old": []},
      "en_dinoparc_com": {"current": null, "old": []},
      "hammerfest_es": {"current": null, "old": []},
      "hammerfest_fr": {"current": null, "old": []},
      "hfest_net": {"current": null, "old": []},
      "sp_dinoparc_com": {"current": null, "old": []},
      "twinoid": {"current": null, "old": []}
    },
    "username": "alice",
    "email_address": null,
    "has_password": true
  },
  "deleted_at": "2021-03-02T10:00:00.000Z",
  "username": {"Ok": null},
  "dinoparc_com": {"Ok": null},
  "en_dinoparc_com": {"Ok": null},
  "hammerfest_es": {"Ok": null},
  "hammerfest_fr": {
    "Err": {"type": "User", "id": "e9c17533-633e-4f60-be9e-72883ae0174a"}
  },
  "hfest_net": {"Ok": null},
  "sp_dinoparc_com": {"Ok": null},
  "twinoid": {"Ok": null}
}

Reading the response

FieldMeaning
userThe account as it now stands, in the complete shape, with deleted_at back to null.
deleted_atWhen the account had been deleted, or null if it was not deleted at all.
usernameWhether the login handle could be re-taken.
the seven server fieldsWhether each game link could be restored.

Each of those eight fields is a result: {"Ok": null} when the thing was restored, and {"Err": {"type": "User", "id": …}} naming the account that holds it now when it could not be.

Restoring is best-effort by design. A Hammerfest account that somebody else linked while this one was deleted stays with them; the restore does not take it back and does not fail either. The report says exactly what was and was not recovered, so a moderator can follow up on the handful of conflicts instead of re-running the whole thing.

A request against an account that was never deleted succeeds and changes nothing; deleted_at comes back null and every result is {"Ok": null}.

Errors

StatusBodyWhen
403{"error": "forbidden"}Not an administrator.
500{"error": "internal error"}No such account, or a store failure.

There is no 404: the not-found case is not distinguished here, and an unknown identifier comes back as 500.