Errors
Errors Making Requests to the API
The API will always return a JSON response when there is an error.
Invalid API Token
API requests made with an invalid API token will always return a 401
status code and a JSON response like:
{
"error": "Authentication error, API token missing/invalid"
}
Invalid API Request
When something is wrong with your API request, the API will return with a status code 400
:
{
"error": "format_text must be a Boolean"
}
The error
key will always contain more information about what was wrong with your request.
Server Errors
When something is wrong on our side, the API will return with a status code 500
:
{
"error": "Server error, developers have been alerted."
}
Failed Transcription Jobs
A transcription job can fail because something was wrong with your audio file, or because of an error on our side.
Whenever a transcription job fails, the status of the transcription will go to error
, and there will be an error
key in the JSON response from the API when fetching the transcription with a GET request.
The error
key will describe the error in more detail. For example:
{
// the status is shown as error here
"status": "error",
// the error is described in detail here
"error": "Download error to https://foo.bar, 403 Client Error: Forbidden for url: https://foo.bar",
...
}
Transcripts can fail if a file is extremely short (less than 200ms), does not contain any actual audio, or if your file cannot be retrieved by our API. You can test if an audio or video file can be downloaded directly by pasting the URL for your file directly into your browser's URL bar. If the file downloads rather than displaying a webpage, it should work. Only the AssemblyAI Playground currently supports retrieving videos directly from YouTube links.
When a transcription job fails due to an error on our side (a server error), we recommend resubmitting the file for transcription. If you encounter any issues or have any questions, you can refer to our FAQ or reach out to our Support team.