# Uploads ## Create **post** `/uploads` Create a temporary upload URL for a file. Support multipart uploads. Return a list of URLs for each part of the file. ### Body Parameters - `assetOptions: optional object { collectionIds, hide, parentId }` Asset extra options. Only available for kinds which produce an asset. (Not available for model kind) - `collectionIds: optional array of string` The collection ids to add the asset to. - `hide: optional boolean` Specify if the asset should be hidden from the user. - `parentId: optional string` The parentId of the asset. - `civitaiModelUrl: optional string` The civitai.com url of the model (example: "https://civitai.com/models/370194/translucent-subsurface-scattering-test?modelVersionId=413566"). - `contentType: optional string` Required for multipart upload. The MIME type of the file (example: "image/jpeg") - `fileName: optional string` Required for multipart upload. The original file name of the image (example: "low-res-image.jpg"). It will be ignored if assetId is provided. - `fileSize: optional number` Required for multipart upload. The size of the file in bytes - `huggingFaceModelName: optional string` The huggingface.co modelName (example: "stabilityai/stable-diffusion-xl-base-1.0"). No need to setup other fields if you setup huggingFaceModelName - `kind: optional "3d" or "asset" or "audio" or 4 more` Required for multipart upload and url. The purpose of the file once validated (example: "model") - `"3d"` - `"asset"` - `"audio"` - `"avatar"` - `"image"` - `"model"` - `"video"` - `parts: optional number` Required for multipart upload. The number of parts the file will be uploaded in - `url: optional string` The url where to download the file. If you setup url you MUST setup kind as well. ### Returns - `upload: object { id, authorId, createdAt, 18 more }` - `id: string` - `authorId: string` - `createdAt: string` - `fileName: string` - `kind: "3d" or "asset" or "audio" or 4 more` The kind of the file once validated (example: "model") - `"3d"` - `"asset"` - `"audio"` - `"avatar"` - `"image"` - `"model"` - `"video"` - `ownerId: string` - `source: "civitai" or "huggingface" or "multipart" or 2 more` - `"civitai"` - `"huggingface"` - `"multipart"` - `"other"` - `"url"` - `status: "complete" or "failed" or "imported" or 3 more` - `"complete"` - `"failed"` - `"imported"` - `"pending"` - `"validated"` - `"validating"` - `updatedAt: string` - `assetOptions: optional object { collectionIds, hide, parentId }` - `collectionIds: optional array of string` The collection ids to add the asset to. - `hide: optional boolean` Specify if the asset should be hidden from the user. - `parentId: optional string` The parentId of the asset. - `config: optional unknown` - `contentType: optional string` - `entityId: optional string` - `errorMessage: optional string` - `fileSize: optional number` - `jobId: optional string` - `originalFileName: optional string` - `parts: optional array of object { expires, number, url }` - `expires: string` - `number: number` - `url: string` - `partsCount: optional number` - `provider: optional "civitai" or "huggingface" or "other"` - `"civitai"` - `"huggingface"` - `"other"` - `url: optional string` ### Example ```http curl https://api.cloud.scenario.com/v1/uploads \ -H 'Content-Type: application/json' \ -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \ -d '{}' ``` #### Response ```json { "upload": { "id": "id", "authorId": "authorId", "createdAt": "createdAt", "fileName": "fileName", "kind": "3d", "ownerId": "ownerId", "source": "civitai", "status": "complete", "updatedAt": "updatedAt", "assetOptions": { "collectionIds": [ "string" ], "hide": true, "parentId": "parentId" }, "config": {}, "contentType": "contentType", "entityId": "entityId", "errorMessage": "errorMessage", "fileSize": 0, "jobId": "jobId", "originalFileName": "originalFileName", "parts": [ { "expires": "expires", "number": 0, "url": "url" } ], "partsCount": 0, "provider": "civitai", "url": "url" } } ``` ## Retrieve **get** `/uploads/{uploadId}` Get the details of an existing upload ### Path Parameters - `uploadId: string` ### Returns - `upload: object { id, authorId, createdAt, 18 more }` - `id: string` - `authorId: string` - `createdAt: string` - `fileName: string` - `kind: "3d" or "asset" or "audio" or 4 more` The kind of the file once validated (example: "model") - `"3d"` - `"asset"` - `"audio"` - `"avatar"` - `"image"` - `"model"` - `"video"` - `ownerId: string` - `source: "civitai" or "huggingface" or "multipart" or 2 more` - `"civitai"` - `"huggingface"` - `"multipart"` - `"other"` - `"url"` - `status: "complete" or "failed" or "imported" or 3 more` - `"complete"` - `"failed"` - `"imported"` - `"pending"` - `"validated"` - `"validating"` - `updatedAt: string` - `assetOptions: optional object { collectionIds, hide, parentId }` - `collectionIds: optional array of string` The collection ids to add the asset to. - `hide: optional boolean` Specify if the asset should be hidden from the user. - `parentId: optional string` The parentId of the asset. - `config: optional unknown` - `contentType: optional string` - `entityId: optional string` - `errorMessage: optional string` - `fileSize: optional number` - `jobId: optional string` - `originalFileName: optional string` - `parts: optional array of object { expires, number, url }` - `expires: string` - `number: number` - `url: string` - `partsCount: optional number` - `provider: optional "civitai" or "huggingface" or "other"` - `"civitai"` - `"huggingface"` - `"other"` - `url: optional string` ### Example ```http curl https://api.cloud.scenario.com/v1/uploads/$UPLOAD_ID \ -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" ``` #### Response ```json { "upload": { "id": "id", "authorId": "authorId", "createdAt": "createdAt", "fileName": "fileName", "kind": "3d", "ownerId": "ownerId", "source": "civitai", "status": "complete", "updatedAt": "updatedAt", "assetOptions": { "collectionIds": [ "string" ], "hide": true, "parentId": "parentId" }, "config": {}, "contentType": "contentType", "entityId": "entityId", "errorMessage": "errorMessage", "fileSize": 0, "jobId": "jobId", "originalFileName": "originalFileName", "parts": [ { "expires": "expires", "number": 0, "url": "url" } ], "partsCount": 0, "provider": "civitai", "url": "url" } } ``` ## Trigger Action **post** `/uploads/{uploadId}/action` Trigger an action on upload ### Path Parameters - `uploadId: string` ### Body Parameters - `action: "complete"` The action to perform on an upload, currently only "upload-complete" is supported - `"complete"` ### Returns - `upload: object { id, authorId, createdAt, 18 more }` - `id: string` - `authorId: string` - `createdAt: string` - `fileName: string` - `kind: "3d" or "asset" or "audio" or 4 more` The kind of the file once validated (example: "model") - `"3d"` - `"asset"` - `"audio"` - `"avatar"` - `"image"` - `"model"` - `"video"` - `ownerId: string` - `source: "civitai" or "huggingface" or "multipart" or 2 more` - `"civitai"` - `"huggingface"` - `"multipart"` - `"other"` - `"url"` - `status: "complete" or "failed" or "imported" or 3 more` - `"complete"` - `"failed"` - `"imported"` - `"pending"` - `"validated"` - `"validating"` - `updatedAt: string` - `assetOptions: optional object { collectionIds, hide, parentId }` - `collectionIds: optional array of string` The collection ids to add the asset to. - `hide: optional boolean` Specify if the asset should be hidden from the user. - `parentId: optional string` The parentId of the asset. - `config: optional unknown` - `contentType: optional string` - `entityId: optional string` - `errorMessage: optional string` - `fileSize: optional number` - `jobId: optional string` - `originalFileName: optional string` - `parts: optional array of object { expires, number, url }` - `expires: string` - `number: number` - `url: string` - `partsCount: optional number` - `provider: optional "civitai" or "huggingface" or "other"` - `"civitai"` - `"huggingface"` - `"other"` - `url: optional string` ### Example ```http curl https://api.cloud.scenario.com/v1/uploads/$UPLOAD_ID/action \ -H 'Content-Type: application/json' \ -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \ -d '{ "action": "complete" }' ``` #### Response ```json { "upload": { "id": "id", "authorId": "authorId", "createdAt": "createdAt", "fileName": "fileName", "kind": "3d", "ownerId": "ownerId", "source": "civitai", "status": "complete", "updatedAt": "updatedAt", "assetOptions": { "collectionIds": [ "string" ], "hide": true, "parentId": "parentId" }, "config": {}, "contentType": "contentType", "entityId": "entityId", "errorMessage": "errorMessage", "fileSize": 0, "jobId": "jobId", "originalFileName": "originalFileName", "parts": [ { "expires": "expires", "number": 0, "url": "url" } ], "partsCount": 0, "provider": "civitai", "url": "url" } } ``` ## Domain Types ### Upload Create Response - `UploadCreateResponse object { upload }` - `upload: object { id, authorId, createdAt, 18 more }` - `id: string` - `authorId: string` - `createdAt: string` - `fileName: string` - `kind: "3d" or "asset" or "audio" or 4 more` The kind of the file once validated (example: "model") - `"3d"` - `"asset"` - `"audio"` - `"avatar"` - `"image"` - `"model"` - `"video"` - `ownerId: string` - `source: "civitai" or "huggingface" or "multipart" or 2 more` - `"civitai"` - `"huggingface"` - `"multipart"` - `"other"` - `"url"` - `status: "complete" or "failed" or "imported" or 3 more` - `"complete"` - `"failed"` - `"imported"` - `"pending"` - `"validated"` - `"validating"` - `updatedAt: string` - `assetOptions: optional object { collectionIds, hide, parentId }` - `collectionIds: optional array of string` The collection ids to add the asset to. - `hide: optional boolean` Specify if the asset should be hidden from the user. - `parentId: optional string` The parentId of the asset. - `config: optional unknown` - `contentType: optional string` - `entityId: optional string` - `errorMessage: optional string` - `fileSize: optional number` - `jobId: optional string` - `originalFileName: optional string` - `parts: optional array of object { expires, number, url }` - `expires: string` - `number: number` - `url: string` - `partsCount: optional number` - `provider: optional "civitai" or "huggingface" or "other"` - `"civitai"` - `"huggingface"` - `"other"` - `url: optional string` ### Upload Retrieve Response - `UploadRetrieveResponse object { upload }` - `upload: object { id, authorId, createdAt, 18 more }` - `id: string` - `authorId: string` - `createdAt: string` - `fileName: string` - `kind: "3d" or "asset" or "audio" or 4 more` The kind of the file once validated (example: "model") - `"3d"` - `"asset"` - `"audio"` - `"avatar"` - `"image"` - `"model"` - `"video"` - `ownerId: string` - `source: "civitai" or "huggingface" or "multipart" or 2 more` - `"civitai"` - `"huggingface"` - `"multipart"` - `"other"` - `"url"` - `status: "complete" or "failed" or "imported" or 3 more` - `"complete"` - `"failed"` - `"imported"` - `"pending"` - `"validated"` - `"validating"` - `updatedAt: string` - `assetOptions: optional object { collectionIds, hide, parentId }` - `collectionIds: optional array of string` The collection ids to add the asset to. - `hide: optional boolean` Specify if the asset should be hidden from the user. - `parentId: optional string` The parentId of the asset. - `config: optional unknown` - `contentType: optional string` - `entityId: optional string` - `errorMessage: optional string` - `fileSize: optional number` - `jobId: optional string` - `originalFileName: optional string` - `parts: optional array of object { expires, number, url }` - `expires: string` - `number: number` - `url: string` - `partsCount: optional number` - `provider: optional "civitai" or "huggingface" or "other"` - `"civitai"` - `"huggingface"` - `"other"` - `url: optional string` ### Upload Trigger Action Response - `UploadTriggerActionResponse object { upload }` - `upload: object { id, authorId, createdAt, 18 more }` - `id: string` - `authorId: string` - `createdAt: string` - `fileName: string` - `kind: "3d" or "asset" or "audio" or 4 more` The kind of the file once validated (example: "model") - `"3d"` - `"asset"` - `"audio"` - `"avatar"` - `"image"` - `"model"` - `"video"` - `ownerId: string` - `source: "civitai" or "huggingface" or "multipart" or 2 more` - `"civitai"` - `"huggingface"` - `"multipart"` - `"other"` - `"url"` - `status: "complete" or "failed" or "imported" or 3 more` - `"complete"` - `"failed"` - `"imported"` - `"pending"` - `"validated"` - `"validating"` - `updatedAt: string` - `assetOptions: optional object { collectionIds, hide, parentId }` - `collectionIds: optional array of string` The collection ids to add the asset to. - `hide: optional boolean` Specify if the asset should be hidden from the user. - `parentId: optional string` The parentId of the asset. - `config: optional unknown` - `contentType: optional string` - `entityId: optional string` - `errorMessage: optional string` - `fileSize: optional number` - `jobId: optional string` - `originalFileName: optional string` - `parts: optional array of object { expires, number, url }` - `expires: string` - `number: number` - `url: string` - `partsCount: optional number` - `provider: optional "civitai" or "huggingface" or "other"` - `"civitai"` - `"huggingface"` - `"other"` - `url: optional string`