Mixedbread

Update File

Update the details of a specific file.

POST
/v1/files/{file_id}

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Api key to access Mixedbreads API

Path Parameters

file_id*File Id

The ID of the file to update

Formatuuid

Request Body

multipart/form-data
  1. body
file*File

The file to update

Response Body

The updated file details

application/json
  1. response

A model representing a file object in the system.

This model contains metadata about files stored in the system, including identifiers, size information, and timestamps.

id*Id

Unique identifier for the file

filename*Filename

Name of the file including extension

Length1 <= length
bytes*Bytes

Size of the file in bytes

Range0 < value
mime_type*Mime Type

MIME type of the file

Match^[\w\.\-\+]+/[\w\.\-\+]+(\.\w+)*$
version*Version

Version of the file

Range1 <= value
created_at*Created At

Timestamp when the file was created

Formatdate-time
updated_at*Updated At

Timestamp when the file was last updated

Formatdate-time
from mixedbread import Mixedbreadmxbai = Mixedbread(api_key="YOUR_API_KEY")file_path = "updated_document.pdf"with open(file_path, "rb") as f:    res = mxbai.files.update(file_id="f47ac10b-58cc-4372-a567-0e02b2c3d479", file=f)    print(res)
{  "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",  "filename": "updated_document.pdf",  "bytes": 2097152,  "mime_type": "application/pdf",  "version": 2,  "created_at": "2025-01-15T10:00:00.000Z",  "updated_at": "2025-01-15T16:30:00.000Z",  "object": "file"}