---
title: "Create a file"
method: POST
path: "/v1/files"
---

# Create a file

`POST /v1/files`

To upload a file to Stripe, you need to send a request of type `multipart/form-data`. Include the file you want to upload in the request, and the parameters for creating a file.

All of Stripe’s officially supported Client libraries support sending `multipart/form-data`.

## Response `200`

Successful response.

- File — This object represents files hosted on Stripe's servers. You can upload files with the [create file](https://stripe.com/docs/api#create_file) request (for example, when uploading dispute evidence). Stripe also creates files independently (for example, the results of a [Sigma scheduled query](#scheduled_queries)). Related guide: [File upload guide](https://stripe.com/docs/file-upload)
  - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
  - `expires_at` integer, nullable — The file expires and isn't available at this time in epoch seconds.
  - `filename` string, nullable — The suitable name for saving the file to a filesystem.
  - `id` string, required — Unique identifier for the object.
  - `links` object, nullable — A list of [file links](https://stripe.com/docs/api#file_links) that point at this file.
    - `data` FileLink[], required — Details about each object.
      - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
      - `expired` boolean, required — Returns if the link is already expired.
      - `expires_at` integer, nullable — Time that the link expires.
      - `file` union, required — The file object this link points to.
        - string
        - File — recursive
      - `id` string, required — Unique identifier for the object.
      - `livemode` boolean, required — Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
      - `metadata` object, required — Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      - `object` 'file_link', required — String representing the object's type. Objects of the same type share the same value.
      - `url` string, nullable — The publicly accessible URL to download the file.
    - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
    - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
    - `url` string, required — The URL where this list can be accessed.
  - `object` 'file', required — String representing the object's type. Objects of the same type share the same value.
  - `purpose` 'account_requirement' | 'additional_verification' | 'business_icon' | 'business_logo' | 'customer_signature' | 'dispute_evidence' | 'document_provider_identity_document' | 'finance_report_run' | 'financial_account_statement' | 'identity_document' | 'identity_document_downloadable' | 'issuing_regulatory_reporting' | 'pci_document' | 'selfie' | 'sigma_scheduled_query' | 'tax_document_user_upload' | 'terminal_reader_splashscreen', required — The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file.
  - `size` integer, required — The size of the file object in bytes.
  - `title` string, nullable — A suitable title for the document.
  - `type` string, nullable — The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`).
  - `url` string, nullable — Use your live secret API key to download the file from this URL.

## Other responses

- `default` — Error response.

## Changes

> 9 revisions in range; 2 not diffed.

- **2025-01-17** `b8a91ebdacb7` — 8 info
  - added the optional property `error/advice_code` to the response with the `default` status
  - added the optional property `error/payment_intent/invoice/anyOf[subschema #2: Invoice]/charge/anyOf[subschema #2: Charge]/outcome/anyOf[subschema #1: ChargeOutcome]/advice_code` to the response with the `default` status
  - added the optional property `error/payment_intent/invoice/anyOf[subschema #2: Invoice]/charge/anyOf[subschema #2: Charge]/payment_method_details/anyOf[subschema #1: payment_method_details]/pay_by_bank` to the response with the `default` status
  - added the optional property `error/payment_intent/invoice/anyOf[subschema #2: Invoice]/charge/anyOf[subschema #2: Charge]/payment_method_details/anyOf[subschema #1: payment_method_details]/paypal/country` to the response with the `default` status
  - …4 more
- …earlier changes not shown

[Full history](https://skmtc.dev/stripe/apis/spec3/changes/v1/files/post.md)

---

[API](https://skmtc.dev/stripe/apis/spec3.md) · [All operations](https://skmtc.dev/stripe/apis/spec3/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/stripe/spec3/revisions/b8a91ebdacb7/schema)
