---
title: "Edit Video"
method: POST
path: "/edit"
tags: ["Edit"]
---

# Edit Video

`POST /edit`

## Request

- Base URL: `https://video-api.picsart.io/v1`
- URL: `https://video-api.picsart.io/v1/edit`
- Auth: API key in header `X-Picsart-API-Key`

Comprehensive editing with one operation. Apply effect, adjust, trim, crop, resize, change codecs, compression, framerates, etc.
To re-encode a video into a different container, codec, frame rate or bitrate while leaving the picture itself untouched, send only the video source and an `export` object, omitting the other parameters. For example, `{"video_url": "https://example.com/input.mov", "export": {"format": "MP4", "codec": "h264", "audio_codec": "aac", "bitrate": 4000, "frame_rate": 30}}` re-encodes the input as an H.264 MP4 at 4000 kb/s and 30 fps. Keep either stream as it is by leaving `codec` or `audio_codec` at `default`, and leave `bitrate` empty to let the service pick an optimal value.

## Request body

- object
  - `video_url` string, uri: Source video URL.
  - `fit` FitParameters
    - `ratio` number, float, nullable: The value should be a single floating point number which represents the ratio of width and height. The formula is: parameter value = width / height. The default value is that of the original video.
    - `width` integer, nullable: Width of the outcome video. If the new width is larger than the original width, the blurry mirror effect should be applied to the additional part. The measurement unit is px. The default value is the original width. Value must be at least 16 px.
    - `height` integer, nullable: Height of the outcome video. If the new height is larger than the original height, the blurry mirror effect should be applied to the additional part. The measurement unit is px. The default value is the original height. Value must be at least 16 px.
    - `bg_color` string, nullable: Can be a hexcolor code (e.g., #82d5fa, #fff) or a color name (e.g., blue). For semi-transparency, 4-/8-digit hexcodes are also supported (e.g., #18d4ff87). (If this parameter is present, the other bg_ parameters must be empty).
    - `bg_blur` integer: Enter an integer value from 0 to 100.
    - `bg_image_url` string, uri: Background image URL.
    - `bg_video_url` string, uri: Background video URL.
  - `crop` CropParameters
    - `width` integer: Width of the outcome video. If the new width is larger than the original width, the blurry mirror effect should be applied to the additional part. The measurement unit is px. The default value is the original width. Value must be at least 16 px.
    - `height` integer: Height of the output video. If the new height is larger than the original height, the blurry mirror effect should be applied to the additional part. The measurement unit is px. The default value is the original height. Value must be at least 16 px.
    - `start_x` integer: The starting x location of the crop in px as measured from the left edge.
    - `start_y` integer: The starting y location of the crop in px as measured from the bottom edge.
  - `export` object
    - `format` 'MOV' | 'MP4' | 'WEBM' | 'GIF': Optionally select one of the output video formats (MP4 is chosen if left blank). Container options are as follows * MOV * MP4 * WEBM * GIF
    - `max_size_mb` integer, nullable: The maximum target size in megabytes (not strict).
    - `quality` 'low' | 'medium' | 'high': The quality of the output video. You can choose from low, medium or high quality outputs. By default medium is applied.
    - `codec` 'default' | 'HEVC' | 'h264' | 'theora' | 'vp8' | 'vp9' | 'gif' | 'av1' | 'cinepak' | 'ffv1' | 'MPEG4' | 'vc2': The video codec. Use "default" to keep the video codec the same.
    - `audio_codec` 'default' | 'aac' | 'ac3' | 'opus' | 'mp3' | 'ogg_vorbis' | 'ogg_speex' | 'wav' | 'flac' | 'PCM': The audio codec. Use "default" to keep the video codec the same.
    - `frame_rate` integer: The output video frame rate.
    - `bitrate` integer: The output video bitrate in kb/s. Leave empty to set automatically and optimize accordingly.
    - `color_space` 'SRGB' | 'DisplayP3': The color space of the output video.

## Response `202`

Request successfully accepted for an asynchronous transformation.

- object
  - `transaction_id` string, nullable
  - `status` 'success' | 'error' | 'processing' | 'queued'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `413`: Request Entity Too Large
- `415`: Unsupported Media Type
- `429`: Too Many Requests
- `431`: Request Header Fields Too Large
- `500`: Internal Server Error
- `503`: Service Unavailable
- `529`: Overloaded. The model provider is overloaded and could not complete this request. Please retry shortly, or switch to a different model.

---

[API](https://skmtc.dev/picsart/apis/picsart-programmable-video-apis.md) - [All operations](https://skmtc.dev/picsart/apis/picsart-programmable-video-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/picsart/apis/picsart-programmable-video-apis/revisions/e3f1d0bea43b?raw)
