Beta API. See the stability policy.
Errors
When a request fails, the API sends back an error in a set shape. This article shows that shape, explains what the status codes mean, and tells you what to do about each kind of failure. Every error also has a short code you can look up in the list at the end.
What an error looks like
{
"error": {
"type": "invalid_request_error",
"code": "unknown_filter",
"message": "'resistence' is not a filterable field on a motor. Filterable fields: current_max (or iq_max), kv, poles (or n), resistance (or R), weight.",
"param": "resistence[lte]",
"request_id": "req_2c5tQ...",
"doc_url": "https://thrustlab.com/docs/api/errors#unknown_filter"
}
}| Field | What it holds |
|---|---|
type | The kind of failure. See the table below. |
code | A short name for this exact failure. It never changes, so it's safe to test for in your code. |
message | A sentence for people. We may reword it, so don't test for it in your code. |
param | The field of your request that caused the error, if there is one. Otherwise null. |
request_id | The ID of this request. Quote it if you contact support. |
doc_url | A link to this error's row in the list at the end of this article. |
A few errors add fields of their own. create_rate_limited adds retry_after_s, limit_per_minute and kind. solver_no_convergence adds details only on a flight made by the engine we retired. No new run returns that code.
What to do for each kind of error
| Type | Status | Try again? | What it means |
|---|---|---|---|
invalid_request_error | 400 or 422 | No | Something in the request is wrong: a missing field, a value out of range, an unknown name. Fix the request. |
authentication_error | 401 | No | The API key is missing or wrong. See Authentication. |
permission_error | 403 | No | Your key is valid, but you aren't allowed to do this. |
not_found_error | 404 | No | The thing doesn't exist, or it belongs to someone else. |
conflict_error | 409 | Not until you change something | The request clashes with the current state of the thing. |
idempotency_error | 409 | Not with the same key and a different body | You reused an Idempotency-Key for a different request. See Idempotency. |
rate_limit_error | 429 | Yes, after the wait | You sent too much too fast. See Rate limits. |
insufficient_credits_error | 402 | Not until your balance changes | The run needs more compute units than you have. See Compute units. |
api_error | 500 or 503 | Yes | A problem on our side. |
A 429 always has a Retry-After header with the number of seconds to wait. Wait that long and don't guess.
A 503 with the code read_only_maintenance means we paused new runs for maintenance. You can still read your data and save drafts. Try again later.
When a run fails
Some failures don't come back as an error response. If a run starts and then fails, you still get 200 when you fetch it. The run's status is failed, and the failure is in its error field. These codes show up that way:
| Code | Where | What it means |
|---|---|---|
bench_refused | A simulation or a sweep | The engine refused the request. The message names the input to change. |
engine_request_refused | A flight | The engine refused the request. The message names the field and the nearest valid name. |
solver_failure | Any run | The run failed for another reason. The message is general. |
sweep_points_persist_failed | A sweep | The sweep solved but its points could not be stored, so the results are incomplete. |
A run made by an earlier engine can still carry solver_no_convergence or propeller_geometry_missing. No new run returns them. When you check on a run, read status first, then error.
Two codes answer 404 for an address that moved: address_moved says the address was renamed and names the new one, and address_removed says it was removed and names what to use instead.
Handling errors in your code
- Look at
typefirst. It's enough to tell a wrong key from a wrong value from a missing thing. - Look at
codeonly when you need to do something different for one specific failure. - Expect new codes to appear. Treat a code you don't know like any other error of the same
type. - Log
request_idevery time.
Every error code
Each row has the code, its status and what to do about it.
invalid_request_error (400 / 422)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
VALIDATION_ERROR | 422 | No | A well-formed request violates a domain rule; the message names it. |
account_required | 400 | No | That field saves something against an account, which an anonymous run does not have. |
airfoil_fit_failed | 422 | No | The uploaded coordinates could not be fitted to a usable section. |
already_dispatched | 400 | No | That run was already handed to a worker and cannot be dispatched again. |
bench_refused | 422 | No | The test bench refused the request; the message names the input to change. |
dat_too_large | 400 | No | The uploaded airfoil coordinate file is above the size limit. |
engine_request_refused | 422 | No | The engine refused the request; the message names the field path and the nearest valid name. |
events_required | 400 | No | A webhook endpoint must subscribe to at least one event type. |
flight_budget_exceeded | 422 | No | Simulated seconds times distinct ESC twins exceeds the flight budget. |
flight_limit_exceeded | 422 | No | Rotors times save steps exceeds the plan's flight ceiling. |
geometry_not_loftable | 422 | No | The blade sections cannot be lofted into a solid. |
idempotency_key_required | 400 | No | Every write request needs an Idempotency-Key header. |
idempotency_key_too_long | 400 | No | The Idempotency-Key header is longer than 255 characters. |
invalid_analysis_request | 400 | No | The geometry analysis request is missing or contradicts a required field. |
invalid_battery_start | 422 | No | The battery start (state of charge or resting voltage) does not fit this battery. |
invalid_component_axis | 400 | No | A sweep component axis targets an out-of-range rotor slot or mixes component types. |
invalid_component_id | 400 | No | A component id is malformed or names a component of the wrong type. |
invalid_component_spec | 400 | No | The inline component specification is nonfinite, too large, or nested too deeply. |
invalid_created_at | 400 | No | A `created_at` filter is not a valid timestamp. |
invalid_cursor | 400 | No | The pagination cursor is malformed, or was issued for a different sort than the one requested. |
invalid_dat | 400 | No | The uploaded airfoil coordinate file could not be parsed. |
invalid_email | 400 | No | The supplied email address is not a valid address. |
invalid_filter_value | 400 | No | A range-filter value is not a finite number. |
invalid_geometry | 422 | No | A propeller geometry is outside the bounds the solver accepts. |
invalid_limit | 400 | No | The `limit` parameter is outside the accepted range. |
invalid_pack_component | 422 | No | A battery in the pack topology is missing a required cell property. |
invalid_project | 400 | No | The project id is malformed or names no project this account owns. |
invalid_request | 400 | No | A query parameter or body field is outside its accepted range or vocabulary. |
invalid_rotation | 400 | No | A propeller rotation label is outside the accepted vocabulary. |
invalid_schedule | 422 | No | The flight schedule is incomplete or inconsistent. |
invalid_status | 400 | No | The run is not in a status this action accepts. |
invalid_status_filter | 400 | No | The `status` filter is not one of the published run statuses. |
invalid_sweep_config | 400 | No | The sweep axes do not form a valid grid; the message names the failing axis. |
pack_cell_limit_exceeded | 422 | No | The pack topology holds more cells than the engine supports. |
pack_too_large_for_flight | 422 | No | The pack is above the cell ceiling for a flight; use a test bench run or a smaller pack. |
parallel_voltage_mismatch | 422 | No | Packs wired in parallel must have the same series cell count. |
propeller_model_unsupported | 422 | No | The requested propeller model does not run this kind of job; flights and batch runs need propeller_model='full'. |
public_run_too_large | 422 | No | A run without an account would need more than 2 compute-minutes by the estimate; sign in, or use fewer points, fewer different rotors or a shorter hold. |
request_body_too_large | 400 | No | The request body exceeds the maximum size accepted for an idempotent request. |
request_validation_failed | 400 | No | The request body or query string failed schema validation; `param` names the offending field. |
rotor_limit_exceeded | 422 | No | The run has more rotors than the plan allows. |
run_not_finished | 400 | No | A run that waits or is in progress cannot be copied; nothing was copied. |
run_too_large | 422 | No | The run needs more compute units than the plan's daily allowance, which is the largest single run; it can never start on this plan. |
sweep_limit_exceeded | 422 | No | An anonymous sweep has more than 25 points. |
sweep_too_large | 400 | No | The sweep grid exceeds the 10,000-point ceiling for one submission. |
sweep_too_small | 400 | No | A sweep must define at least two evaluation points. |
unknown_airfoil | 422 | No | An airfoil reference names no airfoil this account can use. |
unknown_event_type | 400 | No | A subscribed event type is not one the API emits. |
unknown_filter | 400 | No | A bracket filter names a field this component type does not have; the message lists the fields it does have. |
webhook_url_dns_failure | 400 | Yes | The webhook hostname did not resolve at the time of the request. |
webhook_url_invalid | 400 | No | The webhook URL has no hostname. |
webhook_url_not_https | 400 | No | A webhook URL must use https. |
webhook_url_not_publicly_routable | 400 | No | The webhook hostname resolves to a private or reserved address. |
authentication_error (401)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
UNAUTHORIZED | 401 | No | The credential was rejected on a first-party endpoint. |
invalid_api_key | 401 | No | The API key is unknown, revoked, or belongs to a disabled account. |
invalid_jwt | 401 | No | The bearer token is malformed, expired, or not an access token. |
invalid_jwt_subject | 401 | No | The token is valid but its subject is not an active user. |
missing_authorization | 401 | No | The request carried no Authorization header. |
permission_error (403)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
FORBIDDEN | 403 | No | The caller may not act on this resource. |
email_unverified | 403 | No | The account must verify its email address before running a simulation. |
permission_denied | 403 | No | The caller may not modify this resource. |
pro_required | 403 | No | Multi-pack battery topology is a Pro feature. |
public_feature_needs_account | 403 | No | A test of one part without an account runs the Fast propeller model, a point or a sweep over one part; the Full model, other kinds of analysis and your own parts need an account. |
public_part_tests_used | 403 | No | This address ran its 3 tests of one part without an account; sign up for free to run more. |
not_found_error (404)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
NOT_FOUND | 404 | No | The referenced record does not exist or is not visible to this account. |
address_moved | 404 | No | The address was renamed. The message names the new address. |
address_removed | 404 | No | The address was removed. The message names what to use instead. |
airfoil_not_found | 404 | No | No airfoil with that id is visible to this account. |
component_not_found | 404 | No | No component with that id is visible to this account. |
credit_transaction_not_found | 404 | No | No credit transaction with that id exists. |
event_not_found | 404 | No | No event with that id belongs to this account. |
geometry_style_not_found | 404 | No | No geometry style with that id exists. |
not_found | 404 | No | No published resource matches that identifier. |
project_not_found | 404 | No | No project with that id belongs to this account. |
resource_missing | 404 | No | No run with that id belongs to this account. |
starred_component_not_found | 404 | No | That component is not starred in this project. |
submission_not_found | 404 | No | No component submission with that id exists. |
user_not_found | 404 | No | The authenticated user record could not be loaded. |
webhook_delivery_not_found | 404 | No | No webhook delivery with that id belongs to this account. |
webhook_endpoint_not_found | 404 | No | No webhook endpoint with that id belongs to this account. |
conflict_error (409)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
CONFLICT | 409 | No | The resource is not in a state that allows this action. |
active_flight | 409 | No | The flight is queued or running; cancel it before deleting. |
active_simulation | 409 | No | The simulation is queued or running; cancel it before deleting. |
active_sweep | 409 | No | The sweep is queued or running; cancel it before deleting. |
already_claimed | 409 | No | That anonymous run has already been saved to another account. |
already_running | 409 | No | The run is already executing. |
already_starred | 409 | No | The component is already starred in this project. |
already_terminal | 409 | No | The run has already finished, failed, or been canceled. |
component_in_use | 409 | No | The component is referenced by saved simulations; delete those first. The response carries `run_count` (how many runs use it) and `run_names` (the first five names, sorted). |
delivery_not_terminal | 409 | No | The webhook delivery is still in flight; wait for it to settle before replaying. |
idempotency_request_in_progress | 409 | Yes | A request with this Idempotency-Key is still being processed; retry shortly to receive its result. |
project_has_active_runs | 409 | No | The project has runs that are still queued or running; cancel or wait for them before deleting it. |
submission_already_reviewed | 409 | No | The submission has already been accepted or rejected. |
idempotency_error (409)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
idempotency_key_reused_with_different_body | 409 | No | The Idempotency-Key was already used with a different request body. |
rate_limit_error (429)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
account_queue_full | 429 | Yes | The account has as many simulations queued or running as its plan allows (for a new draft, drafts count too); the response carries the limit and the count. Wait, cancel queued runs or delete drafts, then retry. |
create_rate_limited | 429 | Yes | The account submitted more runs of this kind in one minute than the submission limit allows; the response carries the limit and the wait. |
public_runs_waiting | 429 | Yes | This address already has 3 runs without an account waiting for the solver; wait for one to finish (`Retry-After`), or sign up. |
rate_limit_exceeded | 429 | Yes | The per-credential request bucket is empty; wait for `Retry-After` seconds. |
too_many_streams | 429 | Yes | This account has too many open live streams; close some before opening another. |
insufficient_credits_error (402)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
INSUFFICIENT_CREDITS | 402 | No | The account does not hold enough compute units for this run. |
credits_insufficient | 402 | No | The run needs more compute units than are left today; the response gives the units the run needs and the units left. The units come back at midnight UTC. |
upgrade_required | 402 | No | The action needs a higher plan; the response names the gate and the cheapest plan that grants it. |
api_error (500 / 503 / in the run resource)
| Code | HTTP | Retryable | What it means |
|---|---|---|---|
billing_not_configured | 503 | Yes | Billing is not configured on this server. |
component_analysis_capacity | in the run resource | Yes | The component-analysis job exhausted its capacity retries; submit again when a worker slot is available. |
component_analysis_failed | in the run resource | No | The component-analysis job failed; inspect its inputs or contact support with the job ID. |
engine_fault | 500 | No | A fault inside the engine stopped the call; quote the report id in the message when you report it. |
evaluation_failed | in the run resource | No | One candidate or operating point failed during component analysis; inspect its inputs and diagnostics. |
invalid_operating_point | in the run resource | No | The part test could not give a reading at this point: the engine refused it, or it is outside the part's limits. |
public_run_expired | in the run resource | Yes | An anonymous run waited more than 15 minutes for the solver and was not started; run it again. |
public_simulate_busy | 503 | Yes | Every free anonymous-solver slot is in use; the response carries a Retry-After and the identical request succeeds once one frees. |
public_solver_failure | 500 | Yes | An anonymous run failed for a reason that is not the request's; try again. |
read_only_maintenance | 503 | Yes | New runs are paused for maintenance; reads and drafts still work. |
run_interrupted | in the run resource | Yes | An anonymous run was still running after 30 minutes because a server restart cut it off; run it again. |
solver_failure | in the run resource | No | The run failed for a reason with no more specific code; the details stay in the server logs. |
sweep_points_persist_failed | in the run resource | No | The sweep solved but its point rows could not be stored, so the results are incomplete. |