CleanvoiceDocs
REST API

Retrieve an Edit

Poll for the status and result of an edit job.

Endpoint

GET /v2/edits/{edit_id}

Example

curl https://api.cleanvoice.ai/v2/edits/edit_abc123 \
  -H "X-API-Key: $CLEANVOICE_API_KEY"

Response

{
  "id": "edit_abc123",
  "status": "SUCCESS",
  "result": {
    "url": "https://cdn.cleanvoice.ai/cleaned/edit_abc123.mp3",
    "transcript": null,
    "summary": null
  }
}

Status values

StatusMeaning
PENDINGJob is queued and not yet started
STARTEDJob is actively being processed
SUCCESSJob completed — result.url contains the cleaned audio
FAILUREJob failed — check error field for details
RETRYJob encountered a transient error and is being retried

Polling loop

#!/bin/bash

EDIT_ID="edit_abc123"

# Wait before first poll
sleep 30

while true; do
  RESPONSE=$(curl -s "https://api.cleanvoice.ai/v2/edits/$EDIT_ID" \
    -H "X-API-Key: $CLEANVOICE_API_KEY")

  STATUS=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['status'])")

  echo "Status: $STATUS"

  if [ "$STATUS" = "SUCCESS" ]; then
    URL=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['result']['url'])")
    echo "Download URL: $URL"
    break
  elif [ "$STATUS" = "FAILURE" ]; then
    echo "Edit failed"
    echo "$RESPONSE"
    break
  fi

  sleep 10
done

Wait at least 30 seconds after submitting before your first poll. After that, poll every 10 seconds. Polling more frequently than every 5 seconds is not recommended.