Files & Uploads Endpoints¶
File upload via presigned URLs, file serving, and admin operations.
Presigned URL Upload¶
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/uploads/presigned-url |
Generate a presigned URL for direct R2 upload |
Request¶
| Field | Type | Required | Description |
|---|---|---|---|
filename |
string | Yes | Original filename |
content_type |
string | Yes | MIME type of the file |
size |
integer | No | File size in bytes (used for dynamic token expiration) |
Response¶
| Field | Type | Description |
|---|---|---|
upload_url |
string | Presigned R2 URL — client PUTs file directly here |
file_url |
string | CDN URL where the file will be accessible |
upload_method |
string | PUT |
expires_in_seconds |
integer | Token validity (default 15 min, adjusted by file size) |
max_file_size |
integer | Maximum allowed file size in bytes (52428800 = 50MB) |
The client uploads the file directly to R2 using the presigned URL. The file is stored at temp/{file_id}_{timestamp}_{safe_filename} and later relocated to permanent storage during entity creation.
MediaResource Lifecycle¶
The file_url returned from the presigned response is a temporary CDN path pointing to the temp/ prefix. When the entity is created (e.g., POST /products), the Backend's MediaResourceService.ingest_all() processes the temp URL:
- HEAD the temp file to get ETag and size
- Compute content hash for deduplication
- On dedup miss: create
MediaResource, relocate file to canonical pathmedia/{resource_id}/file.{ext} - On dedup hit: reuse existing
MediaResource, delete temp file - Create
MediaResourceAttachmentlinking the resource to the entity
The final canonical URL is {CDN_URL}/media/{resource_id}/file.{ext}. See MediaResource Lifecycle for full details.
File Serving¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /files/{file_path:path} |
Backward compatibility endpoint to serve a file via 302 redirect to CDN/MinIO |
Query Parameters¶
| Parameter | Type | Description |
|---|---|---|
type |
string | Optional format conversion (webp, jpeg, png, avif, gif) |
Behavior¶
- In production (Cloudflare Image Transformations enabled): redirects to
/cdn-cgi/image/format={type},quality=90/{file_path} - In development (MinIO): redirects directly to
{R2_PUBLIC_URL}/{file_path}
Admin Upload [ Deprecated, needs removal ]¶
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/uploads/admin/upload-lora |
Upload a LoRA model file (superuser only) |
Requires superuser authentication. Used for uploading LoRA training model files to storage.
Validation Rules¶
| Rule | Value |
|---|---|
| Max file size | 50MB |
| Allowed image types | image/jpeg, image/png, image/webp, image/gif, image/avif |
| Other allowed types | application/zip, application/pdf, video/mp4, audio/mpeg |
| Filename sanitization | Directory traversal prevention, safe character enforcement |
Bulk Upload¶
| Method | Endpoint | Description |
|---|---|---|
| POST | /bulk-upload/ |
Start a bulk CSV import |
| GET | /bulk-upload/{id} |
Get bulk upload job status |
| GET | /bulk-upload/{id}/errors |
Get upload errors for a job |
Export Configuration¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /export-configuration/ |
List export configurations |
| POST | /export-configuration/ |
Create an export configuration |
API Reference¶
Sartiq Backend Server - Files 0.1.0¶
export-configuration¶
GET /api/v1/users/me/export-configurations¶
List My Export Configurations
Description
List all personal export configurations for the current user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
[
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
]
GET /api/v1/users/me/export-configuration¶
Get My Export Configuration
Description
Get the current user's first personal export configuration.
Returns 404 if the user hasn't created an export configuration yet.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
POST /api/v1/users/me/export-configuration¶
Create My Export Configuration
Description
Create an export configuration for the current user.
Multiple configurations are allowed per user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
{
"image_format": "webp",
"metadata_adapter": "default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}"
}
Schema of the request body
{
"properties": {
"name": {
"type": "string",
"title": "Name",
"default": "Default"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter",
"default": "default"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat",
"default": "webp"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"title": "ExportConfigurationCreate",
"description": "Schema for creating a new export configuration.",
"example": {
"image_format": "webp",
"metadata_adapter": "default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}"
}
}
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
DELETE /api/v1/users/me/export-configuration¶
Delete My Export Configuration
Description
Delete the current user's first personal export configuration.
After deletion, production_requests without a direct export config will fall back to system defaults. Returns 404 if no configuration exists.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
PATCH /api/v1/users/me/export-configuration¶
Update My Export Configuration
Description
Update the current user's first personal export configuration.
Returns 404 if the user hasn't created an export configuration yet.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
Schema of the request body
{
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"metadata_adapter": {
"anyOf": [
{
"$ref": "#/components/schemas/MetadataAdapter"
},
{
"type": "null"
}
]
},
"image_format": {
"anyOf": [
{
"$ref": "#/components/schemas/ImageFormat"
},
{
"type": "null"
}
]
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"title": "ExportConfigurationUpdate",
"description": "Schema for updating an existing export configuration.\n\nAll fields are optional to support partial updates via PATCH.",
"example": {
"image_format": "jpeg",
"metadata_adapter": "ovs"
}
}
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
GET /api/v1/users/export-configurations/{config_id}¶
Get Export Configuration
Description
Get an export configuration by ID.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
config_id |
path | string | No |
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
PATCH /api/v1/users/export-configurations/{config_id}¶
Update Export Configuration
Description
Update an export configuration by ID.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
config_id |
path | string | No |
Request body
Schema of the request body
{
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"metadata_adapter": {
"anyOf": [
{
"$ref": "#/components/schemas/MetadataAdapter"
},
{
"type": "null"
}
]
},
"image_format": {
"anyOf": [
{
"$ref": "#/components/schemas/ImageFormat"
},
{
"type": "null"
}
]
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"title": "ExportConfigurationUpdate",
"description": "Schema for updating an existing export configuration.\n\nAll fields are optional to support partial updates via PATCH.",
"example": {
"image_format": "jpeg",
"metadata_adapter": "ovs"
}
}
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
DELETE /api/v1/users/export-configurations/{config_id}¶
Delete Export Configuration
Description
Delete an export configuration by ID.
Looks and guidelines referencing this config will have their FK set to NULL and will fall back to org/user/system default resolution.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
config_id |
path | string | No |
Responses
GET /api/v1/users/{user_id}/export-configuration¶
Get User Export Configuration
Description
Get first export configuration for a specific user.
Regular users can only access their own configuration. Admins can access any user's configuration.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
POST /api/v1/users/{user_id}/export-configuration¶
Create User Export Configuration
Description
Create export configuration for a specific user.
Regular users can only create their own configuration. Admins can create configuration for any user. Multiple configurations are allowed per user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Request body
{
"image_format": "webp",
"metadata_adapter": "default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}"
}
Schema of the request body
{
"properties": {
"name": {
"type": "string",
"title": "Name",
"default": "Default"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter",
"default": "default"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat",
"default": "webp"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"title": "ExportConfigurationCreate",
"description": "Schema for creating a new export configuration.",
"example": {
"image_format": "webp",
"metadata_adapter": "default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}"
}
}
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
PATCH /api/v1/users/{user_id}/export-configuration¶
Update User Export Configuration
Description
Update first export configuration for a specific user.
Regular users can only update their own configuration. Admins can update configuration for any user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Request body
Schema of the request body
{
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"metadata_adapter": {
"anyOf": [
{
"$ref": "#/components/schemas/MetadataAdapter"
},
{
"type": "null"
}
]
},
"image_format": {
"anyOf": [
{
"$ref": "#/components/schemas/ImageFormat"
},
{
"type": "null"
}
]
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"title": "ExportConfigurationUpdate",
"description": "Schema for updating an existing export configuration.\n\nAll fields are optional to support partial updates via PATCH.",
"example": {
"image_format": "jpeg",
"metadata_adapter": "ovs"
}
}
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
DELETE /api/v1/users/{user_id}/export-configuration¶
Delete User Export Configuration
Description
Delete first export configuration for a specific user.
Regular users can only delete their own configuration. Admins can delete configuration for any user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Responses
GET /api/v1/users/organizations/{org_id}/export-configurations¶
List Organization Export Configurations
Description
List all export configurations for an organization.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
org_id |
path | string | No |
Responses
[
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
]
GET /api/v1/users/organizations/{org_id}/export-configuration¶
Get Organization Export Configuration
Description
Get first organization export configuration.
Returns 404 if no organization-level configuration exists.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
org_id |
path | string | No |
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
POST /api/v1/users/organizations/{org_id}/export-configuration¶
Create Organization Export Configuration
Description
Create export configuration for an organization.
Multiple configurations are allowed per organization.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
org_id |
path | string | No |
Request body
{
"image_format": "webp",
"metadata_adapter": "default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}"
}
Schema of the request body
{
"properties": {
"name": {
"type": "string",
"title": "Name",
"default": "Default"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter",
"default": "default"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat",
"default": "webp"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"title": "ExportConfigurationCreate",
"description": "Schema for creating a new export configuration.",
"example": {
"image_format": "webp",
"metadata_adapter": "default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}"
}
}
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
PATCH /api/v1/users/organizations/{org_id}/export-configuration¶
Update Organization Export Configuration
Description
Update first organization export configuration.
Returns 404 if no configuration exists.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
org_id |
path | string | No |
Request body
Schema of the request body
{
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"metadata_adapter": {
"anyOf": [
{
"$ref": "#/components/schemas/MetadataAdapter"
},
{
"type": "null"
}
]
},
"image_format": {
"anyOf": [
{
"$ref": "#/components/schemas/ImageFormat"
},
{
"type": "null"
}
]
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"title": "ExportConfigurationUpdate",
"description": "Schema for updating an existing export configuration.\n\nAll fields are optional to support partial updates via PATCH.",
"example": {
"image_format": "jpeg",
"metadata_adapter": "ovs"
}
}
Responses
{
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
},
"organization_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Organization Id"
},
"name": {
"type": "string",
"title": "Name"
},
"metadata_adapter": {
"$ref": "#/components/schemas/MetadataAdapter"
},
"image_format": {
"$ref": "#/components/schemas/ImageFormat"
},
"naming_convention_template": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Naming Convention Template"
}
},
"type": "object",
"required": [
"id",
"user_id",
"name",
"metadata_adapter",
"image_format"
],
"title": "ExportConfigurationPublic",
"description": "Public schema for export configuration responses.",
"example": {
"created_at": "2025-01-01T00:00:00Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"image_format": "webp",
"metadata_adapter": "default",
"name": "Default",
"naming_convention_template": "{brand}_{product_sku}_{shot_type}_v{version}",
"updated_at": "2025-01-01T00:00:00Z",
"user_id": "123e4567-e89b-12d3-a456-426614174001"
}
}
DELETE /api/v1/users/organizations/{org_id}/export-configuration¶
Delete Organization Export Configuration
Description
Delete first organization export configuration.
Looks and guidelines referencing this config will have their FK set to NULL.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
org_id |
path | string | No |
Responses
uploads¶
POST /api/v1/uploads/presigned-url¶
Get Presigned Url
Description
Generate presigned URL for file upload. In local implementation, returns a token and upload endpoint instead.
Requires authentication.
Enhanced features: - Dynamic token expiration based on file size - Better content type validation - File size limits for < 10MB files
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
Schema of the request body
{
"properties": {
"folder": {
"type": "string",
"title": "Folder"
},
"filename": {
"type": "string",
"title": "Filename"
},
"content_type": {
"type": "string",
"title": "Content Type"
},
"file_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "File Size"
}
},
"type": "object",
"required": [
"folder",
"filename",
"content_type"
],
"title": "PresignedUrlRequest"
}
Responses
POST /api/v1/uploads/admin/upload-lora¶
Upload Subject Lora
Description
Upload a LoRA file for a subject to the compute server. File must be a supported LoRA format (.safetensors, .ckpt, .pt, .pth, .bin) and max 100MB. Optionally set or update the lora_trigger (trigger word) for the subject.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
Schema of the request body
{
"properties": {
"file": {
"type": "string",
"contentMediaType": "application/octet-stream",
"title": "File"
},
"lora_trigger": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Lora Trigger"
},
"entity_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Entity Type"
}
},
"type": "object",
"required": [
"file"
],
"title": "Body_upload_lora"
}
Responses
{
"file_path": null,
"partial_path": null,
"filename": null,
"file_size": null,
"upload_timestamp": null
}
Schema of the response body
{
"properties": {
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "File Path"
},
"partial_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Partial Path"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Filename"
},
"file_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "File Size"
},
"upload_timestamp": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Upload Timestamp"
}
},
"type": "object",
"required": [
"file_path",
"partial_path",
"filename",
"file_size",
"upload_timestamp"
],
"title": "LoraUploadResponse"
}
files¶
GET /files/{file_path}¶
Serve File
Description
Serve files by redirecting to the storage backend (MinIO or Cloudflare R2 CDN).
In production with Cloudflare, uses Image Transformations for format conversion. In local dev (MinIO), redirects directly to the MinIO URL.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
file_path |
path | string | No | ||
type |
query | No | Target image format |
Responses
Schemas¶
Body_upload_lora¶
| Name | Type | Description |
|---|---|---|
entity_type |
||
file |
string | |
lora_trigger |
ExportConfigurationCreate¶
| Name | Type | Description |
|---|---|---|
image_format |
ImageFormat | |
metadata_adapter |
MetadataAdapter | |
name |
string | |
naming_convention_template |
ExportConfigurationPublic¶
| Name | Type | Description |
|---|---|---|
created_at |
string(date-time) | |
id |
string(uuid) | |
image_format |
ImageFormat | |
metadata_adapter |
MetadataAdapter | |
name |
string | |
naming_convention_template |
||
organization_id |
||
updated_at |
string(date-time) | |
user_id |
string(uuid) |
ExportConfigurationUpdate¶
| Name | Type | Description |
|---|---|---|
image_format |
||
metadata_adapter |
||
name |
||
naming_convention_template |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
ImageFormat¶
Type: string
LoraUploadResponse¶
| Name | Type | Description |
|---|---|---|
file_path |
||
file_size |
||
filename |
||
partial_path |
||
upload_timestamp |
Message¶
| Name | Type | Description |
|---|---|---|
message |
string |
MetadataAdapter¶
Type: string
PresignedUrlRequest¶
| Name | Type | Description |
|---|---|---|
content_type |
string | |
file_size |
||
filename |
string | |
folder |
string |
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |