API reference
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.
https://api.knoxapi.comCreate a file link
POST/v1/file_links
Creates a new file link object.
Body parameters
filestringRequiredThe ID of the file. The file's
purposemust 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,terminal_android_apk, orterminal_reader_splashscreen.expandarray of stringsSpecifies which fields in the response should be expanded.
expires_atintegerThe link isn't usable after this future timestamp.
metadataobjectSet 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
The file_link object.
curl https://api.knoxapi.com/v1/file_links \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d file=file_1Pgag2B7WZ01zgkWITx3dIQcconst Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const fileLink = await stripe.fileLinks.create({
file: 'file_1Pgag2B7WZ01zgkWITx3dIQc',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
file_link = client.v1.file_links.create(params={
"file": "file_1Pgag2B7WZ01zgkWITx3dIQc",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
file_link = Stripe::FileLink.create({
file: 'file_1Pgag2B7WZ01zgkWITx3dIQc',
}){
"created": 1234567890,
"expired": false,
"expires_at": 1234567890,
"file": "file_1Pgag2B7WZ01zgkWITx3dIQc",
"id": "link_1Pgc76B7WZ01zgkWPhd77i13",
"livemode": false,
"metadata": {},
"object": "file_link",
"url": "https://sangeekp-15t6ai--upload-mydev.dev.stripe.me/links/MDB8YWNjdF8xUGdhZlRCN1daMDF6Z2tXfGZsX3Rlc3Rfb0Jkam9sNHdEZUpXRHUzSGhXNTRkZDI500qGiHOxxv"
}List all file links
GET/v1/file_links
Returns a list of file links.
Query parameters
createdobject | integerOnly return links that were created during the given date interval.
Show 4 child parameters
gtintegergteintegerltintegerlteinteger
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
expiredbooleanFilter links by their expiration status. By default, Stripe returns all links.
filestringOnly return links for the given file.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of file_link objects.
curl -G https://api.knoxapi.com/v1/file_links \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const page = await stripe.fileLinks.list({
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
page = client.v1.file_links.list(params={
"limit": 3,
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
page = Stripe::FileLink.list({
limit: 3,
}){
"object": "list",
"url": "/v1/file_links",
"has_more": false,
"data": [
{
"created": 1234567890,
"expired": false,
"expires_at": 1234567890,
"file": "file_1Pgag2B7WZ01zgkWITx3dIQc",
"id": "link_1Pgc76B7WZ01zgkWPhd77i13",
"livemode": false,
"metadata": {},
"object": "file_link",
"url": "https://sangeekp-15t6ai--upload-mydev.dev.stripe.me/links/MDB8YWNjdF8xUGdhZlRCN1daMDF6Z2tXfGZsX3Rlc3Rfb0Jkam9sNHdEZUpXRHUzSGhXNTRkZDI500qGiHOxxv"
}
]
}Update a file link
POST/v1/file_links/{link}
Updates an existing file link object. Expired links can no longer be updated.
Path parameters
linkstringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
expires_atstring | integerA future timestamp after which the link will no longer be usable, or
nowto expire the link immediately.Possible valuesnow
metadataobjectSet 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
The file_link object.
curl https://api.knoxapi.com/v1/file_links/link_1Pgc76B7WZ01zgkWPhd77i13 \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d "metadata[order_id]=6735"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const fileLink = await stripe.fileLinks.update('link_1Pgc76B7WZ01zgkWPhd77i13', {
metadata: {
order_id: '6735',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
file_link = client.v1.file_links.update("link_1Pgc76B7WZ01zgkWPhd77i13", params={
"metadata": {
"order_id": "6735",
},
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
file_link = Stripe::FileLink.update('link_1Pgc76B7WZ01zgkWPhd77i13', {
metadata: {
order_id: '6735',
},
}){
"created": 1234567890,
"expired": false,
"expires_at": 1234567890,
"file": "file_1Pgag2B7WZ01zgkWITx3dIQc",
"id": "link_1Pgc76B7WZ01zgkWPhd77i13",
"livemode": false,
"metadata": {},
"object": "file_link",
"url": "https://sangeekp-15t6ai--upload-mydev.dev.stripe.me/links/MDB8YWNjdF8xUGdhZlRCN1daMDF6Z2tXfGZsX3Rlc3Rfb0Jkam9sNHdEZUpXRHUzSGhXNTRkZDI500qGiHOxxv"
}Retrieve a file link
GET/v1/file_links/{link}
Retrieves the file link with the given ID.
Path parameters
linkstringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The file_link object.
curl https://api.knoxapi.com/v1/file_links/link_1Pgc76B7WZ01zgkWPhd77i13 \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const fileLink = await stripe.fileLinks.retrieve('link_1Pgc76B7WZ01zgkWPhd77i13');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
file_link = client.v1.file_links.retrieve("link_1Pgc76B7WZ01zgkWPhd77i13")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
file_link = Stripe::FileLink.retrieve('link_1Pgc76B7WZ01zgkWPhd77i13'){
"created": 1234567890,
"expired": false,
"expires_at": 1234567890,
"file": "file_1Pgag2B7WZ01zgkWITx3dIQc",
"id": "link_1Pgc76B7WZ01zgkWPhd77i13",
"livemode": false,
"metadata": {},
"object": "file_link",
"url": "https://sangeekp-15t6ai--upload-mydev.dev.stripe.me/links/MDB8YWNjdF8xUGdhZlRCN1daMDF6Z2tXfGZsX3Rlc3Rfb0Jkam9sNHdEZUpXRHUzSGhXNTRkZDI500qGiHOxxv"
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.