Webhooks

The Auphonic API allows users to define custom URIs on their own servers as Webhooks.

Webhooks are HTTP POST callbacks to automate the interaction with Auphonic: after the processing of an audio file is finished, Auphonic calls the assigned URI with an HTTP POST request and all necessary status information about the production. This callback can be used to automate consecutive steps after Auphonic processing on your server or in your custom workflow.

To enable a webhook, just add the webhook parameter while creating or editing a production or a preset, as described in the following sections.

Add a Webhook to a Production

To create a new production with webhook, set the paramter webhook in the json data to a callback URI on your server:

curl -X POST -H "Content-Type: application/json" \
    https://auphonic.com/api/productions.json \
    -u username:password \
    -d '{
            "preset": "iWfe3DUoKLFxF7pJzoq5qa",
            "input_file": "http://auphonic.com/media/audio-examples/auphonic-dehum-unprocessed.m4a",
            "metadata": {"title": "Production with Webhook"},
            "webhook": "https://your-server.com/callback"
        }'
After the production is finished, Auphonic automatically calls the given URI with an HTTP POST request and the following parameters:
  • uuid: the uuid of your production (should be used to query further details about the production, see Query Details about a Production)
  • status_string: the status of your production, either Done or Error
  • status: the number that indicates a certain status, either 3 for Done or 2 for Error (see Query Production Status)

You can also add a webhook to an existing production:

curl -H "Content-Type: application/json" -X POST \
    https://auphonic.com/api/production/{uuid}.json \
    -u username:password \
    -d '{"webhook": "https://your-server.com/callback"}'

Add a Webhook to a Preset

To create a new preset with webhook, add the parameter webhook to the json request data:

curl -X POST -H "Content-Type: application/json" \
    https://auphonic.com/api/presets.json \
    -u username:password \
    -d '{
            "preset_name": "Preset with Webhook",
            "output_files": [{"format": "mp3"}],
            "webhook": "https://your-server.com/callback"
        }'

Productions which are created using this preset, will call the webhook automatically.

It’s also possible to add a webhook to an existing preset:

curl -H "Content-Type: application/json" -X POST \
    https://auphonic.com/api/preset/{uuid}.json \
    -u username:password \
    -d '{"webhook": "http://your-server.com/callback"}'

Delete a Webhook

To delete a webhook, create a production or presest edit request with an empty webhook parameter:

curl -H "Content-Type: application/json" -X POST \
    https://auphonic.com/api/{production|preset}/{uuid}.json \
    -u username:password \
    -d '{"webhook": ""}'