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.
Operations
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
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
Defaults and limits
- Links expire after 24 hours unless you provide a future
expires_at. - Delivery defaults to
download. Useinlineto display supported media in the browser orredirectto send the browser to a short-lived delivery URL. max_accessessets the number of successful opens. Omit it or use0for no access-count limit.- An attachment requires
access.allow_download: true. - Allowed origins must contain only a scheme and host. Allowed IP ranges use CIDR notation.
Response
The response returns the new file_link and the public url.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/file_links/create \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": "file_4q6YcQk1RzPv2mDa8nFw0sHu",
"delivery": { "mode": "inline" },
"access": { "allow_download": true, "max_accesses": 100 },
"expires_at": "2030-07-06T12:30:00Z"
}'
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: "2030-07-06T12:30:00Z",
})
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.FileLinkCreateParams{
FileID: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
Delivery: inttegro.FileLinkDelivery{
Mode: "inline",
},
Access: inttegro.FileLinkAccess{
AllowDownload: true,
MaxAccesses: 100,
},
ExpiresAt: "2030-07-06T12:30:00Z",
}
fileLink, url, err := client.FileLinks.Create(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = fileLink
_ = url
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.file_links.create(inttegro.file_links.CreateRequest(
file_id="file_4q6YcQk1RzPv2mDa8nFw0sHu",
delivery=inttegro.file_links.Delivery(
mode="inline",
),
access=inttegro.file_links.Access(
allow_download=True,
max_accesses=100,
),
expires_at="2030-07-06T12:30:00Z",
))
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->fileLinks->create([
'file_id' => 'file_4q6YcQk1RzPv2mDa8nFw0sHu',
'delivery' => [
'mode' => 'inline',
],
'access' => [
'allow_download' => true,
'max_accesses' => 100,
],
'expires_at' => '2030-07-06T12:30:00Z',
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.file_links.create(
file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
delivery: {
mode: "inline",
},
access: {
allow_download: true,
max_accesses: 100,
},
expires_at: "2030-07-06T12:30:00Z"
)
import com.inttegro.Client;
import com.inttegro.files.FileLinkCreateParams;
import com.inttegro.files.FileLinkDelivery;
import com.inttegro.files.FileLinkDeliveryMode;
import com.inttegro.files.FileLinkAccess;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = FileLinkCreateParams.builder()
.fileId("file_4q6YcQk1RzPv2mDa8nFw0sHu")
.delivery(FileLinkDelivery.builder()
.mode(FileLinkDeliveryMode.INLINE)
.build())
.access(FileLinkAccess.builder()
.allowDownload(true)
.maxAccesses(100)
.build())
.expiresAt("2030-07-06T12:30:00Z")
.build();
var result = client.fileLinks().create(params, null);
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.FileLinks.CreateAsync(new {
file_id = "file_4q6YcQk1RzPv2mDa8nFw0sHu",
delivery = new {
mode = "inline",
},
access = new {
allow_download = true,
max_accesses = 100,
},
expires_at = "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 file_link.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/file_links/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"flink_8pQz3LkY6mN2vT9sB4cD1eF0"}'
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",
})
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.FileLinks.Lookup(ctx, "flink_8pQz3LkY6mN2vT9sB4cD1eF0")
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.file_links.lookup("flink_8pQz3LkY6mN2vT9sB4cD1eF0")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->fileLinks->lookup("flink_8pQz3LkY6mN2vT9sB4cD1eF0");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.file_links.lookup(id: "flink_8pQz3LkY6mN2vT9sB4cD1eF0")
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.fileLinks().lookup("flink_8pQz3LkY6mN2vT9sB4cD1eF0");
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.FileLinks.LookupAsync("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
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 file_links array.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/file_links/page \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id":"file_4q6YcQk1RzPv2mDa8nFw0sHu","status":"active","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.fileLinks.page({
fileId: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
status: "active",
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.FileLinkPageParams{
FileID: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
Status: "active",
PageNumber: 1,
PageSize: 25,
}
result, err := client.FileLinks.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.file_links.page(inttegro.file_links.PageRequest(
file_id="file_4q6YcQk1RzPv2mDa8nFw0sHu",
status="active",
page_number=1,
page_size=25,
))
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->fileLinks->page([
'file_id' => 'file_4q6YcQk1RzPv2mDa8nFw0sHu',
'status' => 'active',
'page_number' => 1,
'page_size' => 25,
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.file_links.page(
file_id: "file_4q6YcQk1RzPv2mDa8nFw0sHu",
status: "active",
page_number: 1,
page_size: 25
)
import com.inttegro.Client;
import com.inttegro.files.FileLinkPageParams;
import com.inttegro.files.FileLinkStatus;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var params = FileLinkPageParams.builder()
.fileId("file_4q6YcQk1RzPv2mDa8nFw0sHu")
.status(FileLinkStatus.ACTIVE)
.pageNumber(1)
.pageSize(25)
.build();
var result = client.fileLinks().page(params);
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.FileLinks.PageAsync(new {
file_id = "file_4q6YcQk1RzPv2mDa8nFw0sHu",
status = "active",
page_number = 1,
page_size = 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
Response
The response returns the updated file_link with status set to revoked. The URL stops working immediately.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/file_links/revoke \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: revoke-file-link-001" \
-H "Content-Type: application/json" \
-d '{
"id": "flink_8pQz3LkY6mN2vT9sB4cD1eF0",
"revoked_by": { "type": "user", "id": "usr_support_123" }
}'
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",
})
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.FileLinkRevokeParams{
ID: "flink_8pQz3LkY6mN2vT9sB4cD1eF0",
RevokedBy: inttegro.FileActor{
Type: "user",
ID: "usr_support_123",
},
}
result, err := client.FileLinks.Revoke(ctx, params, inttegro.WithIdempotencyKey("revoke-file-link-001"))
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.file_links.revoke(inttegro.file_links.RevokeRequest(
id="flink_8pQz3LkY6mN2vT9sB4cD1eF0",
revoked_by=inttegro.FileActorInput(
type="user",
id="usr_support_123",
),
),
idempotency_key="revoke-file-link-001")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->fileLinks->revoke([
'id' => 'flink_8pQz3LkY6mN2vT9sB4cD1eF0',
'revoked_by' => [
'type' => 'user',
'id' => 'usr_support_123',
],
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.file_links.revoke(
id: "flink_8pQz3LkY6mN2vT9sB4cD1eF0",
revoked_by: {
type: "user",
id: "usr_support_123",
},
idempotency_key: "revoke-file-link-001"
)
import com.inttegro.Client;
import com.inttegro.files.FileLinkRevokeParams;
import com.inttegro.files.Actor;
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 = FileLinkRevokeParams.builder()
.id("flink_8pQz3LkY6mN2vT9sB4cD1eF0")
.revokedBy(Actor.builder()
.type("user")
.id("usr_support_123")
.build())
.build();
var result = client.fileLinks().revoke(params, RequestOptions.withIdempotencyKey("revoke-file-link-001"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.FileLinks.RevokeAsync(new {
id = "flink_8pQz3LkY6mN2vT9sB4cD1eF0",
revoked_by = new {
type = "user",
id = "usr_support_123",
},
}, "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.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl "<FILE_LINK_URL>" \
--output hero.png
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',
})
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"))
download, err := client.FileLinks.Open(ctx, "<FILE_LINK_URL>")
if err != nil {
log.Fatal(err)
}
defer download.Close()
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
download = client.file_links.open(
"<FILE_LINK_URL>",
save_to="./hero.png",
)
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$download = $client->fileLinks->open(
'<FILE_LINK_URL>',
'./hero.png'
);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
download = client.file_links.open(
"<FILE_LINK_URL>",
save_to: "./hero.png"
)
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 download = client.fileLinks().open("<FILE_LINK_URL>");
download.saveTo(java.nio.file.Path.of("./hero.png"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var download = await inttegro.FileLinks.OpenAsync(
"<FILE_LINK_URL>",
"./hero.png"
);