# \AttachmentsApi
All URIs are relative to *https://demo.firefly-iii.org*
[**delete_attachment**](AttachmentsApi.md#delete_attachment) | **DELETE** /api/v1/attachments/{id} | Delete an attachment.
[**download_attachment**](AttachmentsApi.md#download_attachment) | **GET** /api/v1/attachments/{id}/download | Download a single attachment.
[**get_attachment**](AttachmentsApi.md#get_attachment) | **GET** /api/v1/attachments/{id} | Get a single attachment.
[**list_attachment**](AttachmentsApi.md#list_attachment) | **GET** /api/v1/attachments | List all attachments.
[**store_attachment**](AttachmentsApi.md#store_attachment) | **POST** /api/v1/attachments | Store a new attachment.
[**update_attachment**](AttachmentsApi.md#update_attachment) | **PUT** /api/v1/attachments/{id} | Update existing attachment.
[**upload_attachment**](AttachmentsApi.md#upload_attachment) | **POST** /api/v1/attachments/{id}/upload | Upload an attachment.
## delete_attachment
> delete_attachment(id)
Delete an attachment.
With this endpoint you delete an attachment, including any stored file data.
### Parameters
**id** | **i32** | The ID of the single. | [required] |
### Return type
(empty response body)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## download_attachment
> std::path::PathBuf download_attachment(id)
Download a single attachment.
This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type \"application/octet-stream\" and content disposition \"attachment; filename=example.pdf\".
### Parameters
**id** | **i32** | The ID of the attachment. | [required] |
### Return type
[**std::path::PathBuf**](std::path::PathBuf.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/octet-stream
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_attachment
> crate::models::AttachmentSingle get_attachment(id)
Get a single attachment.
Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below).
### Parameters
**id** | **i32** | The ID of the attachment. | [required] |
### Return type
[**crate::models::AttachmentSingle**](AttachmentSingle.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_attachment
> crate::models::AttachmentArray list_attachment(page)
List all attachments.
This endpoint lists all attachments.
### Parameters
**page** | Option<**i32**> | Page number. The default pagination is 50. | |
### Return type
[**crate::models::AttachmentArray**](AttachmentArray.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## store_attachment
> crate::models::AttachmentSingle store_attachment(attachment)
Store a new attachment.
Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object.
### Parameters
**attachment** | [**Attachment**](Attachment.md) | JSON array or key=value pairs with the necessary attachment information. See the model for the exact specifications. | [required] |
### Return type
[**crate::models::AttachmentSingle**](AttachmentSingle.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth)
### HTTP request headers
- **Content-Type**: application/json, application/x-www-form-urlencoded
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## update_attachment
> crate::models::AttachmentSingle update_attachment(id, attachment)
Update existing attachment.
Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below.
### Parameters
**id** | **i32** | The ID of the attachment. | [required] |
**attachment** | [**Attachment**](Attachment.md) | JSON array with updated attachment information. See the model for the exact specifications. | [required] |
### Return type
[**crate::models::AttachmentSingle**](AttachmentSingle.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth)
### HTTP request headers
- **Content-Type**: application/json, application/x-www-form-urlencoded
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## upload_attachment
> upload_attachment(id, body)
Upload an attachment.
Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data.
### Parameters
**id** | **i32** | The ID of the attachment. | [required] |
**body** | Option<**std::path::PathBuf**> | | |
### Return type
(empty response body)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth)
### HTTP request headers
- **Content-Type**: application/octet-stream
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)