Skip to content

Get the newest journal entry

GET
/drives/{drive}/wal/latest
curl --request GET \
--url https://work.optidata.cloud/api/drives/1/wal/latest \
--header 'Authorization: Bearer <token>'

The most recent entry of the log. A client that is starting fresh records this id and follows the log from there, rather than replaying history. Answers null when the log is empty.

drive
required
integer format: int64

Numeric id of the drive. Read it from GET /drives/config.json.

The newest entry, or null.

Media typeapplication/json
One of:

One entry of the write-ahead log. Every change to the drive appends an entry; clients replay the log from the last id they processed.

object
id
integer format: int64
node_id
integer | null format: int64
drive_id
integer format: int64
guid
string format: uuid
optiwork_session_id

Session that produced the change. Pass it back as optiwork_session_id to skip your own writes.

string | null
event_class

Fully qualified name of the domain event that produced the entry.

string
event_json

JSON-encoded payload of the event.

string
created_at
string format: date-time
Examples
Examplelatest
{
"id": 950294,
"node_id": 301320,
"drive_id": 1,
"guid": "a28a3269-6668-4b06-a429-e6cf4f962bfa",
"optiwork_session_id": "a28a2b33-acec-47dc-875d-a49c24c0415d",
"event_class": "App\\Events\\Drive\\Share\\SharePermissionCreated",
"created_at": "2026-08-19T12:41:02.000000Z"
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The resource does not exist, or does not belong to the given drive.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Node] 99999999"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}