File Links
Files are private by default. If you want to share a file, you can create a link for it. Links are public and do not require authentication to access, so be careful with what you share.
File Links object
Attributes
object
Objectid
StringThe files's unique identifier
status
EnumThe files's status
file_name
StringThe file's name
file_size
NumberThe file's size in bytes
file_type
StringThe file's MIME type
title
StringThe file's title
purpose
Objectcreated_at
DateThe files's creation date
updated_at
DateThe files's last update date
{"object": "file","id": "example_id","status": "active","file_name": "sample.png","file_size": 123456,"file_type": "image/png","title": "Sample Image","purpose": {"name": "User Image","identifier": "files_image"},"created_at": "2025-08-12T09:45:15.493Z","updated_at": "2025-08-12T09:45:15.493Z"}
List file links
Returns a list of links associated with a specific file.
URL Parameters
fileId
StringThe unique identifier for the file
curl -X GET "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..."
Get file link by ID
Retrieves the details of a specific file link by its ID.
URL Parameters
fileId
StringThe unique identifier for the file
linkId
StringThe unique identifier for the link
curl -X GET "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links/lin_Rm4Mnheq2bfEPhBhP7SY" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..."
Create file link
Creates a new link for a specific file.
URL Parameters
fileId
StringThe unique identifier for the file
Request Body
expires_at
DateOptionalcurl -X POST "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"expires_at": "2025-08-12T09:45:15.493Z"}'
Update file link by ID
Updates a file link’s properties, such as expiration.
URL Parameters
fileId
StringThe unique identifier for the file
linkId
StringThe unique identifier for the link
Request Body
expires_at
DateOptionalcurl -X PATCH "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links/lin_Rm4Mnheq2bfEPhBhP7SY" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"expires_at": "2025-08-12T09:45:15.493Z"}'
Delete file link by ID
Deletes a specific file link by its ID.
URL Parameters
fileId
StringThe unique identifier for the file
linkId
StringThe unique identifier for the link
curl -X DELETE "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links/lin_Rm4Mnheq2bfEPhBhP7SY" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..."