Skip to main content

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
    available_at
    Type
    timestamp
    Description

    When the file became available for use. Returned only after the file is available.

  • Name
    checksum_sha256
    Type
    string
    Description

    SHA-256 checksum of the original file bytes.

  • Name
    content_type
    Type
    string
    Description

    MIME type of the uploaded file.

  • Name
    created_at
    Type
    timestamp
    Description

    When the file record was created.

  • created_byobjectWho or what uploaded the file.Click or tap to expand
    • Name
      email
      Type
      string
      Description
      Actor email when available.
    • Name
      id
      Type
      string
      Description
      Actor ID when available.
    • Name
      name
      Type
      string
      Description
      Actor display name when available.
    • Name
      type
      Type
      string
      Description
      Actor type, such as api_key, system, or upload_request.
  • custom_dataobjectClick or tap to expand

    String key-value custom data supplied during upload. Omitted when no custom data was supplied.

  • deliveryobjectDelivery details for files that can be displayed publicly. Omitted for other file purposes.Click or tap to expand
    • Name
      cache_control
      Type
      string
      Description
      Caching policy for the public URL.
    • Name
      content_type
      Type
      string
      Description
      Content type served by the public URL.
    • Name
      public_url
      Type
      string
      Description
      URL for displaying the asset. Use this value unchanged.
  • Name
    expires_at
    Type
    timestamp
    Description

    Expiry timestamp when the file has a policy-driven lifetime. Omitted when the file does not expire.

  • Name
    filename
    Type
    string
    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_.

  • latest_errorobjectMost recent processing error when the file could not be made available. Present only when the file has failed.Click or tap to expand
    • Name
      at
      Type
      timestamp
      Description
      When the error was recorded.
    • Name
      code
      Type
      string
      Description
      Stable error code for the most recent failure.
    • Name
      message
      Type
      string
      Description
      Human-readable failure message.
    • Name
      retryable
      Type
      boolean
      Description
      Whether retrying the same operation can succeed.
  • mediaobjectExtracted media details when Inttegro can derive them from the uploaded file.Click or tap to expand
    • Name
      aspect_ratio
      Type
      string
      Description
      Aspect ratio when available.
    • Name
      codec
      Type
      string
      Description
      Detected codec when available.
    • Name
      color_space
      Type
      string
      Description
      Detected color space when available.
    • Name
      duration_ms
      Type
      integer
      Description
      Media duration in milliseconds when available.
    • Name
      frame_count
      Type
      integer
      Description
      Frame count when available.
    • Name
      has_alpha
      Type
      boolean
      Description
      Whether the media has an alpha channel when available.
    • Name
      height
      Type
      integer
      Description
      Media height in pixels when available.
    • Name
      kind
      Type
      string
      Description
      Media category such as image, video, or document.
    • Name
      page_count
      Type
      integer
      Description
      Page count for document-like files when available.
    • Name
      width
      Type
      integer
      Description
      Media width in pixels when available.
  • metadataobjectClick or tap to expand

    Read-only information added by Inttegro. Use custom_data for your own values.

  • Name
    name
    Type
    string
    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 .csv files 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
    scan_status
    Type
    string
    Description

    File safety check status: pending, passed, failed, or skipped.

  • Name
    size
    Type
    integer
    Description

    Original file size in bytes.

  • sourceobjectHow the file was uploaded.Click or tap to expand
    • Name
      service
      Type
      string
      Description
      Service that supplied the file, when applicable.
    • Name
      type
      Type
      string
      Description
      Source type such as direct or upload_request.
    • Name
      upload_request_id
      Type
      string
      Description
      Upload-request ID when the file came from a delegated upload.
  • Name
    status
    Type
    string
    Description

    File lifecycle status: uploading, processing, available, failed, or deleted.

  • storageobjectSize and encoding of the stored file.Click or tap to expand
    • Name
      encoding
      Type
      string
      Description
      Stored representation, such as identity or br.
    • Name
      stored_size
      Type
      integer
      Description
      Stored object size in bytes.
  • Name
    updated_at
    Type
    timestamp
    Description

    When the file record was last updated.

POST/files/create

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

  • custom_dataobjectClick 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.

  • Name
    file
    Type
    file
    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 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

POST/files/create
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"

Response

SDK versionv8.2.0
FileResponse {
file: {},
}
POST/files/lookup

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
    file_id
    Type
    string
    Required
    required
    Description

    File ID to retrieve.

Response

The response returns the requested file.

Request

POST/files/lookup
curl https://api.inttegro.com/files/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id":"file_4q6YcQk1RzPv2mDa8nFw0sHu"}'
POST/files/page

Page files

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

Request body

  • Name
    created_after
    Type
    timestamp
    Description

    Return files created at or after this RFC 3339 timestamp.

  • Name
    created_before
    Type
    timestamp
    Description

    Return files created at or before this RFC 3339 timestamp.

  • Name
    page_number
    Type
    integer
    Description

    Page number to retrieve. Defaults to 1.

  • Name
    page_size
    Type
    integer
    Description

    Requested number of files per page. Defaults to 25 and is capped at 256.

  • Name
    purpose
    Type
    string
    Description

    Filter by file purpose.

  • Name
    status
    Type
    string
    Description

    Filter by lifecycle status: uploading, processing, available, failed, or 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

POST/files/page
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}'

Response (abbreviated file objects)

SDK versionv8.2.0
PageResponse {
page: {},
}
POST/file_references/reconcile

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
    array
    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
      file_id
      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
      reference_kind
      Type
      string
      Description

      Optional kind describing reference. Use file for a file ID or file_link for a file-link ID.

  • Name
    resource_id
    Type
    string
    Required
    required
    Description

    ID of the resource whose live reference set is being replaced.

  • Name
    resource_type
    Type
    string
    Required
    required
    Description

    Stable resource kind, such as product.

Response

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

Request

POST/file_references/reconcile
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"
}]
}'

Response

SDK versionv8.2.0
ReconciledResponse {
reconciled: true,
}
POST/files/contents

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
    string
    Description

    Optional response disposition: attachment or inline. Defaults to attachment.

  • Name
    delivery
    Type
    string
    Description

    Delivery mode: stream or redirect. Defaults to stream.

  • Name
    file_id
    Type
    string
    Required
    required
    Description

    File ID whose bytes should be delivered.

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

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

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
    file_id
    Type
    string
    Required
    required
    Description

    File ID to delete.

Response

The response returns the deleted file with status set to deleted.

Request

POST/files/delete
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"}'

Response (abbreviated file object)

SDK versionv8.2.0
FileResponse {
file: {},
}