Files

Represents files that you have uploaded to Metorial. Files can be linked to various resources based on their purpose. Metorial can also automatically extract files for you, for example for data exports.

Files 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-24T15:30:30.334Z",
"updated_at": "2025-10-24T15:30:30.334Z"
},
"pagination": {
"has_more_before": false,
"has_more_after": false
}
}

List instance files

Returns a paginated list of files owned by the instance.

Query Parameters

limit

NumberOptional

after

StringOptional

before

StringOptional

cursor

StringOptional

order

EnumOptional

purpose

EnumOptional

organization_id

StringOptional
GEThttp://api.metorial.com/files
curl -X GET "https://api.metorial.com/files" \
-H "Authorization: Bearer metorial_sk_..."

Get file by ID

Retrieves details for a specific file by its ID.

URL Parameters

file_id

String

The unique identifier for the file

GEThttp://api.metorial.com/files/:file_id
curl -X GET "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."

Update file by ID

Updates editable fields of a specific file by its ID.

URL Parameters

file_id

String

The unique identifier for the file

Request Body

title

StringOptional
PATCHhttp://api.metorial.com/files/:file_id
curl -X PATCH "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"title": "example_title"
}'

Delete file by ID

Deletes a specific file by its ID.

URL Parameters

file_id

String

The unique identifier for the file

DELETEhttp://api.metorial.com/files/:file_id
curl -X DELETE "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."