File links
Use File links to share product images and videos with customers or other recipients. You can set an expiry or access limit and revoke the link without deleting the underlying file.
Anyone with the URL can use the access it grants. Keep it out of logs and analytics, and share it only with its intended audience.
The file link object
A file link records which file can be opened, how it should be delivered, and when access ends. The public URL is returned only when the link is created.
Properties
accessFileLinkAccessAccess limits and usage details for the link.Click or tap to expand- Name
accessCount- Type
number- Description
- Number of successful opens recorded for this link.
- Name
allowDownload- Type
boolean- Description
- Whether attachment-style delivery is allowed.
- Name
allowedOrigins- Type
string[]- Description
- Optional list of allowed origins.
- Name
lastAccessedAt- Type
Date | null- Description
- When the link was last opened successfully.
- Name
maxAccesses- Type
number- Description
- Maximum number of successful opens allowed before the link stops working.
- Name
createdAt- Type
Date- Description
When the link was created.
customDataCustomDataClick or tap to expandOptional string key-value custom data attached to the link.
deliveryFileLinkDeliveryHow the file is presented when someone opens the link.Click or tap to expand- Name
disposition- Type
string- Description
- Response disposition, such as
Inttegro.FileDispositions.AttachmentorInttegro.FileDispositions.Inline.
- Name
mode- Type
FileLinkDeliveryMode- Description
- Delivery mode:
Inttegro.FileLinkDeliveryModes.Download,Inttegro.FileLinkDeliveryModes.Inline, orInttegro.FileLinkDeliveryModes.Redirect.
- Name
expiresAt- Type
Date | null- Description
When the link stops granting access.
- Name
fileId- Type
string- Description
File ID the link grants access to.
- Name
id- Type
string- Description
Unique file-link identifier. File link IDs begin with
flink_.
- Name
kind- Type
string- Description
Link kind. Currently
Inttegro.FileLinkKinds.Public.
metadataFileMetadataClick or tap to expandRead-only information added by Inttegro. Use
customDatafor your own values.- Name
revokedAt- Type
Date | null- Description
When the link was revoked. Returned only after revocation.
- Name
status- Type
FileLinkStatus- Description
Link lifecycle status:
Inttegro.FileLinkStatuses.Active,Inttegro.FileLinkStatuses.Revoked,Inttegro.FileLinkStatuses.Expired, orInttegro.FileLinkStatuses.Disabled.
Create a file link
Create a public URL for a product image or video. For private files such as support documents and product downloads, use Download file contents from your backend instead.
The response includes the URL to share and a file-link ID for managing it later. Store both when you create the link because lookup responses do not return the URL again.
Request body
accessFileLinkAccessRequestOptional access policy for the link.Click or tap to expand- Name
allowDownload- Type
boolean- Description
- Whether download-style delivery is allowed.
- Name
allowedIpRanges- Type
string[]- Description
- Optional list of allowed CIDR ranges. Enforced when the link is opened but not returned in responses.
- Name
allowedOrigins- Type
string[]- Description
- Optional list of allowed origins.
- Name
maxAccesses- Type
number- Description
- Optional maximum successful open count.
createdByFileActorOptional actor creating the link. By default,createdBy.typeis"api_key".Click or tap to expandcustomDataCustomDataClick or tap to expandOptional string key-value custom data for your own tracking. The encoded object can be at most 25 KiB, and each key can be at most 256 characters.
deliveryFileLinkDeliveryOptional delivery settings for the link.Click or tap to expand- Name
disposition- Type
string- Description
- Optional disposition override. Use
Inttegro.FileDispositions.AttachmentorInttegro.FileDispositions.Inline.
- Name
mode- Type
FileLinkDeliveryMode- Description
- Delivery mode:
Inttegro.FileLinkDeliveryModes.Download,Inttegro.FileLinkDeliveryModes.Inline, orInttegro.FileLinkDeliveryModes.Redirect.
- Name
expiresAt- Type
Date- Description
Optional RFC 3339 expiry. The default is 24 hours from creation.
- Name
fileId- Type
string- Required
- required
- Description
Linkable file ID to expose.
Defaults and limits
- Links expire after 24 hours unless you provide a future
expiresAt. - Delivery defaults to
Inttegro.FileLinkDeliveryModes.Download. UseInttegro.FileLinkDeliveryModes.Inlineto display supported media in the browser orInttegro.FileLinkDeliveryModes.Redirectto send the browser to a short-lived delivery URL. access.maxAccessessets the number of successful opens. Omit it or use0for no access-count limit.- An attachment requires
access.allowDownloadset totrue. - Allowed origins must contain only a scheme and host. Allowed IP ranges use CIDR notation.
Response
The response returns the new FileLinkCreation and its public url.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.fileLinks.create({
fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
delivery: {
mode: "inline",
},
access: {
allowDownload: true,
maxAccesses: 100,
},
expiresAt: new Date("2030-07-06T12:30:00Z"),
})
Lookup a file link
Retrieve a file link's status, delivery settings, access limits, and usage. The public URL is returned only when you create the link.
Request body
Response
The response returns the requested FileLink.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.fileLinks.lookup({
id: "flink_8pQz3LkY6mN2vT9sB4cD1eF0",
})
Page file links
Browse the file links in your Inttegro account. Filter by file to see every link created for one asset, or by status to find links that are active, revoked, expired, or disabled.
Request body
- Name
fileId- Type
string- Description
Optional file ID filter.
- Name
pageNumber- Type
number- Description
Page number to retrieve. Defaults to
1.
- Name
pageSize- Type
number- Description
Requested number of links per page. Defaults to
25and is capped at256.
- Name
status- Type
FileLinkStatus- Description
Optional status filter:
Inttegro.FileLinkStatuses.Active,Inttegro.FileLinkStatuses.Revoked,Inttegro.FileLinkStatuses.Expired, orInttegro.FileLinkStatuses.Disabled.
Response
Without a status filter, links are returned newest first. A status-filtered page is ordered by expiry. The response contains the current page number, the number of links returned, and a fileLinks array.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.fileLinks.page({
fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
status: "active",
pageNumber: 1,
pageSize: 25,
})
Revoke a file link
Stop a public URL from serving its file. Revoke a link when it was shared with the wrong audience, has outlived its purpose, or should be replaced with a different access policy.
Request body
- Name
id- Type
string- Required
- required
- Description
File-link ID to revoke.
Response
The response returns the updated FileLink with status set to Inttegro.FileLinkStatuses.Revoked. The URL stops working immediately.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.fileLinks.revoke({
id: "flink_8pQz3LkY6mN2vT9sB4cD1eF0",
revokedBy: {
type: "user",
id: "usr_support_123",
},
}, {
idempotencyKey: "revoke-file-link-001",
})
Open a file link
This is the public endpoint behind the URL returned when you create a file link. It does not use your API key. Applications should use the complete returned URL rather than constructing it from the query parameters.
Query parameters
Response
Use the complete URL returned by Create a file link unchanged. It works only while the link is active and within its expiry and access limits.
Download and inline links return the file. Redirect links send the browser to a short-lived delivery URL. A successful open counts toward access.max_accesses; an unsuccessful attempt does not. This public URL operation deliberately stays in wire form because it is not an SDK resource method.
Request
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const download = await inttegro.fileLinks.open({
url: '<FILE_LINK_URL>',
saveTo: './hero.png',
})