Files
Last updated 2mo ago
Documentation for the Ouro API Files endpoints.
Documentation for the Ouro API Files endpoints.
/files/create
Create a file asset from a local file.
public
private
organization
monetized
Path to the file in Ouro's storage
File name with extension
File type or MIME type
/files/{id}
Retrieves file details as a Pydantic model instance.
/files/{id}/data
Retrieves the raw data content of the file identified by the provided ID.
/files/{id}/metadata
Retrieves the metadata information for the file with the specified ID, including file size, type, and other properties.
/files/{id}/stats
Retrieves statistical information about the file.
/files/{id}/permissions
Retrieves the current access permissions for the file with the specified ID.
/files/{id}
Updates the file with new values for the specified file ID.
public
private
organization
monetized
pay-to-unlock
pay-per-use
Pricing strategy. Visibility must monetized to set monetization
/files/{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)