---
updatedAt: 2026-05-23T22:14:03.000Z
agentTools:
  projectIndex: https://docs.telemetrytv.com/llms.txt
---

# Upload a content file

Accepts a multipart file upload, detects its type, optionally converts/resizes it, stores it in S3, and creates (or replaces) a content record. Processing runs asynchronously by default; pass `?wait=true` to block until done.


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Upload Service",
    "version": "1.0.0"
  },
  "paths": {
    "/content_uploads": {
      "post": {
        "summary": "Upload a content file",
        "description": "Accepts a multipart file upload, detects its type, optionally converts/resizes it, stores it in S3, and creates (or replaces) a content record. Processing runs asynchronously by default; pass `?wait=true` to block until done.\n",
        "tags": [
          "Upload"
        ],
        "parameters": [
          {
            "name": "wait",
            "in": "query",
            "description": "Block until processing completes and return the created content object(s).",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "`Token <token>` or `Bearer <token>`. Alternatively pass `?token=` as a query param.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Token abc123"
            }
          },
          {
            "name": "REQUEST-ID",
            "in": "header",
            "description": "Optional idempotency / tracing identifier.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file to upload. Max 1 GB overall; images additionally capped at 20 MB and 16 000 x 16 000 px (auto-resized to 4 096 x 4 096 if exceeded). Type is detected from magic bytes, falling back to file extension. Supported types: png, jpg, gif, svg, mp4, webm, ogg, mov, avi, pdf, ppt, pptx, doc, docx, xls, xlsx, vtt, srt, zip. No Content-Type header validation is performed.\n"
                  },
                  "filename": {
                    "type": "string",
                    "description": "Override the uploaded file's name. Falls back to the multipart filename."
                  },
                  "folder_id": {
                    "type": "string",
                    "description": "MongoDB ObjectID of the destination media folder."
                  },
                  "upload_state": {
                    "type": "string",
                    "enum": [
                      "upload",
                      "replace"
                    ],
                    "default": "upload",
                    "description": "`upload` creates a new content record; `replace` updates an existing one."
                  },
                  "content_id": {
                    "type": "string",
                    "description": "Required when `upload_state=replace`. MongoDB ObjectID of the content to replace."
                  },
                  "filesync_id": {
                    "type": "string",
                    "description": "ID of the associated filesync entry."
                  },
                  "replaced_file_name": {
                    "type": "string",
                    "description": "Original filename of the content being replaced."
                  },
                  "replaced_file_s3_path": {
                    "type": "string",
                    "description": "S3 path of the file being replaced."
                  },
                  "google_drive_id": {
                    "type": "string",
                    "description": "Google Drive file ID, when the source originates from Google Drive."
                  },
                  "google_email": {
                    "type": "string",
                    "description": "Google account email associated with the Drive source."
                  },
                  "canva": {
                    "type": "boolean",
                    "description": "Set to `true` when the file originates from a Canva export."
                  },
                  "canva_design_id": {
                    "type": "string",
                    "description": "Canva design ID."
                  },
                  "canva_export_url": {
                    "type": "string",
                    "description": "Canva export URL."
                  },
                  "owner_page_id": {
                    "type": "string",
                    "description": "Page ID that owns this content (e.g. for webshot content)."
                  },
                  "hidden": {
                    "type": "boolean",
                    "default": false,
                    "description": "If `true`, the created content record is hidden from the media library (e.g. subtitles)."
                  },
                  "prompt_id": {
                    "type": "string",
                    "description": "AI prompt ID that triggered this upload."
                  },
                  "webshot": {
                    "type": "object",
                    "description": "Webshot metadata. Only relevant when content originates from a web screenshot.",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      },
                      "width": {
                        "type": "number"
                      },
                      "height": {
                        "type": "number"
                      },
                      "scroll_x": {
                        "type": "number"
                      },
                      "scroll_y": {
                        "type": "number"
                      },
                      "zoom": {
                        "type": "number"
                      },
                      "refresh": {
                        "type": "number"
                      },
                      "delay": {
                        "type": "number"
                      },
                      "preload_script": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "action": {
                              "type": "string"
                            },
                            "target": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "scroll_x": {
                              "type": "number"
                            },
                            "scroll_y": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload accepted (or completed when `wait=true`). When `wait=false` returns a Process object. When `wait=true` returns an array of content objects.\n",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Process"
                    },
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContentResult"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request — malformed form data, or image exceeds the 20 MB size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token."
          },
          "402": {
            "description": "Video uploads require a plan upgrade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated user lacks the required media upload permission."
          },
          "415": {
            "description": "Unsupported file type detected from magic bytes / extension."
          },
          "500": {
            "description": "Internal server error during upload processing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "errors": [
            "Image size should be less than 20MB"
          ]
        }
      },
      "Meta": {
        "type": "object",
        "properties": {
          "Key": {
            "type": "string",
            "description": "S3 object key."
          },
          "LastModified": {
            "type": "string"
          },
          "ETag": {
            "type": "string"
          },
          "Size": {
            "type": "integer",
            "format": "int64",
            "description": "File size in bytes."
          }
        }
      },
      "ContentResult": {
        "type": "object",
        "description": "Uploaded content record returned when `wait=true`.",
        "properties": {
          "mime_type": {
            "type": "string",
            "example": "image/jpeg"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "description": "EXIF/ffmetadata description extracted from the file."
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          },
          "thumb_public_url": {
            "type": "string",
            "format": "uri"
          },
          "content_s3_key": {
            "type": "string"
          },
          "content_s3_keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present for multi-slide content (e.g. PDF converted to images)."
          },
          "public_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "Present for multi-slide content."
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "metas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Meta"
            },
            "description": "Present for multi-slide content."
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "slides": {
            "type": "boolean",
            "description": "True if the content was split into multiple slides (e.g. multi-page PDF)."
          },
          "transcoded": {
            "type": "boolean",
            "description": "True if a video was transcoded to MP4."
          },
          "transcoded_at": {
            "type": "string",
            "format": "date-time"
          },
          "length": {
            "type": "number",
            "format": "float",
            "description": "Video duration in seconds."
          },
          "filesync_id": {
            "type": "string"
          },
          "prompt_id": {
            "type": "string"
          }
        }
      },
      "Process": {
        "type": "object",
        "description": "Process tracking record returned immediately when `wait=false`.",
        "properties": {
          "id": {
            "type": "string",
            "description": "MongoDB ObjectID of the process."
          },
          "account_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "upload_state": {
            "type": "string",
            "enum": [
              "upload",
              "replace"
            ]
          },
          "folder_id": {
            "type": "string"
          },
          "content_id": {
            "type": "string"
          },
          "hash": {
            "type": "string",
            "description": "MD5 hash of the uploaded file."
          },
          "hidden": {
            "type": "boolean"
          },
          "canva": {
            "type": "boolean"
          },
          "prompt_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://upload.telemetrytv.com"
    }
  ],
  "x-readme": {}
}
```