# Files
> Files are objects that represent a file hosted on Increase's servers. The file may have been uploaded by you (for example, when uploading a check image) or it may have been created by Increase (for example, an autogenerated statement PDF). If you need to download a File, create a File Link.

[Events](https://increase.com/documentation/events.md) will be generated for this resource. The possible event categories are: `file.created`.

## The File object
### Example
```json
{
  "created_at": "2020-01-31T23:59:59Z",
  "description": "2022-05 statement for checking account",
  "direction": "from_increase",
  "filename": "statement.pdf",
  "id": "file_makxrc67oh9l6sg7w9yc",
  "idempotency_key": null,
  "mime_type": "application/pdf",
  "purpose": "increase_statement",
  "type": "file"
}
```
### Attributes
- `created_at` (string)
  The time the File was created.

- `description` (string, nullable)
  A description of the File.

- `direction` (enum)
  Whether the File was generated by Increase or by you and sent to Increase.
  Cases:
  * `to_increase` (This File was sent by you to Increase.)
  * `from_increase` (This File was generated by Increase.)

- `filename` (string, nullable)
  The filename that was provided upon upload or generated by Increase.

- `id` (string)
  The File's identifier.

- `idempotency_key` (string, nullable)
  The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

- `mime_type` (string)
  The MIME type of the file.

- `purpose` (enum)
  What the File will be used for. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.
  Cases:
  * `card_dispute_attachment` (A file to be attached to a Card Dispute.)
  * `check_image_front` (An image of the front of a check, used for check deposits.)
  * `check_image_back` (An image of the back of a check, used for check deposits.)
  * `processed_check_image_front` (An image of the front of a deposited check after processing by Increase and submission to the Federal Reserve.)
  * `processed_check_image_back` (An image of the back of a deposited check after processing by Increase and submission to the Federal Reserve.)
  * `mailed_check_image` (An image of a check that was mailed to a recipient.)
  * `check_attachment` (A document to be printed on an additional page and mailed with a check that you've requested Increase print. This must be a PDF whose pages are all US letter size and all have the same orientation.)
  * `check_voucher_image` (An image to be used as the check voucher image, which is printed in the middle of the trifold area of a check. This must be a 2550x1100 pixel PNG.)
  * `check_signature` (A signature image to be printed on a check. This must be a 1320x120 pixel PNG.)
  * `inbound_mail_item` (A scanned mail item sent to Increase.)
  * `form_1099_int` (IRS Form 1099-INT.)
  * `form_1099_misc` (IRS Form 1099-MISC.)
  * `form_ss_4` (IRS Form SS-4.)
  * `identity_document` (An image of a government-issued ID.)
  * `increase_statement` (A statement generated by Increase.)
  * `loan_application_supplemental_document` (A supplemental document for a Loan Application.)
  * `other` (A file purpose not covered by any of the other cases.)
  * `trust_formation_document` (A legal document forming a trust.)
  * `digital_wallet_artwork` (A card image to be rendered inside digital wallet apps. This must be a 1536x969 pixel PNG.)
  * `digital_wallet_app_icon` (An icon for you app to be rendered inside digital wallet apps. This must be a 100x100 pixel PNG.)
  * `physical_card_front` (A card image to be printed on the front of a physical card. This must be a 2100x1344 pixel PNG with no other color but black.)
  * `physical_card_back` (The image to be printed on the back of a physical card.)
  * `physical_card_carrier` (An image representing the entirety of the carrier used for a physical card. This must be a 2550x3300 pixel PNG with no other color but black.)
  * `document_request` (A document requested by Increase.)
  * `entity_supplemental_document` (A supplemental document associated an an Entity.)
  * `export` (The results of an Export you requested via the dashboard or API.)
  * `fee_statement` (A fee statement.)
  * `unusual_activity_report_attachment` (An attachment to an Unusual Activity Report.)
  * `deposit_account_control_agreement` (A document granting another entity access to the funds into your account.)
  * `proof_of_authorization_request_submission` (A file containing additional evidence for a Proof of Authorization Request Submission.)
  * `account_verification_letter` (An account verification letter.)
  * `funding_instructions` (Funding instructions.)
  * `hold_harmless_letter` (A Hold Harmless Letter.)

- `type` (string)
  A constant representing the object's type. For this resource it will always be `file`.

## List Files
GET /files

### Example
```curl
curl \
  --url "${INCREASE_URL}/files" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```

### Query Parameters
- `cursor` (string, optional)
  Return the page of entries after this one.

- `limit` (integer, optional)
  Limit the size of the list that is returned. The default (and maximum) is 100 objects.

- `created_at.after` (string, optional)
  Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.before` (string, optional)
  Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_after` (string, optional)
  Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_before` (string, optional)
  Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `purpose.in` (array of enums, optional)
  Filter Files for those with the specified purpose or purposes. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `card_dispute_attachment` (A file to be attached to a Card Dispute.)
  * `check_image_front` (An image of the front of a check, used for check deposits.)
  * `check_image_back` (An image of the back of a check, used for check deposits.)
  * `processed_check_image_front` (An image of the front of a deposited check after processing by Increase and submission to the Federal Reserve.)
  * `processed_check_image_back` (An image of the back of a deposited check after processing by Increase and submission to the Federal Reserve.)
  * `mailed_check_image` (An image of a check that was mailed to a recipient.)
  * `check_attachment` (A document to be printed on an additional page and mailed with a check that you've requested Increase print. This must be a PDF whose pages are all US letter size and all have the same orientation.)
  * `check_voucher_image` (An image to be used as the check voucher image, which is printed in the middle of the trifold area of a check. This must be a 2550x1100 pixel PNG.)
  * `check_signature` (A signature image to be printed on a check. This must be a 1320x120 pixel PNG.)
  * `inbound_mail_item` (A scanned mail item sent to Increase.)
  * `form_1099_int` (IRS Form 1099-INT.)
  * `form_1099_misc` (IRS Form 1099-MISC.)
  * `form_ss_4` (IRS Form SS-4.)
  * `identity_document` (An image of a government-issued ID.)
  * `increase_statement` (A statement generated by Increase.)
  * `loan_application_supplemental_document` (A supplemental document for a Loan Application.)
  * `other` (A file purpose not covered by any of the other cases.)
  * `trust_formation_document` (A legal document forming a trust.)
  * `digital_wallet_artwork` (A card image to be rendered inside digital wallet apps. This must be a 1536x969 pixel PNG.)
  * `digital_wallet_app_icon` (An icon for you app to be rendered inside digital wallet apps. This must be a 100x100 pixel PNG.)
  * `physical_card_front` (A card image to be printed on the front of a physical card. This must be a 2100x1344 pixel PNG with no other color but black.)
  * `physical_card_back` (The image to be printed on the back of a physical card.)
  * `physical_card_carrier` (An image representing the entirety of the carrier used for a physical card. This must be a 2550x3300 pixel PNG with no other color but black.)
  * `document_request` (A document requested by Increase.)
  * `entity_supplemental_document` (A supplemental document associated an an Entity.)
  * `export` (The results of an Export you requested via the dashboard or API.)
  * `fee_statement` (A fee statement.)
  * `unusual_activity_report_attachment` (An attachment to an Unusual Activity Report.)
  * `deposit_account_control_agreement` (A document granting another entity access to the funds into your account.)
  * `proof_of_authorization_request_submission` (A file containing additional evidence for a Proof of Authorization Request Submission.)
  * `account_verification_letter` (An account verification letter.)
  * `funding_instructions` (Funding instructions.)
  * `hold_harmless_letter` (A Hold Harmless Letter.)

- `idempotency_key` (string, optional)
  Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

### Returns a File List object:
```json
{
  "data": [
    {
      "created_at": "2020-01-31T23:59:59Z",
      "description": "2022-05 statement for checking account",
      "direction": "from_increase",
      "filename": "statement.pdf",
      "id": "file_makxrc67oh9l6sg7w9yc",
      "idempotency_key": null,
      "mime_type": "application/pdf",
      "purpose": "increase_statement",
      "type": "file"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Create a File
POST /files
> To upload a file to Increase, you'll need to send a request of Content-Type `multipart/form-data`. The request should contain the file you would like to upload, as well as the parameters for creating a file.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/files" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: multipart/form-data" \
  -F file="@tax_form.pdf" \
  -F purpose=check_image_front
```

### Body Parameters
- `description` (string, optional)
  The description you choose to give the File.

- `file` (string, required)
  The file contents. This should follow the specifications of [RFC 7578](https://datatracker.ietf.org/doc/html/rfc7578) which defines file transfers for the multipart/form-data protocol.

- `purpose` (enum, required)
  What the File will be used for in Increase's systems.
  Cases:
  * `card_dispute_attachment` (A file to be attached to a Card Dispute.)
  * `check_image_front` (An image of the front of a check, used for check deposits.)
  * `check_image_back` (An image of the back of a check, used for check deposits.)
  * `mailed_check_image` (An image of a check that was mailed to a recipient.)
  * `check_attachment` (A document to be printed on an additional page and mailed with a check that you've requested Increase print. This must be a PDF whose pages are all US letter size and all have the same orientation.)
  * `check_voucher_image` (An image to be used as the check voucher image, which is printed in the middle of the trifold area of a check. This must be a 2550x1100 pixel PNG.)
  * `check_signature` (A signature image to be printed on a check. This must be a 1320x120 pixel PNG.)
  * `form_ss_4` (IRS Form SS-4.)
  * `identity_document` (An image of a government-issued ID.)
  * `loan_application_supplemental_document` (A supplemental document for a Loan Application.)
  * `other` (A file purpose not covered by any of the other cases.)
  * `trust_formation_document` (A legal document forming a trust.)
  * `digital_wallet_artwork` (A card image to be rendered inside digital wallet apps. This must be a 1536x969 pixel PNG.)
  * `digital_wallet_app_icon` (An icon for you app to be rendered inside digital wallet apps. This must be a 100x100 pixel PNG.)
  * `physical_card_front` (A card image to be printed on the front of a physical card. This must be a 2100x1344 pixel PNG with no other color but black.)
  * `physical_card_carrier` (An image representing the entirety of the carrier used for a physical card. This must be a 2550x3300 pixel PNG with no other color but black.)
  * `document_request` (A document requested by Increase.)
  * `entity_supplemental_document` (A supplemental document associated an an Entity.)
  * `unusual_activity_report_attachment` (An attachment to an Unusual Activity Report.)
  * `proof_of_authorization_request_submission` (A file containing additional evidence for a Proof of Authorization Request Submission.)

## Retrieve a File
GET /files/{file_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/files/file_makxrc67oh9l6sg7w9yc" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `file_id` (string, required)
  The identifier of the File.