RecoupGet a free auditFree audit

API REFERENCE

Edit Content

On this page
PATCH/api/content

Apply ffmpeg edits to a video — trim, crop, resize, or overlay text. Pass a template for a preset edit pipeline, or build your own with an operations array.

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
curl --request PATCH \
  --url 'https://api.recoupable.dev/api/content' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "video_url": "string"
}'

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request PATCH \
  --url 'https://recoup-api.vercel.app/api/content' \
  --header 'Content-Type: application/json' \
  --data '{
  "video_url": "string"
}'

Request body required

Edit parameters

application/json

video_urlstringrequired

Input video URL (required)

format: uri

templatestring

Template name for deterministic edit config. If provided, operations are read from the template. See GET /api/content/templates for available options.

operationsarray<object>

Array of edit operations to apply in order. Required if template is not provided.

Item properties for operations
typestring · enumrequired

Operation type

Values: "trim", "crop", "resize", "overlay_text"

startnumber

Start time in seconds (trim)

durationnumber

Duration in seconds (trim)

aspectstring

Aspect ratio e.g. 9:16 (crop)

widthinteger

Width in pixels (crop/resize)

heightinteger

Height in pixels (crop/resize)

contentstring

Text content (overlay_text)

fontstring

Font name (overlay_text)

colorstring

Text color (overlay_text)

stroke_colorstring

Text stroke color (overlay_text)

max_font_sizenumber

Maximum font size (overlay_text)

positionstring · enum

Text position (overlay_text)

Values: "top", "center", "bottom"

output_formatstring · enum

Output format

Values: "mp4", "webm", "mov"

Default: "mp4"

Responses

202Edit task triggered successfully. Poll via GET /api/tasks/runs using the returned runId.

application/json

runIdstringrequired

Background task run ID. Poll via GET /api/tasks/runs to check progress.

statusstring · enumrequired

Status of the edit task

Values: "triggered"

400Validation failed — invalid or missing request body fields

application/json

errorstringrequired

Error message describing what went wrong

401Unauthorized — invalid or missing API key

application/json

errorstringrequired

Error message describing what went wrong

500Internal server error

application/json

errorstringrequired

Error message describing what went wrong

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "description": "Apply ffmpeg edits to a video — trim, crop, resize, or overlay text. Pass a `template` for a preset edit pipeline, or build your own with an `operations` array.",
  "security": [
    {
      "apiKeyAuth": []
    },
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "description": "Edit parameters",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ContentCreateEditRequest"
        }
      }
    }
  },
  "responses": {
    "202": {
      "description": "Edit task triggered successfully. Poll via [GET /api/tasks/runs](/api-reference/tasks/runs) using the returned `runId`.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ContentCreateEditResponse"
          }
        }
      }
    },
    "400": {
      "description": "Validation failed — invalid or missing request body fields",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ContentErrorResponse"
          }
        }
      }
    },
    "401": {
      "description": "Unauthorized — invalid or missing API key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ContentErrorResponse"
          }
        }
      }
    },
    "500": {
      "description": "Internal server error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ContentErrorResponse"
          }
        }
      }
    }
  }
}