Files
Documentation for the Ouro API Files endpoints.
Documentation for the Ouro API Files endpoints.
/files/createpublicprivateorganizationmonetizedPath to the file in Ouro's storage
File name with extension
File type or MIME type
/files/{id}/files/{id}/data/files/{id}/metadata/files/{id}/stats/files/{id}/permissions/files/{id}publicprivateorganizationmonetizedpay-to-unlockpay-per-usePricing strategy. Visibility must monetized to set monetization
/files/{id}Create a file asset from a local file.
Retrieves file details as a Pydantic model instance.
Retrieves the raw data content of the file identified by the provided ID.
Retrieves the metadata information for the file with the specified ID, including file size, type, and other properties.
Retrieves statistical information about the file.
Retrieves the current access permissions for the file with the specified ID.
Updates the file with new values for the specified file ID.
Deletes the file identified by the provided ID.
from ouro import Ouro
ouro = Ouro(api_key="your_api_key")
res = ouro.files.create(
name="your_file_name",
description="your_file_description",
visibility="private",
metadata={
"path": "path/to/file",
"name": "filename.txt",
"type": "text/plain"
}
)id = "3d82308b-0747-45e4-8045-c8f7d2f6c0a6"
# Retrieve a file
file = ouro.files.retrieve(id)# Read file's raw data
data = ouro.files.data(id)metadata = ouro.files.metadata(id)stats = ouro.files.stats(id)permissions = ouro.files.permissions(id)id = "3d82308b-0747-45e4-8045-c8f7d2f6c0a6"
update = {
"visibility": "private",
"description": "Updated file description"
}
file = ouro.files.update(id, **update)data = ouro.files.delete(id)