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
items
Object{"items": {"0": {"object": "file","status": "active","file_name": "sample.png","file_size": 123456,"file_type": "image/png","title": "Sample Image","purpose": {"name": "User Image","identifier": "files_image"}},"object": "example_object","id": "example_id","status": "","file_name": "example_file_name","file_size": 0,"file_type": "example_file_type","title": "example_title","purpose": {"name": "example_name","identifier": "example_identifier"},"created_at": "2025-10-15T16:41:26.490Z","updated_at": "2025-10-15T16:41:26.490Z"},"pagination": {"has_more_before": false,"has_more_after": false}}
List file links
Returns a list of links associated with a specific file.
URL Parameters
file_id
StringThe unique identifier for the file
curl -X GET "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links" \-H "Authorization: Bearer metorial_sk_..."
Get file link by ID
Retrieves the details of a specific file link by its ID.
URL Parameters
file_id
StringThe unique identifier for the file
link_id
StringThe unique identifier for the link
curl -X GET "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links/lin_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."
Create file link
Creates a new link for a specific file.
URL Parameters
file_id
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-10-15T16:41:26.490Z"}'
Update file link by ID
Updates a file link’s properties, such as expiration.
URL Parameters
file_id
StringThe unique identifier for the file
link_id
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-10-15T16:41:26.490Z"}'
Delete file link by ID
Deletes a specific file link by its ID.
URL Parameters
file_id
StringThe unique identifier for the file
link_id
StringThe unique identifier for the link
curl -X DELETE "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY/links/lin_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."