Introduction
    Authentication
    Connected Accounts
    Errors
    Expanding Responses
    Idempotent requests
    Metadata
    Pagination
    Request IDs
    Versioning
Core Resources
    Balance
    Balance Transactions
    Charges
    Customers
    Customer Session
    Disputes
    Events
    Eventsv2
    Event Destinationsv2
    Files
    File Links
    The File Link objectCreate a file linkUpdate a file linkRetrieve a file linkList all file links
    FX Quotes
    Mandates
    Payment Intents
    Setup Intents
    Setup Attempts
    Payouts
    Refunds
    Confirmation Token
    Tokens
Payment Methods
    Payment Methods
    Payment Method Configurations
    Payment Method Domains
    Bank Accounts
    Cash Balance
    Cash Balance Transaction
    Cards
    Sources
Products
    Products
    Prices
    Coupons
    Promotion Code
    Discounts
    Tax Code
    Tax Rate
    Shipping Rates
Checkout
    Checkout Sessions
Payment Links
    Payment Link
Billing
    Credit Note
    Customer Balance Transaction
    Customer Portal Session
    Customer Portal Configuration
    Invoices
    Invoice Items
    Invoice Line Item
    Invoice Payment
    Invoice Rendering Templates
    Alerts
    Meters
    Meter Events
    Meter Eventsv2
    Meter Event Adjustment
    Meter Event Adjustmentsv2
    Meter Event Streamsv2
    Meter Event Summary
    Credit Grant
    Credit Balance Summary
    Credit Balance Transaction
    Plans
    Quote
    Subscriptions
    Subscription Items
    Subscription Schedule
    Tax IDs
    Test Clocks
Capital
    Financing Offer
    Financing Summary
Connect
    Accounts
    Login Links
    Account Links
    Account Session
    Application Fees
    Application Fee Refunds
    Capabilities
    Country Specs
    External Bank Accounts
    External Account Cards
    Person
    Top-ups
    Transfers
    Transfer Reversals
    Secrets
Fraud
Issuing
Terminal
Treasury
Entitlements
Sigma
Reporting
Financial Connections
Tax
Identity
Crypto
Climate
Forwarding
Webhooks
  • 2025-04-30.basil
  • API Reference
  • Docs
  • Support
  • Sign in →

File Links 

To share the contents of a File object with non-Stripe users, you can create a FileLink. FileLinks contain a URL that you can use to retrieve the contents of the file without authentication.

Endpoints
    POST/v1/file_linksPOST/v1/file_links/:idGET/v1/file_links/:idGET/v1/file_links

The File Link object 

Attributes

  • idstring

    Unique identifier for the object.

  • expires_atnullable timestamp

    Time that the link expires.

  • filestringExpandable

    The file object this link points to.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

  • urlnullable string

    The publicly accessible URL to download the file.

More attributes

  • objectstring

  • createdtimestamp

  • expiredboolean

  • livemodeboolean

The File Link object
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}

Create a file link 

Creates a new file link object.

Parameters

  • filestringRequired

    The ID of the file. The file’s purpose must be one of the following: business_icon, business_logo, customer_signature, dispute_evidence, finance_report_run, financial_account_statement, identity_document_downloadable, issuing_regulatory_reporting, pci_document, selfie, sigma_scheduled_query, tax_document_user_upload, or terminal_reader_splashscreen.

  • expires_attimestamp

    The link isn’t usable after this future timestamp.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Returns

Returns the file link object if successful and raises an error otherwise.

POST /v1/file_links
curl https://api.stripe.com/v1/file_links \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d file=file_1Mr23iLkdIwHu7ixQkCV3CBR
Response
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}

Update a file link 

Updates an existing file link object. Expired links can no longer be updated.

Parameters

  • expires_atstring | timestamp

    A future timestamp after which the link will no longer be usable, or now to expire the link immediately.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Returns

Returns the file link object if successful, and raises an error otherwise.

POST /v1/file_links/:id
curl https://api.stripe.com/v1/file_links/link_1Mr23jLkdIwHu7ix65betcoo \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d "metadata[order_id]"=6735
Response
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {
"order_id": "6735"
},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}

Retrieve a file link 

Retrieves the file link with the given ID.

Parameters

No parameters.

Returns

If the identifier you provide is valid, a file link object returns. If not, Stripe raises an error.

GET /v1/file_links/:id
curl https://api.stripe.com/v1/file_links/link_1Mr23jLkdIwHu7ix65betcoo \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:"
Response
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}