API reference/Media and accounts
Signed upload and download links for reference media and generated results. To upload, request
an upload URL, then PUT the file bytes to it. Media endpoints cover audio and video;
image endpoints cover images. Every link lasts 48 hours, and Sogni keeps generated media for about two days.
Unlimited subscribers can also keep saved uploads to reuse across projects.
Treat every link as opaque. Use uploadUrl and downloadUrl exactly as
returned. Don't parse, rebuild, or allowlist the host, and don't strip the query string: the signature lives
there, and storage refuses unsigned requests. The storage host behind these links can change without notice.
Returns a signed PUT URL for one image. Same flow as media: PUT the raw bytes to uploadUrl with a Content-Type header equal to the contentType you requested. The URL is valid for 48 hours.
#Query parameters
| Name | Type | In | Description |
| typerequired | string | query | Asset type. Artist-side: startingImage, cnImage, contextImage1–contextImage16, referenceImage, referenceImageEnd, referenceMask. Worker-side: complete, preview. |
| jobIdrequired | string | query | Job identifier. |
| imageId | string | query | Artifact id. Required for worker uploads. |
| contentType | string | query | MIME type of the image: image/png, image/jpeg, image/jpg, image/webp, or image/gif. Defaults to image/png. Send the same value as the upload's Content-Type header. |
#Response
{
"status": "success",
"data": {
"uploadUrl": "https://<signed-storage-url>"
}
}
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: image/png" \
--data-binary @startingImage.png
Returns a signed download URL, valid for 48 hours, for an image artifact. Query parameters match the image upload endpoint.
#Response
{
"status": "success",
"data": {
"downloadUrl": "https://<signed-storage-url>"
}
}
Saved uploads. Unlimited subscribers can save an image, video, or audio file once
and reuse it across projects without uploading it again. Saved uploads are private to the account.
The
JavaScript and Python SDKs use them automatically when you pass files
to
projects.create(), and expose
projects.assets for explicit control;
durable workflows take
media_references URLs instead. Prepare, finalize, and bind
require an active Unlimited plan (
403 otherwise); listing, capabilities, and removal
do not. Files are kept while the plan is active, and for 30 days after the later of the paid
period's end and the last save or reuse.
Returns data.assets, newest first, and data.limits (fileBytes, idleDays). Each record has id, name, bytes, contentType, state (uploading or ready), createdAt, and expiresAt (Unix milliseconds).
Returns { enabled, limits }. enabled is false without an active plan or when saved storage is unavailable.
#Body
| Name | Type | In | Description |
| sha256required | string | body | Lowercase hex SHA-256 of the file. |
| bytesrequired | integer | body | File size, from 1 to limits.fileBytes. |
| contentTyperequired | string | body | image/png, image/jpeg, image/webp, video/mp4, video/quicktime, video/webm, audio/mp4, audio/mpeg, audio/flac, audio/wav, audio/x-wav, or audio/wave. |
| name | string | body | Optional label, up to 80 characters. |
If the same file is already saved, returns its record with reused: true and nothing to upload. Otherwise returns the record with reused: false, an uploadUrl, and uploadHeaders. PUT the exact bytes to uploadUrl within five minutes, sending exactly those headers. An upload that is never finalized expires after one hour.
Send a JSON body ({} is fine). Verifies size, type, and checksum, then returns the ready record. A mismatch returns 409, an expired upload 410, and a busy entry 423.
Copies a ready saved upload into a project input slot before you submit the project through the SDK. Body: { projectId, type, id? }. projectId is the UUID you will submit; type is an image input type from the image upload endpoint, referenceVideo, or referenceAudio, and must match the file's media type; id selects a numbered reference slot. Returns { assetId, projectId, type, contentType }. A project ID already claimed by another account returns 403.
Deletes the saved file; data is {}. Inputs already copied into existing projects are not affected. An unknown ID, or one owned by another account, returns 404.