The S3 Copy Endpoint allows you to copy your videos in Amazon S3 directly into Wistia using the internal S3 Copy operation. This is a slightly more efficient alternative to uploading via an external url. In order to use this endpoint, you need to work with Wistia on some prerequisite setup to enable the correct IAM permissions between your bucket and Wistia.

๐Ÿšง

Note

S3 Copy is only available for accounts on the Premium Plan at this time. Reach out to your Customer Success Manager or Wistia Support to get started!

Setup

For the setup process, please reach out to Wistia support and we'd be happy to both provide you with the additional information you need and add your bucket information on our side.

Your S3 Bucket

You need to grant read-only access to your bucket via an IAM policy to Wistiaโ€™s account in AWS. Wistia will provide the account number. It needs to have GetObject permissions and GetObjectVersion permissions for any object you wish to copy. Hereโ€™s a sample of what that that bucket policy would look like if it granted permission to all objects in your bucket:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "External Wistia Permissions",
            "Effect": "Allow",
            "Principal": {
                "AWS": <wistia-account-number>
            },
            "Action": [
                "s3:GetObject",
                "s3:GetObjectVersion"
            ],
            "Resource": [
                "<your bucket>",
                "<your bucket>/*"
            ]
        }
    ]
}

Wistia's Receiving S3 Bucket

Wistia needs to add permissions within our own account to copy from your bucket. You must provide Wistia with the ARN for your S3 bucket so that we can add it to the IAM policy for our receiving bucket.

Endpoint and Parameters

The endpoint is upload.wistia.com/s3_copy. It requires Wistia authorization headers the same way as the regular upload API. It has two required parameters:

  • bucket which must be only the bucket name, no additional characters and strictly the name, not the ARN.
  • source_file for the path to the object within the bucket. Do not provide a / at the beginning of the source file path.

An example set of required parameters would look like this: bucket=my-bucket and source_file=videos/dog-videos/lenny.mp4.

The endpoint also accepts the same optional parameters as the Upload API . Those parameters are project_id, name, description, and contact_id.

Example Using cURL

$ curl -i -H "Authorization: Bearer YOUR_TOKEN_HERE" -d "bucket=\<YOUR_BUCKET>" -d "source_file=\<YOUR_SOURCE_FILE_PATH>" <https://upload.wistia.com/s3_copy