---
updatedAt: 2026-04-20T20:24:39.000Z
agentTools:
  projectIndex: https://docs.wistia.com/llms.txt
---

# Upload or Import Media

Endpoint to upload media files from a local system or import from a web URL.

- Use `multipart/form-data` with a `file` parameter to upload from local system
- Use `application/x-www-form-urlencoded` with a `url` parameter to import from web URL


# OpenAPI definition

```json
{
  "openapi": "3.1.1",
  "info": {
    "title": "Upload API",
    "version": "1.0.0"
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/": {
      "servers": [
        {
          "url": "https://upload.wistia.com"
        }
      ],
      "post": {
        "summary": "Upload or Import Media",
        "description": "Endpoint to upload media files from a local system or import from a web URL.\n\n- Use `multipart/form-data` with a `file` parameter to upload from local system\n- Use `application/x-www-form-urlencoded` with a `url` parameter to import from web URL\n",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "project_id": {
                        "description": "The hashed id of the project to upload media into.",
                        "type": "string"
                      },
                      "name": {
                        "description": "A display name to use for the media in Wistia.",
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "description": "A description to use for the media in Wistia.",
                        "type": "string"
                      },
                      "contact_id": {
                        "description": "A Wistia contact id.",
                        "type": "integer"
                      },
                      "access_token": {
                        "description": "A 64 character hex string. This parameter can be found on your API access page OR can be the token you received from authenticating via Oauth2. Note this approach is legacy and discouraged. We recommend using Bearer Token authentication.",
                        "type": "string",
                        "deprecated": true
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "url"
                    ],
                    "properties": {
                      "url": {
                        "description": "The publicly accessible web location of the media file to import.",
                        "type": "string",
                        "format": "uri",
                        "examples": [
                          "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
                        ]
                      },
                      "low_priority": {
                        "description": "Inform the encoding service that this upload can be considered lower priority than others. This is especially useful for platform customers doing bulk uploads or migrations. Setting this to \"false\" has no effect.",
                        "type": "boolean",
                        "examples": [
                          true
                        ]
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "project_id": {
                        "description": "The hashed id of the project to upload media into.",
                        "type": "string"
                      },
                      "name": {
                        "description": "A display name to use for the media in Wistia.",
                        "type": "string",
                        "maxLength": 255
                      },
                      "description": {
                        "description": "A description to use for the media in Wistia.",
                        "type": "string"
                      },
                      "contact_id": {
                        "description": "A Wistia contact id.",
                        "type": "integer"
                      },
                      "access_token": {
                        "description": "A 64 character hex string. This parameter can be found on your API access page OR can be the token you received from authenticating via Oauth2. Note this approach is legacy and discouraged. We recommend using Bearer Token authentication.",
                        "type": "string",
                        "deprecated": true
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "file"
                    ],
                    "properties": {
                      "file": {
                        "description": "The media file, multipart-form encoded into the request body.",
                        "type": "string",
                        "format": "binary"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully uploaded or imported.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Response after successfully uploading or importing media",
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "A unique numeric identifier for the media within the system.",
                      "type": "integer"
                    },
                    "name": {
                      "description": "The display name of the media.",
                      "type": "string"
                    },
                    "type": {
                      "description": "A string representing what type of media this is.",
                      "type": "string"
                    },
                    "created": {
                      "description": "The date when the media was originally uploaded.",
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated": {
                      "description": "The date when the media was last changed.",
                      "type": "string",
                      "format": "date-time"
                    },
                    "duration": {
                      "description": "Specifies the length (in seconds) for audio and video files.",
                      "type": "number"
                    },
                    "hashed_id": {
                      "description": "A unique alphanumeric identifier for this media.",
                      "type": "string"
                    },
                    "progress": {
                      "description": "A floating point value between 0 and 1 that indicates the progress of the processing for this file.",
                      "type": "number",
                      "maximum": 1,
                      "minimum": 0
                    },
                    "thumbnail": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "width": {
                          "type": "integer"
                        },
                        "height": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error due to reaching the video limit of your account or other issues.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "detail": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "missing_credentials": {
                    "value": {
                      "code": "upload_failed",
                      "detail": "'api_password' or 'access_token' are required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization error. Check your access_token.",
            "content": {
              "text/html": {}
            }
          }
        },
        "tags": [
          "Upload or Import Media"
        ],
        "x-readme": {
          "code-samples": [
            {
              "name": "Typescript (SDK)",
              "language": "javascript",
              "code": "import { Wistia } from \"@wistia/wistia-api-client\";\n\nconst wistia = new Wistia({\n  bearerAuth: process.env[\"WISTIA_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await wistia.uploadOrImportMedia.postForm({\n    url: \"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4\",\n    lowPriority: true,\n  });\n\n  console.log(result);\n}\n\nrun();"
            },
            {
              "name": "Typescript (SDK)",
              "language": "javascript",
              "code": "import { Wistia } from \"@wistia/wistia-api-client\";\nimport { openAsBlob } from \"node:fs\";\n\nconst wistia = new Wistia({\n  bearerAuth: process.env[\"WISTIA_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await wistia.uploadOrImportMedia.postMultipart({\n    file: await openAsBlob(\"example.file\"),\n  });\n\n  console.log(result);\n}\n\nrun();"
            }
          ]
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-readme": {
    "samples-languages": [
      "javascript",
      "shell",
      "node",
      "python",
      "ruby"
    ]
  }
}
```