server-side Lua scripting.

I have Lua plugin:

function OnStoredInstance(instanceId, tags, metadata, origin)
if origin['RequestOrigin'] ~= 'Lua' then
    local replace = {}
    replace['PatientID'] = '123'

    local command = {}
    command['Replace'] = replace

    local modified = RestApiPost('/instances/' .. instanceId .. '/modify', DumpJson(command, true))

    RestApiDelete('/instaces/' .. instaceId)
    RestApiPost('/instances/', modified)

When I try to import an image, I get an error:

I0925 07:00:33.117464 OrthancRestApi.cpp:91] Receiving a DICOM file of 7663144 bytes through HTTP
I0925 07:00:37.769892 ServerContext.cpp:275] New instance stored
E0925 07:00:37.772118 OrthancRestAnonymizeModify.cpp:125] Marking tag "PatientID" as to be replaced requires the "Force" option to be set to true
E0925 07:00:37.772577 LuaScripting.cpp:151] Lua: Bad request
E0925 07:00:37.772686 LuaScripting.cpp:154] Lua: Error in RestApiPost() for URI: /instances/de59a9d8-60d45e99-320f3dc0-03b2eaea-28f9b793/modify
E0925 07:00:38.130778 LuaScripting.cpp:126] Lua: Bad parameters to RestApiPost()

How and where i need to set "Force" option ti "true"?

Thanx a lot.

sory about 2 mistakes ("insta/n/ces"). They are only here, not in the code.

The force option is documented here:

Try to add, command['Force'] = true , into your command.

Many thanx! Dont know how i miss it...