> 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/attachment.md).

# Attachment

## Upload Attachment

> Upload a new attachment to the server\
> \### Note\
> \<p>The file \<b>must be\</b> sent with a \`\`Content-Disposition: attachment; filename=...\`\` in \
> &#x20;order to be correctly uploaded.\</p>\
> &#x20;\<p>Currently, the \`\`{documentField}\`\` part is mandatory, but ignored by the server.\</p>

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Attachment","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":{"AttachmentUpload":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"AttachmentMetadata":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"fileName":{"type":"string"},"size":{"type":"integer","format":"int64"},"id":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"thumbnail":{"type":"boolean"}}},"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":{"/attachment/{documentField}":{"post":{"summary":"Upload Attachment","description":"Upload a new attachment to the server\n### Note\n<p>The file <b>must be</b> sent with a ``Content-Disposition: attachment; filename=...`` in \n order to be correctly uploaded.</p>\n <p>Currently, the ``{documentField}`` part is mandatory, but ignored by the server.</p>","operationId":"createAttachment","deprecated":false,"tags":["Attachment"],"parameters":[{"name":"documentField","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the documentField"},{"name":"contentType","in":"query","schema":{"type":"string"},"required":false,"description":"The content-type of the uploaded file. It can also be set with a ``content-type`` header."},{"name":"filename","in":"query","schema":{"type":"string"},"required":false,"description":"The filename of the uploaded file. It can also be set with a ``filename`` header. \n If this parameter is not set, the ``Content-disposition`` header is used to determine the file name."}],"requestBody":{"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"mutipart/*":{"schema":{"$ref":"#/components/schemas/AttachmentUpload"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentMetadata"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Attachment (attachment disposition)

> Get the attachment content of an existing attachment.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Attachment","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":{"/attachment/{uuid}":{"get":{"summary":"Get Attachment (attachment disposition)","description":"Get the attachment content of an existing attachment.","operationId":"retrieveAttachment","deprecated":false,"tags":["Attachment"],"parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string"},"description":"uuid"}],"responses":{"200":{"description":"The binary content of the attachment.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Remove an Attachment

> Remove an attachment from the server. If one or more documents are \
> &#x20;referencing this attachment, it will not be removed.\
> \
> \<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":"Attachment","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":{"/attachment/{uuid}":{"delete":{"summary":"Remove an Attachment","description":"Remove an attachment from the server. If one or more documents are \n referencing this attachment, it will not be removed.\n\n<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a>","operationId":"removeAttachment","deprecated":false,"tags":["Attachment"],"parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The ``UUID`` of the attachment to delete."}],"responses":{"200":{"description":"Attachment {uuid} removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Attachment (inline disposition)

> Get the inline content of an existing attachment.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Attachment","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":{"/attachment/{uuid}/inline":{"get":{"summary":"Get Attachment (inline disposition)","description":"Get the inline content of an existing attachment.","operationId":"previewAttachment","deprecated":false,"tags":["Attachment"],"parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string"},"description":"uuid"}],"responses":{"200":{"description":"The binary content of the attachment.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Attachment Metadata

> Get the metadata of an existing attachment. It contains information on the actor who uploaded \
> &#x20;the file, as well as the date, size, type and name of the file.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Attachment","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":{"AttachmentMetadata":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"fileName":{"type":"string"},"size":{"type":"integer","format":"int64"},"id":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"},"actor":{"$ref":"#/components/schemas/WorkeyObject"},"thumbnail":{"type":"boolean"}}},"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":{"/attachment/{uuid}/metadata":{"get":{"summary":"Get Attachment Metadata","description":"Get the metadata of an existing attachment. It contains information on the actor who uploaded \n the file, as well as the date, size, type and name of the file.","operationId":"getMetadata","deprecated":false,"tags":["Attachment"],"parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string"},"description":"uuid"}],"responses":{"200":{"description":"{\n     \"date\": \"2018-01-24T08:47:28.782\",\n     \"actor\": {\n       \"name\": \"test2\",\n       \"id\": 2\n     },\n     \"fileName\": \"i-love-workey.pdf\",\n     \"size\": 1149612,\n     \"id\": \"8a6186f76127161601612722d18d0001\",\n     \"type\": \"application/pdf\",\n     \"url\": \"/workey/workey-j2ee-api/attachment/8a6186f76127161601612722d18d0001\"\n   }","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentMetadata"}}}},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"404":{"description":"Cannot get metadata for attachment \"{uuid}\""},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Attachment thumbnail

> Get the thumbnail of this attachment.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Attachment","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":{"/attachment/{uuid}/thumbnail":{"get":{"summary":"Get Attachment thumbnail","description":"Get the thumbnail of this attachment.","operationId":"attachmentThumbnail","deprecated":false,"tags":["Attachment"],"parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The UUID."}],"responses":{"200":{"description":"The binary content of the thumbnail of this attachment.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"204":{"description":"The thumbnail could not be created"},"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/attachment.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.
