Music Webhook Callbacks
Instead of polling the Query Music Detail endpoint, you can provide acallback_url when submitting music generation tasks to receive automatic notifications when generation completes.
How It Works
- Submit with callback URL: Include a
callback_urlparameter in your music generation request - Task processing: PoYo AI processes your music generation task
- Receive notification: When the task status becomes
finishedorfailed, PoYo AI sends a POST request to your callback URL - Process result: Your server receives the complete task data including generated files
Callback Request
When a task completes, PoYo AI will send a POST request to your callback URL:Request Headers
Request Body Structure
The webhook body uses the same
task_id, status, files, created_time, and error_message fields as the music detail response body, without the outer code and data wrapper. Webhooks currently omit the detail-only credits_amount and progress fields. The files array content varies by model.Signature Verification
PoYo signs every music webhook request with HMAC-SHA256. Existing receivers can ignore these headers, but production systems should verify them. Get your webhook HMAC key:task_idis the top-leveltask_idin the callback bodytimestampis the value ofX-Webhook-Timestampwebhook_hmac_keyis returned byGET /api/api-keys/webhook-secret
Python Verification
Response Fields (files data)
Thefiles 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 trackinstrumental_url- URL to the instrumental track
upload-and-separate-vocals
vocal_removal fields:
bass- URL to the bass trackdrums- URL to the drums trackpiano- URL to the piano trackguitar- URL to the guitar trackvocals- URL to the vocals trackother- URL to other audio elements
stem-split
stem_split fields:
backing_vocals_url- URL to backing vocalsbass_url- URL to bass trackbrass_url- URL to brass instrumentsdrums_url- URL to drums trackfx_url- URL to sound effectsguitar_url- URL to guitar trackkeyboard_url- URL to keyboard trackpercussion_url- URL to percussion trackstrings_url- URL to strings tracksynth_url- URL to synthesizer trackvocal_url- URL to main vocalswoodwinds_url- URL to woodwinds trackpiano_url- URL to piano track
generate-music-cover
generate_cover is a JSON array containing cover image objects:
file_url- URL to the generated cover imagefile_type- File type (for example,image)
Callback Examples
Music Generation (generate-music, extend-music, etc.)
Suno Voice Generate
Suno Voice Validate or Regenerate
Suno Voice Check
MiniMax Music 2.6
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 30 seconds
- Success response: Should return HTTP 200-299 status code
- No internal IPs: Cannot use private/internal IP addresses (for example,
192.168.x.xand10.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: Up to 5 automatic retries
- Retry delays: Exponential backoff, starting at about 60 seconds and capped at 10 minutes
- Final failure: After all retry attempts fail, no further retries are made
