# Attachments

## Retrieve an attachment.

> Retrieve an attachment by its ID.

```json
{"openapi":"3.0.0","info":{"title":"TradeAware API","version":"0.43.1"},"servers":[{"url":"https://api.tradeaware.live-eo.com"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"GetAttachmentDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"updatedAt":{"type":"string","description":"ISO 8601"},"createdAt":{"type":"string","description":"ISO 8601"},"fileUrl":{"type":"string","description":"Absolute URL to download the file that this attachment is representing. Usage example: curl <fileUrl>"},"filename":{"type":"string","description":"Name of file, including extension"},"fileSizeKb":{"type":"number","description":"File size in kilobytes (KB)"},"uploadedByUserId":{"type":"string","description":"The Auth0 user ID of the user who uploaded the file. Null if the attachment was uploaded by an M2M client.","nullable":true}},"required":["id","updatedAt","createdAt","filename","fileSizeKb","uploadedByUserId"]}}},"paths":{"/attachments/{id}":{"get":{"description":"Retrieve an attachment by its ID.","operationId":"AttachmentsController_findOne","parameters":[{"name":"id","required":true,"in":"path","description":"Id of the retrieved attachment.","schema":{"type":"string","format":"uuid"}},{"name":"presign","required":false,"in":"query","description":"When set to \"true\", adds the \"fileUrl\" field to the response object.\n    \"fileUrl\" enables you to download the uploaded file associated with this attachment.\n    If the file has not been malware-scanned and identified as clean yet, \n    it will ignore the \"presign\" query string parameter and not set the \"fileUrl\" field.\n    Any other value than \"true\" will be ignored.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAttachmentDto"}}}},"400":{"description":""},"401":{"description":""},"403":{"description":""},"404":{"description":""},"501":{"description":"501 Not Implemented when the feature is not enabled on this environment."}},"summary":"Retrieve an attachment.","tags":["File Upload (Attachments)"]}}}}
```

## Upload a file.

> Create an attachment which represents the upload of an individual file.\
> \
> Allowed file types are: pdf, doc, docx, xls, xlsx, jpeg, jpg, png, tif, tiff, heic, csv, txt, rtf.\
> \
> Filenames must be less than 200 characters (including the file extension),and must no contain any of the following characters: % { } < > / \ " \` '

```json
{"openapi":"3.0.0","info":{"title":"TradeAware API","version":"0.43.1"},"servers":[{"url":"https://api.tradeaware.live-eo.com"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"CreateAttachmentDto":{"type":"object","properties":{"file":{"type":"string","description":"File data","format":"binary"}},"required":["file"]},"GetAttachmentDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"updatedAt":{"type":"string","description":"ISO 8601"},"createdAt":{"type":"string","description":"ISO 8601"},"fileUrl":{"type":"string","description":"Absolute URL to download the file that this attachment is representing. Usage example: curl <fileUrl>"},"filename":{"type":"string","description":"Name of file, including extension"},"fileSizeKb":{"type":"number","description":"File size in kilobytes (KB)"},"uploadedByUserId":{"type":"string","description":"The Auth0 user ID of the user who uploaded the file. Null if the attachment was uploaded by an M2M client.","nullable":true}},"required":["id","updatedAt","createdAt","filename","fileSizeKb","uploadedByUserId"]}}},"paths":{"/attachments":{"post":{"description":"Create an attachment which represents the upload of an individual file.\n\nAllowed file types are: pdf, doc, docx, xls, xlsx, jpeg, jpg, png, tif, tiff, heic, csv, txt, rtf.\n\nFilenames must be less than 200 characters (including the file extension),and must no contain any of the following characters: % { } < > / \\ \" ` '","operationId":"AttachmentsController_create","parameters":[],"requestBody":{"required":true,"description":"File to be uploaded.","content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreateAttachmentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAttachmentDto"}}}},"400":{"description":""},"401":{"description":""},"403":{"description":""},"415":{"description":""},"501":{"description":"501 Not Implemented when the feature is not enabled on this environment."}},"summary":"Upload a file.","tags":["File Upload (Attachments)"]}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.live-eo.com/tradeaware/using-the-tradeaware-api/api-reference/attachments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
