Skip to content

Files

Upload and manage images, videos, downloads, catalog imports, and support attachments.

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

TypeScript SDK responseFilev15.0.0

Upload a file POST /files/create

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

TypeScript SDK requestFileCreateRequestv15.0.0
  • #customDataCustomDataClick or tap to expand

    Optional 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.

  • #filestring | Blobrequired

    Multipart file part containing the bytes to store.

  • #purposestringrequired

    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.

  • #titlestring

    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

POST/files/create
cURLbash
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"
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new 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",
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
  "github.com/inttegro/inttegro-sdk-go/v14/customdata"
  "github.com/inttegro/inttegro-sdk-go/v14/file"
)

func main() {
  ctx := context.Background()
  client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))

  params := file.CreateParams{
    CustomData: func() *customdata.Data { value, err := customdata.New(map[string]string{
        "product_ref": "SKU-12345",
      }); if err != nil { panic(err) }; return value }(),
    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
}
Pythonpython
import os

from inttegro import InttegroClient

client = 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",
)
PHPphp
<?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",
]);
Rubyruby
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"
)
Javajava
import com.inttegro.Client;
import com.inttegro.files.FileCreateParams;
import com.inttegro.CustomData;
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(new CustomData()
          .set("product_ref", "SKU-12345"))
      .build();
    var result = client.files().create(params, RequestOptions.withIdempotencyKey("upload-hero-image-001"));
  }
}
C#csharp
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");
Responsejson
{
  "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": {
      "public_url": "<PUBLIC_FILE_URL>",
      "cache_control": "public, max-age=31536000, immutable",
      "content_type": "image/png"
    },
    "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 POST /files/lookup

Retrieve a file’s name, type, size, status, and other details. To retrieve the file itself, use Download file contents.

Request body

TypeScript SDK requestFileLookupRequestv15.0.0
  • #fileIdstringrequired

    File ID to retrieve.

Response

The response returns the requested File.

Request

POST/files/lookup
cURLbash
curl https://api.inttegro.com/files/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id":"file_4q6YcQk1RzPv2mDa8nFw0sHu"}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.files.lookup({
  fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
)

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
}
Pythonpython
import os

from inttegro import InttegroClient

client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])

result = client.files.lookup("file_4q6YcQk1RzPv2mDa8nFw0sHu")
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->files->lookup("file_4q6YcQk1RzPv2mDa8nFw0sHu");
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.files.lookup(file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu")
Javajava
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");
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Files.LookupAsync("file_4q6YcQk1RzPv2mDa8nFw0sHu");

Page files POST /files/page

Browse the files in your Inttegro account. Combine filters to find files by purpose, status, or upload date.

Request body

TypeScript SDK requestFilePageRequestv15.0.0

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

POST/files/page
cURLbash
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}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.files.page({
  purpose: "product_image",
  status: "available",
  pageNumber: 1,
  pageSize: 25,
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
  "github.com/inttegro/inttegro-sdk-go/v14/file"
)

func main() {
  ctx := context.Background()
  client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))

  params := file.PageParams{
    Purpose: "product_image",
    Status: "available",
    PageNumber: 1,
    PageSize: 25,
  }
  result, err := client.Files.Page(ctx, params)
  if err != nil {
    log.Fatal(err)
  }
  _ = result
}
Pythonpython
import os

import inttegro
from inttegro import InttegroClient

client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])

result = client.files.page(inttegro.file.PageRequest(
  purpose="product_image",
  status="available",
  page_number=1,
  page_size=25,
))
PHPphp
<?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,
]);
Rubyruby
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
)
Javajava
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);
  }
}
C#csharp
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,
});
Response (abbreviated file objects)json
{
  "page": {
    "number": 1,
    "size": 1,
    "files": [
      {
        "id": "file_4q6YcQk1RzPv2mDa8nFw0sHu",
        "purpose": "product_image",
        "status": "available",
        "content_type": "image/png",
        "size": 248391
      }
    ]
  }
}

Reconcile file references POST /file_references/reconcile

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

TypeScript SDK requestFileReferenceReconcileRequestv15.0.0

Response

A successful response returns reconciled set to true, confirming that Inttegro now uses the submitted set to protect files from deletion.

Request

POST/file_references/reconcile
cURLbash
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"
}]
}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new 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",
    },
  ],
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
  "github.com/inttegro/inttegro-sdk-go/v14/filereference"
)

func main() {
  ctx := context.Background()
  client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))

  params := filereference.ReconcileParams{
    ResourceType: "product",
    ResourceID: "prod_123",
    References: []filereference.Input{
      {
        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
}
Pythonpython
import os

import inttegro
from inttegro import InttegroClient

client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])

result = client.file_references.reconcile(inttegro.file_reference.ReconcileRequest(
  resource_type="product",
  resource_id="prod_123",
  references=[
    inttegro.file_reference.Input(
      file_id="file_4q6YcQk1RzPv2mDa8nFw0sHu",
      field="media.hero_image",
      reference="file_4q6YcQk1RzPv2mDa8nFw0sHu",
      reference_kind="file",
      purpose="product_image",
    ),
  ],
))
PHPphp
<?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',
    ],
  ],
]);
Rubyruby
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",
    },
  ]
)
Javajava
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"));
  }
}
C#csharp
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",
    },
  },
});
Responsejson
{
  "reconciled": true
}

Download file contents POST /files/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

TypeScript SDK requestFileContentsRequestv15.0.0

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

POST/files/contents
cURLbash
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
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.files.contents({
  disposition: "attachment",
  fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
  "github.com/inttegro/inttegro-sdk-go/v14/file"
)

func main() {
  ctx := context.Background()
  client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))

  params := file.ContentsParams{
    FileID: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
    Disposition: "attachment",
  }
  result, err := client.Files.Contents(ctx, params)
  if err != nil {
    log.Fatal(err)
  }
  _ = result
}
Pythonpython
import os

from inttegro import InttegroClient

client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])

download = client.files.contents(
    disposition="attachment",
    file_id="file_4q6YcQk1RzPv2mDa8nFw0sHu",
)
download.save_to("./downloaded-file")
PHPphp
<?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');
Rubyruby
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")
Javajava
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"));
  }
}
C#csharp
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 POST /files/delete

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

TypeScript SDK requestFileDeleteRequestv15.0.0
  • #fileIdstringrequired

    File ID to delete.

Response

The response returns the deleted File with status set to Inttegro.FileStatuses.Deleted.

Request

POST/files/delete
cURLbash
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"}'
TypeScripttypescript
import { InttegroClient } from '@inttegro/inttegro-sdk'

const inttegro = new InttegroClient({
  apiKey: process.env.INTTEGRO_API_KEY!,
})

const result = await inttegro.files.delete({
  fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
})
Gogo
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v14"
)

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
}
Pythonpython
import os

from inttegro import InttegroClient

client = InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])

result = client.files.delete("file_4q6YcQk1RzPv2mDa8nFw0sHu")
PHPphp
<?php

use Inttegro\Client;

$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->files->delete("file_4q6YcQk1RzPv2mDa8nFw0sHu");
Rubyruby
require "inttegro"

client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.files.delete(file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu")
Javajava
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");
  }
}
C#csharp
using Inttegro;

using var inttegro = new InttegroClient(
    Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.Files.DeleteAsync("file_4q6YcQk1RzPv2mDa8nFw0sHu");
Response (abbreviated file object)json
{
  "file": {
    "id": "file_4q6YcQk1RzPv2mDa8nFw0sHu",
    "purpose": "product_image",
    "status": "deleted"
  }
}

Type to search…

↑↓ navigate↵ selectEsc close