Knox Docs Sign in

API reference

Test mode. Use your secret key on your server; live processing is currently disabled.

https://api.knoxapi.com

Send form-encoded requests with Authorization: Bearer sk_test_....

Complete OpenAPI specification · Integration guide

Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.

GET /v1/files

List all files

Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.

Request parameters

ParameterLocationTypeDescription
createdqueryone of multiple schemasOnly return files that were created during the given date interval.
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
purposequerystringFilter queries by the file purpose. If you don't provide a purpose, the queries return unfiltered files.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of file
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/files

Create a file

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.

Request parameters

No parameters.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
expires_atintegerThe file expires and isn't available at this time in epoch seconds.
filenamestringThe suitable name for saving the file to a filesystem.
id requiredstringUnique identifier for the object.
linksobjectA list of [file links](https://api.stripe.com#file_links) that point at this file.
object requiredstringString representing the object's type. Objects of the same type share the same value.
purpose requiredstringThe [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file.
size requiredintegerThe size of the file object in bytes.
titlestringA suitable title for the document.
typestringThe returned file type (for example, `csv`, `pdf`, `jpg`, or `png`).
urlstringUse your live secret API key to download the file from this URL.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/files/{file}

Retrieve a file

Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to access file contents.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
filepathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
expires_atintegerThe file expires and isn't available at this time in epoch seconds.
filenamestringThe suitable name for saving the file to a filesystem.
id requiredstringUnique identifier for the object.
linksobjectA list of [file links](https://api.stripe.com#file_links) that point at this file.
object requiredstringString representing the object's type. Objects of the same type share the same value.
purpose requiredstringThe [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file.
size requiredintegerThe size of the file object in bytes.
titlestringA suitable title for the document.
typestringThe returned file type (for example, `csv`, `pdf`, `jpg`, or `png`).
urlstringUse your live secret API key to download the file from this URL.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors