Files
Use Files to add images, videos, downloads, catalog imports, and support attachments to your Inttegro account. Each upload receives a file ID that you can attach to another Inttegro resource, retrieve later, or remove when it is no longer needed.
The file object
A file represents an asset uploaded to Inttegro. Use its ID when attaching the asset to products and other resources.
Properties
- Name
contentType- Type
string- Description
MIME type of the uploaded file.
- Name
createdAt- Type
Date- Description
When the file record was created.
customDataCustomDataClick or tap to expandString key-value custom data supplied during upload. Omitted when no custom data was supplied.
- Name
filename- Type
string | null- Description
Filename supplied with the upload. Omitted when no filename is available.
- Name
id- Type
string- Description
Unique file identifier. File IDs begin with
file_.
metadataRecord<string, unknown>Click or tap to expandRead-only information added by Inttegro. Use
customDatafor your own values.- Name
name- Type
string | null- Description
Human-friendly title for the file. Omitted when no title was supplied.
- Name
purpose- Type
string- Description
Purpose policy used to validate and store the file:
"product_download"for downloadable product files and merchant-managed attachments. Accepts.pdf,.zip,.txt, and.csvfiles up to 100 MiB. Not linkable through file links."product_image"for product images. Accepts JPEG, PNG, and GIF up to 10 MiB. Linkable through file links."product_video"for product videos. Accepts MP4, WebM, and QuickTime up to 250 MiB. Linkable through file links."products_import"for product-catalog imports. Accepts CSV files up to 32 MiB that follow the required import schema and contain no more than 10,000 data rows. Not linkable through file links."support_document"for support evidence and attachments. Accepts PDF, JPEG, PNG, and plain text up to 25 MiB. Not linkable through file links.
- Name
scanStatus- Type
string- Description
File safety check status:
Inttegro.FileScanStatuses.Pending,Inttegro.FileScanStatuses.Passed,Inttegro.FileScanStatuses.Failed, orInttegro.FileScanStatuses.Skipped.
- Name
size- Type
number- Description
Original file size in bytes.
sourceFileSourceHow the file was uploaded.Click or tap to expand- Name
type- Type
string- Description
- Source type such as
Inttegro.FileSourceTypes.DirectorInttegro.FileSourceTypes.UploadRequest.
- Name
status- Type
FileStatus- Description
File lifecycle status:
Inttegro.FileStatuses.Uploading,Inttegro.FileStatuses.Processing,Inttegro.FileStatuses.Available,Inttegro.FileStatuses.Failed, orInttegro.FileStatuses.Deleted.
storageRecord<string, unknown>Size and encoding of the stored file.Click or tap to expand- Name
encoding- Type
string- Description
- Stored representation, such as
Inttegro.FileStorageEncodings.IdentityorInttegro.FileStorageEncodings.Brotli.
- Name
updatedAt- Type
Date | null- Description
When the file record was last updated.
Upload a file
Upload an asset from your backend. Choose a purpose that matches how you plan to use the file; it determines the accepted format and maximum size. To collect a file from a customer or another person, create an upload request instead.
Request body
customDataCustomDataClick or tap to expandOptional JSON object encoded as a form field. Keys and values must both be strings. The encoded object can be at most 25 KiB, and each key can be at most 256 characters.
- Name
file- Type
string | Blob- Required
- required
- Description
Multipart file part containing the bytes to store.
- Name
purpose- Type
string- Required
- required
- Description
How the file will be used:
"product_download","product_image","product_video","products_import", or"support_document". See the file object for the formats and size limit of each purpose.
- Name
title- Type
string- Description
Optional display name for the file.
Response
The response returns the new File. Save id with the product or resource that uses the asset.
A products_import CSV must contain between 1 and 10,000 product rows. Each row uses these columns in order: name, type, price_currency, price_value, reference, description, about, category, tax_code, unit_dimension, price_label, publish, and attributes. The first row may contain those column names as a header.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.files.create({
file: "./hero.png",
purpose: "product_image",
title: "Hero image",
customData: {
product_ref: "SKU-12345",
},
}, {
idempotencyKey: "upload-hero-image-001",
})
Response
- Object
- JSON
FileResponse {
file: { … },
}
{
"file": {
"id": "file_4q6YcQk1RzPv2mDa8nFw0sHu",
"purpose": "product_image",
"status": "available",
"scan_status": "skipped",
"name": "Hero image",
"filename": "hero.png",
"content_type": "image/png",
"size": 248391,
"checksum_sha256": "db6f2f1d7b4b4d9d9c30a3ddcc7f9d506e8c9d67c4a61e5b9fd2dd9b0f5d0000",
"created_by": { "type": "api_key" },
"source": { "type": "direct" },
"storage": { "encoding": "identity", "stored_size": 248391 },
"delivery": { … },
"custom_data": { "product_ref": "SKU-12345" },
"metadata": { "source_type": "direct" },
"created_at": "2026-06-05T12:30:00Z",
"updated_at": "2026-06-05T12:30:00Z",
"available_at": "2026-06-05T12:30:00Z"
}
}
Lookup a file
Retrieve a file's name, type, size, status, and other details. To retrieve the file itself, use Download file contents.
Request body
- Name
fileId- Type
string- Required
- required
- Description
File ID to retrieve.
Response
The response returns the requested File.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.files.lookup({
fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
})
Page files
Browse the files in your Inttegro account. Combine filters to find files by purpose, status, or upload date.
Request body
- Name
createdAfter- Type
Date- Description
Return files created at or after this RFC 3339 timestamp.
- Name
createdBefore- Type
Date- Description
Return files created at or before this RFC 3339 timestamp.
- Name
pageNumber- Type
number- Description
Page number to retrieve. Defaults to
1.
- Name
pageSize- Type
number- Description
Requested number of files per page. Defaults to
25and is capped at256.
- Name
purpose- Type
string- Description
Filter by file purpose.
- Name
status- Type
FileStatus- Description
Filter by lifecycle status:
Inttegro.FileStatuses.Uploading,Inttegro.FileStatuses.Processing,Inttegro.FileStatuses.Available,Inttegro.FileStatuses.Failed, orInttegro.FileStatuses.Deleted.
Response
Files are returned newest first. The response contains the current page number, the number of files returned, and a files array. When no more files remain, the array is empty.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.files.page({
purpose: "product_image",
status: "available",
pageNumber: 1,
pageSize: 25,
})
Reconcile file references
Tell Inttegro which files a resource currently uses. This prevents an attached file from being deleted while the resource still depends on it.
Send the complete set after you save the resource. Each call replaces the previous set: references you remove are released, references you add become protected, and an empty or omitted references array clears the set.
Request body
- Name
references- Type
FileReferenceInput[]- Description
Complete desired set of live file references. Omit it or send an empty array to clear the set.
- Name
field- Type
string- Required
- required
- Description
Stable path to the field containing the reference, such as
"media.hero_image"or"media.gallery[0]".
- Name
fileId- Type
string- Required
- required
- Description
Canonical
file_...ID whose deletion should remain blocked while this reference is live.
- Name
purpose- Type
string- Description
Optional purpose recorded with the reference, such as
"product_image".
- Name
reference- Type
string- Description
Optional exact value stored on the resource. This may be a file ID or file-link ID.
- Name
referenceKind- Type
FileReferenceKind- Description
Optional kind describing
references[].reference. Use"file"for a file ID or"file_link"for a file-link ID.
- Name
resourceId- Type
string- Required
- required
- Description
ID of the resource whose live reference set is being replaced.
- Name
resourceType- Type
string- Required
- required
- Description
Stable resource kind, such as
"product".
Response
A successful response returns reconciled set to true, confirming that Inttegro now uses the submitted set to protect files from deletion.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.fileReferences.reconcile({
resourceType: "product",
resourceId: "prod_123",
references: [
{
fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
field: "media.hero_image",
reference: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
referenceKind: "file",
purpose: "product_image",
},
],
})
Download file contents
Retrieve a file from your backend. Use this for private downloads and for file purposes that cannot be shared through file links.
Request body
- Name
disposition- Type
FileDisposition- Description
Optional response disposition:
Inttegro.FileDispositions.AttachmentorInttegro.FileDispositions.Inline. Defaults toInttegro.FileDispositions.Attachment.
- Name
delivery- Type
string- Description
Delivery mode:
Inttegro.FileDeliveries.StreamorInttegro.FileDeliveries.Redirect. Defaults toInttegro.FileDeliveries.Stream.
- Name
fileId- Type
string- Required
- required
- Description
File ID whose bytes should be delivered.
Response
With delivery set to Inttegro.FileDeliveries.Stream, the response contains the file bytes and the headers needed to preserve its content type and filename.
With delivery set to Inttegro.FileDeliveries.Redirect, the response redirects to a short-lived download URL. The SDK helpers use stream delivery, which is the simplest choice when your backend needs to save or forward the file.
Stream request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.files.contents({
disposition: "attachment",
fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
})
Delete a file
Delete a file that your business no longer needs. Its public links stop working, and Inttegro rejects the deletion while another resource still uses the file.
Request body
- Name
fileId- Type
string- Required
- required
- Description
File ID to delete.
Response
The response returns the deleted File with status set to Inttegro.FileStatuses.Deleted.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.files.delete({
fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
})