The publish action will start the publish process for everything in the import queue. This can take a while, so if you send in an oncomplete parameter set to a url, we’ll send a request to that when it’s done. If you send an email as your argument for oncomplete, we’ll email that instead. With this publish job id, you can use the list command to get all the final track ids in case you want to download them or update your external system. Please keep in mind that while your tracks are technically live at the time of publishing, there will still be a slight delay before they’re available from search while they’re being indexed. You can also create a job separate from your site’s main publishing job by creating a job and using the job_id returned from that call in subsequent calls to /api/import/upload and /api/import/publish.
Publish
/api/import/publish
Param
Required
Description
oncomplete
no
An email or url that will be called when this upload’s job is published. One per job, overwrites if already exists
job_id
no
Publish a specific job_id. Default is your site’s main publishing job, but you can also publish to a specific job_id i.e. as created by /api/import/createJob
When the job finishes and oncomplete is a URL, we make a GET request to it with no body. If oncomplete is an email address, we send an email instead.
The following query string is appended to your URL (after any query string it already has):
<oncomplete url>?job_id=<job id>&errors=<error text>&count=<number of tracks>
Param
Meaning
job_id
The ID of the publish job. This is not a track id.
count
Number of tracks that finished successfully.
errors
Error text, empty if there were no errors. It may contain HTML (links and lists) and is not URL-encoded, so parse it defensively.
To get the ids of the published tracks, call the list command with the job_id after the webhook fires.
The request is made once, with no retries, and includes no signature or authentication header. Make your endpoint idempotent, and use list to verify the job rather than trusting the request alone.
Check Publish Job
See the progress of a publishing job.
/api/import/checkJob
Param
Required
Description
job_id
yes
The job_id retrieved from /api/import/publish or from /api/import/createJob
Explanation Of Responses
Explanation of response keys:
Key
Meaning
q
queued
d
done
i
progress
e
errored
Example Response
{ "d": 1, "q": 1 }
Create A Publish Job
Create a job which you can upload to and publish separately from your main publishing jobs.
/api/import/createJob
Param
Required
Description
name
no
A name to give the job, i.e. “Imports for 05/10”
email
no
Email to notify when the job completes. Default is the email contact for your account.
Example Response
{ "job_id": 296204 }
Set Formats To Be Published
/api/import/setFormats
Param
Required
Description
upload_id
yes
The upload_id you’d like to specify the formats for
formats
yes
Comma-separated list of formats to publish, i.e. mp3,aiff