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

object

Object

id

String

The files's unique identifier

status

Enum

The files's status

file_name

String

The file's name

file_size

Number

The file's size in bytes

file_type

String

The file's MIME type

title

String

The file's title

purpose

Object

created_at

Date

The files's creation date

updated_at

Date

The 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.456Z",
"updated_at": "2025-08-12T09:45:15.456Z"
}

List instance files

Returns a paginated list of files owned by the instance.

GEThttp://api.metorial.com/files
curl -X GET "https://api.metorial.com/files" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."

Get file by ID

Retrieves details for a specific file by its ID.

URL Parameters

fileId

String

The unique identifier for the file

GEThttp://api.metorial.com/files/:fileId
curl -X GET "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."

Update file by ID

Updates editable fields of a specific file by its ID.

URL Parameters

fileId

String

The unique identifier for the file

Request Body

title

StringOptional
PATCHhttp://api.metorial.com/files/:fileId
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

fileId

String

The unique identifier for the file

DELETEhttp://api.metorial.com/files/:fileId
curl -X DELETE "https://api.metorial.com/files/fil_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."