Errors
Status codes and error bodies.
The SDK throws BevylApiError on any non-2xx response. It carries the HTTP status, the error code when the API sends one, and the raw body.
import { BevylApiError } from '@bevyl-ai/bevyl-sdk';
try {
await bevyl.createProject(input);
} catch (error) {
if (
error instanceof BevylApiError &&
error.code === 'insufficient_partner_credits'
) {
// add funds in the partner portal
}
throw error;
}Status and error codes
| Status | Code | What to do |
|---|---|---|
400 | Fix the request. For a body that fails validation, issues lists each problem. | |
401 | Send a valid, unrevoked API key. | |
402 | insufficient_ | Add funds in the partner portal. |
402 | limit_ | The workspace reached a plan limit. Contact Bevyl. |
402 | Upload: the workspace reached its plan's upload limit. | |
402 | export_, plan_, free_, trial_, account_ | start: the workspace plan doesn't allow the export. error. says why. |
403 | Create the workspace first. Check it isn't another partner's or revoked. | |
404 | The workspace has no brand, or the project, upload, or export isn't in it. | |
404 | project_ | Check the project and workspace. |
404 | not_ | Check the ID you sent. |
409 | create: the ID belongs to another partner or is revoked. complete: finish the file PUT and call it again, or start a new upload if this one expired. | |
409 | generation_ | Wait for project generation to finish, then regenerate. |
409 | analysis_ | Retry in a few seconds. |
409 | analysis_ | Analysis failed. error. says why. |
422 | Upload: the file type or size isn't allowed. Export: the project is longer than the workspace plan allows. Music preview: pick a track from list. | |
422 | preflight_ | Wait until the source videos are processed. error. says why. |
422 | voice_ | Pick a voice from list. |
422 | trend_ | Pick a trend from list. |
422 | background_ | Pick a track from list. |
422 | no_ | Call create first. Regenerate needs a prior brief. |
422 | invalid_ | Fix the brief. error. says what is wrong. |
500 | A Bevyl error. Retry with backoff. | |
502 | export_ | Call start again. |
uploadVideo throws BevylApiError with code upload_put_failed when the file PUT fails.
Error bodies
Validation errors:
{
"error": "Invalid request body",
"issues": [
{
"code": "invalid_type",
"path": ["name"],
"message": "Invalid input: expected string, received undefined"
}
]
}Operation errors:
{ "ok": false, "error": { "code": "analysis_not_ready", "message": "…" } }Other errors:
{ "error": "Unauthorized" }