> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://customerhub.com/api/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://customerhub.com/api/_mcp/server.

# Create Upload

POST https://api.customerhub.com/web_api/uploads
Content-Type: application/json

Register an uploaded file (after a Transloadit assembly completes) into the user's filebox.

**Authentication:** Required — Bearer token.

**Request body:**
- `file.name` (required), `file.size`, `file.type` (mime, drives the media class), `file.meta.fields.assembly_type` (optional override)
- `assembly.assembly_id` (required) — The Transloadit assembly ID
- `is_avatar_image` (optional, default false)
- `origin` (optional)

**Response:** `data` — The created upload. Status `201`.

**Errors:**
- `422` — Validation errors

Reference: https://customerhub.com/api/api-reference/uploads/create-upload

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an object.

- `file` (UploadsPostRequestBodyContentApplicationJsonSchemaFile, optional)
- `assembly` (UploadsPostRequestBodyContentApplicationJsonSchemaAssembly, optional)
- `is_avatar_image` (boolean, optional)
- `origin` (string, optional)

## Response

### 201

Created

## Types

### UploadsPostRequestBodyContentApplicationJsonSchemaFile

- `name` (string, optional)
- `size` (integer, optional)
- `type` (string, optional)
- `meta` (UploadsPostRequestBodyContentApplicationJsonSchemaFileMeta, optional)

### UploadsPostRequestBodyContentApplicationJsonSchemaAssembly

- `assembly_id` (string, optional)

### UploadsPostRequestBodyContentApplicationJsonSchemaFileMeta

- `fields` (UploadsPostRequestBodyContentApplicationJsonSchemaFileMetaFields, optional)

### UploadsPostRequestBodyContentApplicationJsonSchemaFileMetaFields

- `assembly_type` (string, optional)

## Examples

**Request**

```json
{
  "file": {
    "name": "photo.jpg",
    "size": 34567,
    "type": "image/jpeg",
    "meta": {
      "fields": {
        "assembly_type": "image"
      }
    }
  },
  "assembly": {
    "assembly_id": "abc123"
  },
  "is_avatar_image": false,
  "origin": "filebox"
}
```

**Response**

```json
{
  "data": {
    "active_thumbnail_path": null,
    "created_at": "2026-06-30T11:00:00Z",
    "download_path": null,
    "downloadable": true,
    "id": 1002,
    "name": "photo.jpg",
    "original_filesize": 34567,
    "preview_path": null,
    "simple_id": 43,
    "status": "processing",
    "type": "image"
  }
}
```

**SDK Code**

```python Uploads_createUpload_example
import requests

url = "https://api.customerhub.com/web_api/uploads"

payload = {
    "file": {
        "name": "photo.jpg",
        "size": 34567,
        "type": "image/jpeg",
        "meta": { "fields": { "assembly_type": "image" } }
    },
    "assembly": { "assembly_id": "abc123" },
    "is_avatar_image": False,
    "origin": "filebox"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Uploads_createUpload_example
const url = 'https://api.customerhub.com/web_api/uploads';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"file":{"name":"photo.jpg","size":34567,"type":"image/jpeg","meta":{"fields":{"assembly_type":"image"}}},"assembly":{"assembly_id":"abc123"},"is_avatar_image":false,"origin":"filebox"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Uploads_createUpload_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.customerhub.com/web_api/uploads"

	payload := strings.NewReader("{\n  \"file\": {\n    \"name\": \"photo.jpg\",\n    \"size\": 34567,\n    \"type\": \"image/jpeg\",\n    \"meta\": {\n      \"fields\": {\n        \"assembly_type\": \"image\"\n      }\n    }\n  },\n  \"assembly\": {\n    \"assembly_id\": \"abc123\"\n  },\n  \"is_avatar_image\": false,\n  \"origin\": \"filebox\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Uploads_createUpload_example
require 'uri'
require 'net/http'

url = URI("https://api.customerhub.com/web_api/uploads")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"file\": {\n    \"name\": \"photo.jpg\",\n    \"size\": 34567,\n    \"type\": \"image/jpeg\",\n    \"meta\": {\n      \"fields\": {\n        \"assembly_type\": \"image\"\n      }\n    }\n  },\n  \"assembly\": {\n    \"assembly_id\": \"abc123\"\n  },\n  \"is_avatar_image\": false,\n  \"origin\": \"filebox\"\n}"

response = http.request(request)
puts response.read_body
```

```java Uploads_createUpload_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.customerhub.com/web_api/uploads")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"file\": {\n    \"name\": \"photo.jpg\",\n    \"size\": 34567,\n    \"type\": \"image/jpeg\",\n    \"meta\": {\n      \"fields\": {\n        \"assembly_type\": \"image\"\n      }\n    }\n  },\n  \"assembly\": {\n    \"assembly_id\": \"abc123\"\n  },\n  \"is_avatar_image\": false,\n  \"origin\": \"filebox\"\n}")
  .asString();
```

```php Uploads_createUpload_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.customerhub.com/web_api/uploads', [
  'body' => '{
  "file": {
    "name": "photo.jpg",
    "size": 34567,
    "type": "image/jpeg",
    "meta": {
      "fields": {
        "assembly_type": "image"
      }
    }
  },
  "assembly": {
    "assembly_id": "abc123"
  },
  "is_avatar_image": false,
  "origin": "filebox"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Uploads_createUpload_example
using RestSharp;

var client = new RestClient("https://api.customerhub.com/web_api/uploads");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"file\": {\n    \"name\": \"photo.jpg\",\n    \"size\": 34567,\n    \"type\": \"image/jpeg\",\n    \"meta\": {\n      \"fields\": {\n        \"assembly_type\": \"image\"\n      }\n    }\n  },\n  \"assembly\": {\n    \"assembly_id\": \"abc123\"\n  },\n  \"is_avatar_image\": false,\n  \"origin\": \"filebox\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Uploads_createUpload_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "file": [
    "name": "photo.jpg",
    "size": 34567,
    "type": "image/jpeg",
    "meta": ["fields": ["assembly_type": "image"]]
  ],
  "assembly": ["assembly_id": "abc123"],
  "is_avatar_image": false,
  "origin": "filebox"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.customerhub.com/web_api/uploads")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```