Yapper API
Api reference
POST
/assets/import

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:write
AuthorizationBearer <token>

In: 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"  }}