Skip to content

What undoing a session would do, written nowhere

GET
/v1/audit/sessions/{hash}/restore-preview
curl --request GET \
--url https://beta-api.plune.ai/v1/audit/sessions/example/restore-preview \
--header 'Authorization: Bearer <token>'

The preview of POST /v1/audit/sessions/{hash}/restore (#1282), a read: every member of the project may ask, a reader included. How many entries can be put back now (revertable of total), how many an earlier rollback already put back (alreadyReverted), the ones a person saved over after the session (changedByPeople) and the ones that cannot be put back (cannotRevert, with a reason code). The last two groups are what the rollback leaves as they are. An unknown hash is a preview of nothing: zeros and empty lists. Whether a folder that holds only what the session made can go is an estimate; the rollback itself is the judge.

hash
required
string

What a rollback would do

Media type application/json
object
revertable
required

Entries a rollback would put back now.

integer
total
required

Every entry of the session.

integer
alreadyReverted
required
integer
changedByPeople
required

Left as they are: the same thing was saved by somebody else after the session.

Array<object>
object
entryId
required
string
entity
required
string
label
required

The record’s title or name.

string
by
required

Who saved it last: the person’s name or address, or the token id; «deleted account» when byDeleted.

string
byType
required
string
Allowed values: user token agent system
byDeleted

Present when the person’s account is in the Bin or was purged (#952).

boolean
at
required
string format: date-time
field
required

The field both touched; null when the session created the record and it was worked on since.

string
nullable
current
required

The value now.

agentValue
required

The value the session left.

cannotRevert
required

Left as they are: the entry cannot be put back.

Array<object>
object
entryId
required
string
entity
required
string
label
required
string
reason
required
string
Allowed values: not_found not_restorable entity_gone changed_since unsupported_entity
message
required
string
Example
{
"changedByPeople": [
{
"byType": "user",
"byDeleted": true
}
],
"cannotRevert": [
{
"reason": "not_found"
}
]
}

No / invalid token or session