Library

Upload a track or jingle file

POST
https://api.tunio.ai/v1/library/uploads

Send an audio file to add it to the caller's library as a music track or a jingle. The request only stores the file and returns an upload in state pending; checking that it is audio and converting it happen in the background. Read the upload by its upload_id until the state is completed (track_id or jingle_id is then set) or failed (error says why). Formats: mp3, aac, m4a, wav, flac, ogg/opus, aiff, recognised by content, not by extension. Music: up to 100 MB and 20 minutes, counts against the library storage limit. Jingle: up to 15 MB and 60 seconds, requires a plan with jingles; wma, webm/mkv and video files are taken too, only their first audio track is kept. Up to 20 uploads may be unfinished per account. Rate limited to 60 uploads per minute per account; reading uploads has a separate limit of 600 calls per minute.

响应

名称类型说明
successboolean
Always true.
uploadobject
The upload.
completed_atstring
When it completed or failed.
created_atstring
When the upload was accepted.
durationinteger
Length in seconds, set once completed.
errorstring
Machine-readable failure code, set only when state is failed: url_not_allowed, download_failed, file_too_large, not_audio (not an audio file of a supported format), duration_out_of_range, storage_limit_exceeded, processing_failed or processing_timeout.
file_namestring
Name of the sent file, or the last segment of the link.
jingle_idstring
Jingle: the jingle in the caller's library, set once completed; add it to a bundle with POST /v1/jingle-bundles/{bundle_id}/items.
kindstring
music or jingle.
size_bytesinteger
Size of the source file in bytes, known once it is downloaded.
sourcestring
file (sent in the request) or url (downloaded from a link).
source_urlstring
The link the file is downloaded from; null for file uploads.
statestring
pending (waiting for a worker), downloading, processing (checking and converting), completed or failed.
titlestring
Title given in the request, null when none was.
track_idstring
Music: the track in the caller's library, set once completed; add it to a static playlist with POST /v1/playlists/{playlist_id}/items.
upload_idstring
Upload ID; poll GET /v1/library/uploads/{upload_id} with it.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
max_pendinginteger
Uploads allowed to be unfinished at once per account (20); sent with too_many_pending_uploads.
messagestring
too_many_pending_uploads or rate_limited.
successboolean
Always false.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.