Imports an external image, video, or audio URL into the team asset library (e.g. before starting a process). Pass sessionId to create it inside a session. Importing an image the team already imported (identical file) returns that existing asset, with its original name, instead of a copy; with sessionId it is added to the session. Spends no credits. Download failures return 400 with code import_failed.
Authorization
bearerAuth assets:writeIn: header
Scope: assets:write
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/assets/import" \ -H "Content-Type: application/json" \ -d '{ "type": "image", "url": "http://example.com" }'{ "id": "string", "type": "image", "name": "string", "url": "http://example.com", "thumbnailUrl": "http://example.com", "preview": { "url": "http://example.com", "width": 0, "height": 0, "mimeType": "string" }, "width": 0, "height": 0, "duration": 0, "mimeType": "string", "source": "string", "sourceProcessId": "string", "trainingId": "string", "draft": { "finishableUntil": "2019-08-24T14:15:22Z" }, "favorite": true, "sessionId": "string", "createdAt": "2019-08-24T14:15:22Z", "links": { "self": "string" }}{ "error": { "code": "string", "message": "string", "requestId": "string" }}{ "error": { "code": "string", "message": "string", "requestId": "string" }}{ "error": { "code": "string", "message": "string", "requestId": "string" }}{ "error": { "code": "string", "message": "string", "requestId": "string" }}Read a workspace item by path GET
Reads one workspace item. A folder returns its direct children; a text document returns its text a page at a time (pass nextOffset as offset for the rest); another uploaded file returns its name, type, size and download URL; an image, video or audio item returns its asset, shaped like GET /assets/{assetId}. Only item is returned when the backing record is gone. Addresses the item by its path; /workspace/nodes/{nodeId} does the same by id. Uses the processes:read scope.
List assets GET
Lists normalized team assets, newest first. type is required. V1 supports at most one of processType, source, model, tool, genType, or sessionId per request (unsupported combinations return unsupported_filter_combination); favorite composes with any of them.