Skip to main content
POST
/
v1
/
project
/
create
/
remove-background
Remove Background
curl --request POST \
  --url https://b8e35428b2f8.ngrok-free.app/api/v1/project/create/remove-background \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "media": {
    "id": "video_01",
    "url": "https://your-cdn.com/video.mp4"
  }
}
'
{
  "success": true,
  "data": {
    "videoId": "vid_rbg_abc123xyz",
    "projectId": "proj_rbg_abc123xyz",
    "status": "STARTED"
  },
  "message": "Remove Background successfully created"
}
Try it out! Use the API playground on the right to test the Remove Background endpoint directly.

Overview

Remove Background automatically removes the background from your videos, creating a transparent background effect. Perfect for:
  • Product videos
  • Talking head videos
  • Social media content
  • Professional presentations
  • Green screen replacements
The API processes your video and returns a clean version with the background removed, ready to overlay on any content.

Endpoint

POST /v1/project/create/remove-background

Required Fields

media
object
required
Video to process

Request Example

const response = await fetch('https://api.tryhooked.ai/v1/project/create/remove-background', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    media: {
      id: 'video_01',
      url: 'https://your-cdn.com/video.mp4'
    },
    webhook: 'https://yoursite.com/webhook',
    metadata: {
      campaignId: 'summer-launch-2024',
      variant: 'A',
      createdBy: 'marketing-automation'
    }
  })
});

const data = await response.json();
console.log('Video ID:', data.data.videoId);
console.log('Project ID:', data.data.projectId);

Response

{
  "success": true,
  "data": {
    "videoId": "vid_rbg_abc123xyz",
    "projectId": "proj_rbg_abc123xyz",
    "status": "STARTED"
  },
  "message": "Remove Background successfully created"
}

Webhook Notification

When your video is ready, we’ll POST to your webhook URL (if configured):
Webhook Payload
{
  "status": "COMPLETED",
  "data": {
    "videoId": "vid_rbg_abc123xyz",
    "status": "COMPLETED",
    "url": "https://cdn.tryhooked.ai/videos/abc123xyz.mp4",
    "shareUrl": "https://cdn.tryhooked.ai/shared/abc123xyz.mp4",
    "metadata": {
      "projectId": "proj_rbg_abc123xyz"
    }
  },
  "message": "Video completed"
}

Best Practices

Video Quality

Use high-quality source videos for best background removal results.

Good Lighting

Videos with good lighting and clear subject separation work best.

Avoid Motion Blur

Sharper videos work better for background removal.

Clear Separation

Ensure good contrast between subject and background.

Error Handling

ErrorDescriptionSolution
media: Video is requiredMissing media objectProvide a video media object with id and url
media: Video not foundMedia ID doesn’t exist in your accountEnsure the media ID is correct and belongs to your team
media: Media must be a video fileMedia is not a video typeProvide a video file, not an image
url: Must be a valid HTTPS URLInvalid video URLEnsure URL starts with https://
Not enough creditsInsufficient creditsTop up your account credits

Next Steps

Authorizations

x-api-key
string
header
required

Body

application/json
media
object
required

Video to process

Response

Remove Background created successfully

success
boolean
data
object
message
string