> For the complete documentation index, see [llms.txt](https://documentation.efalia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.efalia.com/api-reference/efalia-process-api/document.md).

# Document

## Get New Derived Document

> Get a blank derived document.\
> \
> \<a href="./#wky-note-incomplete" class="wky-label wky-label-incomplete">Incomplete\</a>\<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/new/derive/{fatherId}/{embeddedViewId}/{role}":{"get":{"summary":"Get New Derived Document","description":"Get a blank derived document.\n\n<a href=\"./#wky-note-incomplete\" class=\"wky-label wky-label-incomplete\">Incomplete</a><a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"getNewDerivedDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"fatherId","in":"path","required":true,"schema":{"type":"string"}},{"name":"embeddedViewId","in":"path","required":true,"schema":{"type":"string"}},{"name":"role","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get New Document

> Get a blank document ready to be created.\
> \
> \<a href="./#wky-note-incomplete" class="wky-label wky-label-incomplete">Incomplete\</a>\<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/new/{processType}/{documentType}/{role}":{"get":{"summary":"Get New Document","description":"Get a blank document ready to be created.\n\n<a href=\"./#wky-note-incomplete\" class=\"wky-label wky-label-incomplete\">Incomplete</a><a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"getNewDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"processType","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentType","in":"path","required":true,"schema":{"type":"string"}},{"name":"role","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Refresh a New Document Data

> The document data can be updated without changing the state of the document.\
> \
> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/new/{processType}/{documentType}/{role}/refresh":{"put":{"summary":"Refresh a New Document Data","description":"The document data can be updated without changing the state of the document.\n\n<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"refreshDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"processType","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentType","in":"path","required":true,"schema":{"type":"string"}},{"name":"role","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"responses":{"200":{"description":"The refreshed document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Document

> Get an existing document\
> \
> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}":{"get":{"summary":"Get Document","description":"Get an existing document\n\n<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"getDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the document to which the role belongs"},{"name":"roleId","in":"query","schema":{"type":"string"},"required":false,"description":"The ``Id`` of the role to use to open the document. See <a href=\"#Document_get_getDocumentPreOpen\">Get Possible Roles of a Document</a> to display the list of available roles."},{"name":"withHistory","in":"query","schema":{"type":"string"},"required":false,"description":"If this parameter is true, the form definition is included (JSON only, the XML always include the form information)."},{"name":"withForm","in":"query","schema":{"type":"string"},"required":false,"description":"If this parameter is true, the document history is included (JSON only, the XML always include the history)."},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Submit a Document

> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}":{"put":{"summary":"Submit a Document","description":"<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"UpdateDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"responses":{"200":{"description":"The updated document in the new state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Delete Document

> Delete a document.\
> \
> \<a href="./#wky-note-workflow-manager" class="wky-label wky-label-workflow-manager">Workflow Manager\</a>\<a href="./#wky-note-incomplete" class="wky-label wky-label-incomplete">Incomplete\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}":{"delete":{"summary":"Delete Document","description":"Delete a document.\n\n<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a><a href=\"./#wky-note-incomplete\" class=\"wky-label wky-label-incomplete\">Incomplete</a>","operationId":"deleteDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Document #{documentId} deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Update Document Data

> \<a href="./#wky-note-workflow-manager" class="wky-label wky-label-workflow-manager">Workflow Manager\</a>\<a href="./#wky-note-incomplete" class="wky-label wky-label-incomplete">Incomplete\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/admin":{"put":{"summary":"Update Document Data","description":"<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a><a href=\"./#wky-note-incomplete\" class=\"wky-label wky-label-incomplete\">Incomplete</a>","operationId":"AdminModifyData","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"responses":{"200":{"description":"The updated document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get All Actors of a Document

> \<a href="./#wky-note-workflow-manager" class="wky-label wky-label-workflow-manager">Workflow Manager\</a>\<a href="./#wky-note-incomplete" class="wky-label wky-label-incomplete">Incomplete\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/admin/actors":{"get":{"summary":"Get All Actors of a Document","description":"<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a><a href=\"./#wky-note-incomplete\" class=\"wky-label wky-label-incomplete\">Incomplete</a>","operationId":"getDocumentAdminActors","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Update Document Actors

> \<a href="./#wky-note-workflow-manager" class="wky-label wky-label-workflow-manager">Workflow Manager\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/admin/actors":{"put":{"summary":"Update Document Actors","description":"<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a>","operationId":"AdminUpdateActors","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}}}}},"responses":{"200":{"description":"Document #{documentId} actors updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Update Document State

> For the state of a document. The current state of the document will\
> &#x20;set to the selected state from the list sent to this method.\
> \
> \<a href="./#wky-note-workflow-manager" class="wky-label wky-label-workflow-manager">Workflow Manager\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/admin/state":{"put":{"summary":"Update Document State","description":"For the state of a document. The current state of the document will\n set to the selected state from the list sent to this method.\n\n<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a>","operationId":"AdminUpdateState","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/State"}}}}},"responses":{"200":{"description":"Document #{documentId} state updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get All States of a Document

> \<a href="./#wky-note-workflow-manager" class="wky-label wky-label-workflow-manager">Workflow Manager\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/admin/states":{"get":{"summary":"Get All States of a Document","description":"<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a>","operationId":"getDocumentAdminState","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of all the states for this Document Type.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/State"}}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Children Documents

> Get the list of all the derived documents Ids of a specified document.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}},"schemas":{"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}}},"paths":{"/document/{documentId}/children":{"get":{"summary":"Get Children Documents","description":"Get the list of all the derived documents Ids of a specified document.","operationId":"getDocumentChildren","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the father document."}],"responses":{"200":{"description":"List of children documents Ids.","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer","format":"int64"}}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Children Full Documents

> Get the list of all the derived documents of a specified document. Beware that it can be \
> &#x20;quite slow if there are many children.\
> \
> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/children/full":{"get":{"summary":"Get Children Full Documents","description":"Get the list of all the derived documents of a specified document. Beware that it can be \n quite slow if there are many children.\n\n<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"getDocumentFullChildren","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the father document."},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"List of children documents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Derive from View

> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/derive/{embeddedViewId}":{"put":{"summary":"Derive from View","description":"<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"DeriveDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"embeddedViewId","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"The new derived document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Delete actor's specific Draft

> Delete the document draft of the given actor.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/draft/{actorId}":{"delete":{"summary":"Delete actor's specific Draft","description":"Delete the document draft of the given actor.","operationId":"deleteDraft","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"actorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Draft of document #{documentId} deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get document history

> Returns the history steps of a document.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/history":{"get":{"summary":"Get document history","description":"Returns the history steps of a document.","operationId":"getDocumentHistory","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Minimal Informations on a Document

> Returns essential informations on a document, such as the \`Id\` the subject \
> &#x20;last access and update time, as well as the process type and document type. This method is only\
> &#x20;available with a JSON output.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/infos":{"get":{"summary":"Get Minimal Informations on a Document","description":"Returns essential informations on a document, such as the `Id` the subject \n last access and update time, as well as the process type and document type. This method is only\n available with a JSON output.","operationId":"getDocumentInfos","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInfo"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Lock a document

> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/lock":{"put":{"summary":"Lock a document","description":"<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"lockDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"The locked document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Document Memos

> Retrieve all the memos pertaining to a document. This method is only\
> &#x20;available with a JSON output.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/memos":{"get":{"summary":"Get Document Memos","description":"Retrieve all the memos pertaining to a document. This method is only\n available with a JSON output.","operationId":"getDocumentMemos","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentMemo"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Create a Document Memo

> Create a new memo for a document. This method is only\
> &#x20;available with a JSON format. Only the content

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/memos":{"post":{"summary":"Create a Document Memo","description":"Create a new memo for a document. This method is only\n available with a JSON format. Only the content","operationId":"createDocumentMemo","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentMemo"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentMemo"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Possible Roles of a Document

> \<a href="./#wky-note-incomplete" class="wky-label wky-label-incomplete">Incomplete\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"DocumentRoleSelection":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"documentLink":{"type":"string"},"operations":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/pre":{"get":{"summary":"Get Possible Roles of a Document","description":"<a href=\"./#wky-note-incomplete\" class=\"wky-label wky-label-incomplete\">Incomplete</a>","operationId":"getDocumentPreOpen","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentRoleSelection"}}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Release a document

> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/release":{"put":{"summary":"Release a document","description":"<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"releaseDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"The released document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Document Roles

> Get the list of all the roles interacting with this document.\
> \
> \<a href="./#wky-note-incomplete" class="wky-label wky-label-incomplete">Incomplete\</a>\<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{documentId}/roles":{"get":{"summary":"Get Document Roles","description":"Get the list of all the roles interacting with this document.\n\n<a href=\"./#wky-note-incomplete\" class=\"wky-label wky-label-incomplete\">Incomplete</a><a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"getDocumentRoles","deprecated":false,"tags":["Document"],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Create New Document

> Create an instance of a new document.\
> \
> \<a href="./#wky-note-switch-actor" class="wky-label wky-label-switch-actor">Switch Actor\</a>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Document","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"userLock":{"$ref":"#/components/schemas/DocumentUserLock"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"status":{"type":"string"},"form":{"$ref":"#/components/schemas/Form"},"actor":{"type":"string"},"synchro":{"$ref":"#/components/schemas/DocumentSynchro"},"postUrl":{"type":"string"},"fatherId":{"type":"integer","format":"int64"},"derivationId":{"type":"integer","format":"int64"},"isFinished":{"type":"boolean"},"isCommitable":{"type":"boolean"},"isDiscardable":{"type":"boolean"},"isOpenedByWorkflowManager":{"type":"boolean"},"isOpenedByProcessManager":{"type":"boolean"},"isOpenedByDataManager":{"type":"boolean"},"isOpenedBySupervisor":{"type":"boolean"},"isTakeInChargeAllowed":{"type":"boolean"},"isHeadOfGroup":{"type":"boolean"},"isMemoable":{"type":"boolean"},"isReleasable":{"type":"boolean"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DocumentFieldBase"}},"operations":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Operation"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/DocumentHistory"}},"externalJSs":{"type":"array","items":{"type":"string"}},"nextActors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"memos":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMemo"}},"nextEvents":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}]},"DocumentInfo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"subject":{"type":"string"},"lastAccess":{"type":"string","format":"date-time"},"updateTime":{"type":"string","format":"date-time"},"processType":{"$ref":"#/components/schemas/WorkeyVersionedObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"}}},"WorkeyVersionedObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"DocumentUserLock":{"type":"string","enum":["NONE","SET","ALLOWED"]},"Form":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"metaType":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FormItem"}},"withAttachmentPreview":{"type":"boolean"},"attachmentPreview":{"type":"string"}}},"FormItem":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"rank":{"type":"integer"},"colRank":{"type":"integer"},"textareaHeight":{"type":"integer"},"hidden":{"type":"boolean"},"readOnly":{"type":"boolean"}}}]},"DocumentSynchro":{"type":"string","enum":["NONE","PARTIAL","ALL","OTHER"]},"DocumentFieldBase":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/FieldType"},"multiple":{"type":"boolean"},"appearance":{"type":"string"},"datePattern":{"type":"string"},"select":{"type":"array","items":{"$ref":"#/components/schemas/Select"}},"min":{"type":"integer"},"max":{"type":"integer"},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"useThumbnail":{"type":"boolean"},"maxAttachments":{"type":"integer"},"maxTotalAttachmentsSize":{"type":"integer"},"maxAttachmentSize":{"type":"integer"}}}]},"FieldType":{"type":"string","enum":["BOOLEAN","DATE","DOUBLE","FLOAT","INTEGER","LONG","SHORT","STRING","BASE64BINARY","VIEW"]},"Select":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Operation":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"automatic":{"type":"boolean"},"synchro":{"type":"boolean"},"optional":{"type":"boolean"},"signatureRequired":{"type":"boolean"},"signature":{"$ref":"#/components/schemas/Signature"},"states":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/State"}},"rank":{"type":"integer"}}}]},"WorkeySelectableObject":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"selected":{"type":"boolean"}}}]},"Signature":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"State":{"allOf":[{"$ref":"#/components/schemas/WorkeySelectableObject"},{"type":"object","properties":{"derivations":{"type":"array","items":{"$ref":"#/components/schemas/Derivation"}},"rule":{"type":"integer","format":"int64"},"synchro":{"type":"boolean"},"nextOperations":{"type":"array","items":{"$ref":"#/components/schemas/NextOperation"}},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"rank":{"type":"integer"}}}]},"Derivation":{"type":"object","properties":{"automatic":{"type":"boolean"},"selected":{"type":"boolean"},"required":{"type":"boolean"},"newProcess":{"type":"boolean"},"actors":{"$ref":"#/components/schemas/ActorSelection"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}},"ActorSelection":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"availableActors":{"type":"array","items":{"$ref":"#/components/schemas/WorkeySelectableObject"}}}},"Notification":{"type":"object","properties":{"selected":{"type":"boolean"},"automatic":{"type":"boolean"},"target":{"$ref":"#/components/schemas/NotificationTarget"},"subject":{"type":"string"},"editable":{"type":"boolean"},"content":{"type":"string"}}},"NotificationTarget":{"type":"string","enum":["AUTHOR","PREVIOUS","BEFORE_PREVIOUS","SUPERVISOR","SELECTED","FIELD","NEXT","NEXT_WITH_COPY_TO_USER","DELEGATION","PASSIVES","MEMO"]},"NextOperation":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"actors":{"$ref":"#/components/schemas/ActorSelection"}}}]},"DocumentHistory":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"operation":{"$ref":"#/components/schemas/WorkeyObject"},"state":{"$ref":"#/components/schemas/WorkeyObject"},"unit":{"$ref":"#/components/schemas/WorkeyObject"},"originalActorLabel":{"type":"string"},"originalUnitLabel":{"type":"string"}}},"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"DocumentMemo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"sender":{"$ref":"#/components/schemas/WorkeyObject"},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"historyStep":{"$ref":"#/components/schemas/DocumentHistory"},"content":{"type":"string"},"date":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/components/schemas/DocumentMemoVisibility"},"senderLabel":{"type":"string"},"senderUnitLabel":{"type":"string"}}},"DocumentMemoVisibility":{"type":"string","enum":["PUBLIC","PRIVATE"]},"Event":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"nextOccurrenceTimeFormatted":{"type":"string"},"finalOccurenceTimeFormatted":{"type":"string"},"operationName":{"type":"string"}}}]},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/document/{processType}/{documentType}/{role}":{"post":{"summary":"Create New Document","description":"Create an instance of a new document.\n\n<a href=\"./#wky-note-switch-actor\" class=\"wky-label wky-label-switch-actor\">Switch Actor</a>","operationId":"createNewDocument","deprecated":false,"tags":["Document"],"parameters":[{"name":"processType","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentType","in":"path","required":true,"schema":{"type":"string"}},{"name":"role","in":"path","required":true,"schema":{"type":"string"}},{"name":"actor","in":"query","description":"🔄 If the user is a *Workflow Manager*, this parameter allow the user to make the request on behalf of the chosen actor. This parameter value can either be the actor `Id` or their `Dn`.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"responses":{"200":{"description":"A new draft document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.efalia.com/api-reference/efalia-process-api/document.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
