Skip to content

Take Ownership

POST
/api/writing/locks/{document_id}/take

Forcibly take ownership, breaking any existing lock.

Used by the “Take Ownership” UI action when the user explicitly confirms they want to override another session. Caller should warn the user beforehand that the displaced session may lose unsaved changes.

document_id
required
Document Id

Document ID to forcibly take

string

Document ID to forcibly take

Successful Response

LockStatusResponse

Response from any lock-state endpoint.

can_edit=True is the normal case — the caller may proceed to edit. can_edit=False means another live session owns the lock; the caller should open the document read-only and surface the locked_by info plus a “Take Ownership” action.

external_word_lock=True means MS Word’s own ~$doc.docx file is present alongside the document. We can’t prevent Word from saving over us, but we can warn the user that simultaneous editing is happening.

is_our_lock=True means the current session already holds the lock — the caller is reopening the same document.

object
canEdit
required
Canedit
boolean
lockedBy
required
Any of:
LockOwnerInfo

Identifying info for a session that holds an owner lock.

object
pid
required
Pid
integer
hostname
required
Hostname
string
sessionId
required
Sessionid
string
openedAt
required
Openedat
integer
appVersion
required
Appversion
string
externalWordLock
required
Externalwordlock
boolean
isOurLock
required
Isourlock
boolean

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object