Files

Endpoints for listing, retrieving, updating, and deleting files associated with an instance.

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-07-20T12:25:38.539Z",
"updated_at": "2025-07-20T12:25:38.539Z"
}

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_..."