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.
Operations
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
purpose- Type
- string
- Description
Purpose policy used to validate and store the file:
product_downloadfor downloadable product files and merchant-managed attachments. Accepts.pdf,.zip,.txt, and.csvfiles up to 100 MiB. Not linkable through file links.product_imagefor product images. Accepts JPEG, PNG, and GIF up to 10 MiB. Linkable through file links.product_videofor product videos. Accepts MP4, WebM, and QuickTime up to 250 MiB. Linkable through file links.products_importfor 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_documentfor support evidence and attachments. Accepts PDF, JPEG, PNG, and plain text up to 25 MiB. Not linkable through file links.
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
Response
The response returns the new file. Save file.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
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/files/create \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: upload-hero-image-001" \
-F "purpose=product_image" \
-F "title=Hero image" \
-F 'custom_data={"product_ref":"SKU-12345"}' \
-F "file=@./hero.png;type=image/png"
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",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.FileCreateParams{
CustomData: map[string]string{
"product_ref": "SKU-12345",
},
File: "./hero.png",
Purpose: "product_image",
Title: "Hero image",
}
params.IdempotencyKey = "upload-hero-image-001"
result, err := client.Files.Create(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.files.create(
file="./hero.png",
purpose="product_image",
title="Hero image",
custom_data={
"product_ref": "SKU-12345",
},
idempotency_key="upload-hero-image-001",
)
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->files->create([
'file' => './hero.png',
'purpose' => 'product_image',
'title' => 'Hero image',
'custom_data' => [
'product_ref' => 'SKU-12345',
],
], [
'idempotency_key' => "upload-hero-image-001",
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.files.create(
file: "./hero.png",
purpose: "product_image",
title: "Hero image",
custom_data: {
product_ref: "SKU-12345",
},
idempotency_key: "upload-hero-image-001"
)
import com.inttegro.Client;
import com.inttegro.files.FileCreateParams;
import java.util.Map;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = FileCreateParams.builder()
.file("./hero.png")
.purpose("product_image")
.title("Hero image")
.customData(Map.<String, String>ofEntries(
Map.entry("product_ref", "SKU-12345")
))
.build();
var result = client.files().create(params, RequestOptions.withIdempotencyKey("upload-hero-image-001"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Files.CreateAsync(new {
file = "./hero.png",
purpose = "product_image",
title = "Hero image",
custom_data = new {
product_ref = "SKU-12345",
},
}, "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
Response
The response returns the requested file.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/files/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id":"file_4q6YcQk1RzPv2mDa8nFw0sHu"}'
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",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
result, err := client.Files.Lookup(ctx, "file_4q6YcQk1RzPv2mDa8nFw0sHu")
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.files.lookup("file_4q6YcQk1RzPv2mDa8nFw0sHu")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->files->lookup("file_4q6YcQk1RzPv2mDa8nFw0sHu");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.files.lookup(file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu")
import com.inttegro.Client;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var result = client.files().lookup("file_4q6YcQk1RzPv2mDa8nFw0sHu");
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Files.LookupAsync("file_4q6YcQk1RzPv2mDa8nFw0sHu");
Page files
Browse the files in your Inttegro account. Combine filters to find files by purpose, status, or upload date.
Request body
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
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/files/page \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"purpose":"product_image","status":"available","page_number":1,"page_size":25}'
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,
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.FilePageParams{
Purpose: "product_image",
Status: "available",
PageNumber: 1,
PageSize: 25,
}
result, err := client.Files.Page(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.files.page(inttegro.files.PageRequest(
purpose="product_image",
status="available",
page_number=1,
page_size=25,
))
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->files->page([
'purpose' => 'product_image',
'status' => 'available',
'page_number' => 1,
'page_size' => 25,
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.files.page(
purpose: "product_image",
status: "available",
page_number: 1,
page_size: 25
)
import com.inttegro.Client;
import com.inttegro.files.FilePageParams;
import com.inttegro.files.FileStatus;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = FilePageParams.builder()
.purpose("product_image")
.status(FileStatus.AVAILABLE)
.pageNumber(1)
.pageSize(25)
.build();
var result = client.files().page(params);
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Files.PageAsync(new {
purpose = "product_image",
status = "available",
page_number = 1,
page_size = 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
Response
A successful response returns { "reconciled": true }, confirming that Inttegro now uses the submitted set to protect files from deletion.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/file_references/reconcile \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: product-media-prod-123-v17" \
-H "Content-Type: application/json" \
-d '{
"resource_type": "product",
"resource_id": "prod_123",
"references": [{
"file_id": "file_4q6YcQk1RzPv2mDa8nFw0sHu",
"field": "media.hero_image",
"reference": "file_4q6YcQk1RzPv2mDa8nFw0sHu",
"reference_kind": "file",
"purpose": "product_image"
}]
}'
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",
},
],
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.FileReferenceReconcileParams{
ResourceType: "product",
ResourceID: "prod_123",
References: []inttegro.FileReferenceInput{
{
FileID: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
Field: "media.hero_image",
Reference: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
ReferenceKind: "file",
Purpose: "product_image",
},
},
}
result, err := client.FileReferences.Reconcile(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.file_references.reconcile(inttegro.file_references.ReconcileRequest(
resource_type="product",
resource_id="prod_123",
references=[
inttegro.file_references.Reference(
file_id="file_4q6YcQk1RzPv2mDa8nFw0sHu",
field="media.hero_image",
reference="file_4q6YcQk1RzPv2mDa8nFw0sHu",
reference_kind="file",
purpose="product_image",
),
],
))
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->fileReferences->reconcile([
'resource_type' => 'product',
'resource_id' => 'prod_123',
'references' => [
[
'file_id' => 'file_4q6YcQk1RzPv2mDa8nFw0sHu',
'field' => 'media.hero_image',
'reference' => 'file_4q6YcQk1RzPv2mDa8nFw0sHu',
'reference_kind' => 'file',
'purpose' => 'product_image',
],
],
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.file_references.reconcile(
resource_type: "product",
resource_id: "prod_123",
references: [
{
file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
field: "media.hero_image",
reference: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
reference_kind: "file",
purpose: "product_image",
},
]
)
import com.inttegro.Client;
import com.inttegro.filereferences.FileReferenceReconcileParams;
import java.util.List;
import com.inttegro.filereferences.FileReferenceInput;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = FileReferenceReconcileParams.builder()
.resourceType("product")
.resourceId("prod_123")
.references(List.of(
FileReferenceInput.builder()
.fileId("file_4q6YcQk1RzPv2mDa8nFw0sHu")
.field("media.hero_image")
.reference("file_4q6YcQk1RzPv2mDa8nFw0sHu")
.referenceKind("file")
.purpose("product_image")
.build()
))
.build();
var result = client.fileReferences().reconcile(params, RequestOptions.withIdempotencyKey("product-media-prod-123-v17"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.FileReferences.ReconcileAsync(new {
resource_type = "product",
resource_id = "prod_123",
references = new[] {
new {
file_id = "file_4q6YcQk1RzPv2mDa8nFw0sHu",
field = "media.hero_image",
reference = "file_4q6YcQk1RzPv2mDa8nFw0sHu",
reference_kind = "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
Response
With delivery: stream, the response contains the file bytes and the headers needed to preserve its content type and filename.
With delivery: 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
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/files/contents \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id":"file_4q6YcQk1RzPv2mDa8nFw0sHu","disposition":"attachment"}' \
--output hero.png
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",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.FileContentsParams{
FileID: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
Disposition: "attachment",
}
result, err := client.Files.Contents(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
download = client.files.contents(
disposition="attachment",
file_id="file_4q6YcQk1RzPv2mDa8nFw0sHu",
)
download.save_to("./downloaded-file")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$download = $client->files->contents([
'disposition' => 'attachment',
'file_id' => 'file_4q6YcQk1RzPv2mDa8nFw0sHu',
]);
$download->saveTo('./downloaded-file');
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
download = client.files.contents(
disposition: "attachment",
file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu"
)
download.save_to("./downloaded-file")
import com.inttegro.Client;
import com.inttegro.files.FileContentsParams;
import com.inttegro.files.FileDisposition;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = FileContentsParams.builder()
.disposition(FileDisposition.ATTACHMENT)
.fileId("file_4q6YcQk1RzPv2mDa8nFw0sHu")
.build();
var download = client.files().contents(params);
download.saveTo(java.nio.file.Path.of("./downloaded-file"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var download = await inttegro.Files.ContentsAsync(new {
disposition = "attachment",
file_id = "file_4q6YcQk1RzPv2mDa8nFw0sHu",
});
await download.SaveToAsync("./downloaded-file");
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
Response
The response returns the deleted file with status set to deleted.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/files/delete \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: delete-file-001" \
-H "Content-Type: application/json" \
-d '{"file_id":"file_4q6YcQk1RzPv2mDa8nFw0sHu"}'
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",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
result, err := client.Files.Delete(ctx, "file_4q6YcQk1RzPv2mDa8nFw0sHu")
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.files.delete("file_4q6YcQk1RzPv2mDa8nFw0sHu")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->files->delete("file_4q6YcQk1RzPv2mDa8nFw0sHu");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.files.delete(file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu")
import com.inttegro.Client;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var result = client.files().delete("file_4q6YcQk1RzPv2mDa8nFw0sHu");
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Files.DeleteAsync("file_4q6YcQk1RzPv2mDa8nFw0sHu");