Skip to main content

Music Webhook Callbacks

Instead of polling the Query Music Detail endpoint, you can provide a callback_url when submitting music generation tasks to receive automatic notifications when generation completes.

How It Works

  1. Submit with callback URL: Include a callback_url parameter in your music generation request
  2. Task processing: Vidgo API processes your music generation task
  3. Receive notification: When the task status becomes finished or failed, Vidgo API sends a POST request to your callback URL
  4. Process result: Your server receives the complete task data including generated files

Callback Request

When a task completes, Vidgo API will send a POST request to your callback URL:

Request Headers

Request Body Structure

The files array content varies depending on which model created the task. See Response Fields below for details.

Response Fields (files data)

The files array content varies depending on which model created the task.

JSON Field Details

separate-vocals

separate_vocals fields:
  • vocal_url - URL to the extracted vocal track
  • instrumental_url - URL to the instrumental track

upload-and-separate-vocals

vocal_removal fields:
  • bass - URL to the bass track
  • drums - URL to the drums track
  • piano - URL to the piano track
  • guitar - URL to the guitar track
  • vocals - URL to the vocals track
  • other - URL to other audio elements

stem-split

stem_split fields:
  • backing_vocals_url - URL to backing vocals
  • bass_url - URL to bass track
  • brass_url - URL to brass instruments
  • drums_url - URL to drums track
  • fx_url - URL to sound effects
  • guitar_url - URL to guitar track
  • keyboard_url - URL to keyboard track
  • percussion_url - URL to percussion track
  • strings_url - URL to strings track
  • synth_url - URL to synthesizer track
  • vocal_url - URL to main vocals
  • woodwinds_url - URL to woodwinds track

generate-music-cover

generate_cover is a JSON array containing cover image objects:
  • file_url - URL to the generated cover image
  • file_type - File type (e.g., “image”)

Callback Examples

Music Generation (generate-music, extend-music, etc.)

Timestamped Lyrics (get-timestamped-lyrics)

Generated Lyrics (generate-lyrics)

Music Style Enhancement (boost-music-style)

WAV Conversion (convert-to-wav)

Vocal Separation (separate-vocals)

Upload & Separate Vocals (upload-and-separate-vocals)

Stem Split (stem-split)

Music Cover Image (generate-music-cover)

Generated Persona (generate-persona)

Music Video (create-music-video)

Failed Task

Requirements

Your callback endpoint must meet the following requirements:
  • HTTPS only: Must use HTTPS protocol (HTTP not supported)
  • Maximum URL length: 2048 characters
  • Response timeout: Must respond within 10 seconds
  • Success response: Should return HTTP 200-299 status code
  • No internal IPs: Cannot use private/internal IP addresses (e.g., 192.168.x.x, 10.x.x.x)
  • Public accessibility: Must be publicly accessible from the internet

Retry Policy

If your callback endpoint fails to respond or returns an error:
  • Retry attempts: 3 automatic retries
  • Retry delays: After 1 second, 2 seconds, and 4 seconds
  • Final failure: After 3 failed attempts, no further retries are made
If all retry attempts fail, you can still retrieve the results by polling the Query Music Detail endpoint.

Security Best Practices

Verify requests: Consider adding a signature verification mechanism to ensure requests are from Vidgo API
Idempotency: Design your webhook handler to be idempotent in case of duplicate deliveries
Async processing: Process the callback asynchronously and return 200 quickly to avoid timeouts
Logging: Log all webhook requests for debugging and monitoring