Api referenceUploads

Upload a file

Upload a file with a single request and create an asset immediately. Send the file bytes as the raw request body. Set `Content-Type` to the file MIME type and `x-file-name` to the original filename. When `x-project-id` is provided, the created asset is also bound to that project.

POST
/v1/uploads

Upload a file with a single request and create an asset immediately. Send the file bytes as the raw request body. Set Content-Type to the file MIME type and x-file-name to the original filename. When x-project-id is provided, the created asset is also bound to that project.

Authorization

ApiKeyAuth
x-api-key<token>

Enter your API key manually in the interactive docs playground. The value is stored only in the current browser and is not injected from server environment variables.

In: header

Header Parameters

x-file-name*string

Original filename for the uploaded file.

Length1 <= length <= 512
x-project-id?string

Optional project to bind the created asset to.

Formatuuid

Request Body

application/octet-stream

body*file
Formatbinary

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.indream.ai/v1/uploads" \  -H "x-file-name: string" \  -H "Content-Type: application/octet-stream" \  -d 'string'
{
  "data": {
    "assetId": "9179b887-04ef-4ce5-ab3a-b5bbd39ea3c8",
    "type": "string",
    "source": "string",
    "filename": "string",
    "mimetype": "string",
    "size": 0,
    "fileUrl": "string",
    "fileKey": "string",
    "width": 0,
    "height": 0,
    "duration": 0
  },
  "meta": {}
}
{
  "type": "FORBIDDEN",
  "title": "Forbidden",
  "status": 403,
  "detail": "The current account is not eligible for this Open API route",
  "errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}
{
  "type": "FORBIDDEN",
  "title": "Forbidden",
  "status": 403,
  "detail": "The current account is not eligible for this Open API route",
  "errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}
{
  "type": "FORBIDDEN",
  "title": "Forbidden",
  "status": 403,
  "detail": "The current account is not eligible for this Open API route",
  "errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}
{
  "type": "FORBIDDEN",
  "title": "Forbidden",
  "status": 403,
  "detail": "The current account is not eligible for this Open API route",
  "errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}