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

json
{
  "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"
  }
}
What an error looks like
FieldWhat it holds
typeThe kind of failure. See the table below.
codeA short name for this exact failure. It never changes, so it's safe to test for in your code.
messageA sentence for people. We may reword it, so don't test for it in your code.
paramThe field of your request that caused the error, if there is one. Otherwise null.
request_idThe ID of this request. Quote it if you contact support.
doc_urlA 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

What to do for each kind of error
TypeStatusTry again?What it means
invalid_request_error400 or 422NoSomething in the request is wrong: a missing field, a value out of range, an unknown name. Fix the request.
authentication_error401NoThe API key is missing or wrong. See Authentication.
permission_error403NoYour key is valid, but you aren't allowed to do this.
not_found_error404NoThe thing doesn't exist, or it belongs to someone else.
conflict_error409Not until you change somethingThe request clashes with the current state of the thing.
idempotency_error409Not with the same key and a different bodyYou reused an Idempotency-Key for a different request. See Idempotency.
rate_limit_error429Yes, after the waitYou sent too much too fast. See Rate limits.
insufficient_credits_error402Not until your balance changesThe run needs more compute units than you have. See Compute units.
api_error500 or 503YesA 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:

When a run fails
CodeWhereWhat it means
bench_refusedA simulation or a sweepThe engine refused the request. The message names the input to change.
engine_request_refusedA flightThe engine refused the request. The message names the field and the nearest valid name.
solver_failureAny runThe run failed for another reason. The message is general.
sweep_points_persist_failedA sweepThe 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

  1. Look at type first. It's enough to tell a wrong key from a wrong value from a missing thing.
  2. Look at code only when you need to do something different for one specific failure.
  3. Expect new codes to appear. Treat a code you don't know like any other error of the same type.
  4. Log request_id every time.

Every error code

Each row has the code, its status and what to do about it.

invalid_request_error (400 / 422)

invalid_request_error error codes
CodeHTTPRetryableWhat it means
VALIDATION_ERROR422NoA well-formed request violates a domain rule; the message names it.
account_required400NoThat field saves something against an account, which an anonymous run does not have.
airfoil_fit_failed422NoThe uploaded coordinates could not be fitted to a usable section.
already_dispatched400NoThat run was already handed to a worker and cannot be dispatched again.
bench_refused422NoThe test bench refused the request; the message names the input to change.
dat_too_large400NoThe uploaded airfoil coordinate file is above the size limit.
engine_request_refused422NoThe engine refused the request; the message names the field path and the nearest valid name.
events_required400NoA webhook endpoint must subscribe to at least one event type.
flight_budget_exceeded422NoSimulated seconds times distinct ESC twins exceeds the flight budget.
flight_limit_exceeded422NoRotors times save steps exceeds the plan's flight ceiling.
geometry_not_loftable422NoThe blade sections cannot be lofted into a solid.
idempotency_key_required400NoEvery write request needs an Idempotency-Key header.
idempotency_key_too_long400NoThe Idempotency-Key header is longer than 255 characters.
invalid_analysis_request400NoThe geometry analysis request is missing or contradicts a required field.
invalid_battery_start422NoThe battery start (state of charge or resting voltage) does not fit this battery.
invalid_component_axis400NoA sweep component axis targets an out-of-range rotor slot or mixes component types.
invalid_component_id400NoA component id is malformed or names a component of the wrong type.
invalid_component_spec400NoThe inline component specification is nonfinite, too large, or nested too deeply.
invalid_created_at400NoA `created_at` filter is not a valid timestamp.
invalid_cursor400NoThe pagination cursor is malformed, or was issued for a different sort than the one requested.
invalid_dat400NoThe uploaded airfoil coordinate file could not be parsed.
invalid_email400NoThe supplied email address is not a valid address.
invalid_filter_value400NoA range-filter value is not a finite number.
invalid_geometry422NoA propeller geometry is outside the bounds the solver accepts.
invalid_limit400NoThe `limit` parameter is outside the accepted range.
invalid_pack_component422NoA battery in the pack topology is missing a required cell property.
invalid_project400NoThe project id is malformed or names no project this account owns.
invalid_request400NoA query parameter or body field is outside its accepted range or vocabulary.
invalid_rotation400NoA propeller rotation label is outside the accepted vocabulary.
invalid_schedule422NoThe flight schedule is incomplete or inconsistent.
invalid_status400NoThe run is not in a status this action accepts.
invalid_status_filter400NoThe `status` filter is not one of the published run statuses.
invalid_sweep_config400NoThe sweep axes do not form a valid grid; the message names the failing axis.
pack_cell_limit_exceeded422NoThe pack topology holds more cells than the engine supports.
pack_too_large_for_flight422NoThe pack is above the cell ceiling for a flight; use a test bench run or a smaller pack.
parallel_voltage_mismatch422NoPacks wired in parallel must have the same series cell count.
propeller_model_unsupported422NoThe requested propeller model does not run this kind of job; flights and batch runs need propeller_model='full'.
public_run_too_large422NoA 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_large400NoThe request body exceeds the maximum size accepted for an idempotent request.
request_validation_failed400NoThe request body or query string failed schema validation; `param` names the offending field.
rotor_limit_exceeded422NoThe run has more rotors than the plan allows.
run_not_finished400NoA run that waits or is in progress cannot be copied; nothing was copied.
run_too_large422NoThe 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_exceeded422NoAn anonymous sweep has more than 25 points.
sweep_too_large400NoThe sweep grid exceeds the 10,000-point ceiling for one submission.
sweep_too_small400NoA sweep must define at least two evaluation points.
unknown_airfoil422NoAn airfoil reference names no airfoil this account can use.
unknown_event_type400NoA subscribed event type is not one the API emits.
unknown_filter400NoA bracket filter names a field this component type does not have; the message lists the fields it does have.
webhook_url_dns_failure400YesThe webhook hostname did not resolve at the time of the request.
webhook_url_invalid400NoThe webhook URL has no hostname.
webhook_url_not_https400NoA webhook URL must use https.
webhook_url_not_publicly_routable400NoThe webhook hostname resolves to a private or reserved address.

authentication_error (401)

authentication_error error codes
CodeHTTPRetryableWhat it means
UNAUTHORIZED401NoThe credential was rejected on a first-party endpoint.
invalid_api_key401NoThe API key is unknown, revoked, or belongs to a disabled account.
invalid_jwt401NoThe bearer token is malformed, expired, or not an access token.
invalid_jwt_subject401NoThe token is valid but its subject is not an active user.
missing_authorization401NoThe request carried no Authorization header.

permission_error (403)

permission_error error codes
CodeHTTPRetryableWhat it means
FORBIDDEN403NoThe caller may not act on this resource.
email_unverified403NoThe account must verify its email address before running a simulation.
permission_denied403NoThe caller may not modify this resource.
pro_required403NoMulti-pack battery topology is a Pro feature.
public_feature_needs_account403NoA 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_used403NoThis address ran its 3 tests of one part without an account; sign up for free to run more.

not_found_error (404)

not_found_error error codes
CodeHTTPRetryableWhat it means
NOT_FOUND404NoThe referenced record does not exist or is not visible to this account.
address_moved404NoThe address was renamed. The message names the new address.
address_removed404NoThe address was removed. The message names what to use instead.
airfoil_not_found404NoNo airfoil with that id is visible to this account.
component_not_found404NoNo component with that id is visible to this account.
credit_transaction_not_found404NoNo credit transaction with that id exists.
event_not_found404NoNo event with that id belongs to this account.
geometry_style_not_found404NoNo geometry style with that id exists.
not_found404NoNo published resource matches that identifier.
project_not_found404NoNo project with that id belongs to this account.
resource_missing404NoNo run with that id belongs to this account.
starred_component_not_found404NoThat component is not starred in this project.
submission_not_found404NoNo component submission with that id exists.
user_not_found404NoThe authenticated user record could not be loaded.
webhook_delivery_not_found404NoNo webhook delivery with that id belongs to this account.
webhook_endpoint_not_found404NoNo webhook endpoint with that id belongs to this account.

conflict_error (409)

conflict_error error codes
CodeHTTPRetryableWhat it means
CONFLICT409NoThe resource is not in a state that allows this action.
active_flight409NoThe flight is queued or running; cancel it before deleting.
active_simulation409NoThe simulation is queued or running; cancel it before deleting.
active_sweep409NoThe sweep is queued or running; cancel it before deleting.
already_claimed409NoThat anonymous run has already been saved to another account.
already_running409NoThe run is already executing.
already_starred409NoThe component is already starred in this project.
already_terminal409NoThe run has already finished, failed, or been canceled.
component_in_use409NoThe 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_terminal409NoThe webhook delivery is still in flight; wait for it to settle before replaying.
idempotency_request_in_progress409YesA request with this Idempotency-Key is still being processed; retry shortly to receive its result.
project_has_active_runs409NoThe project has runs that are still queued or running; cancel or wait for them before deleting it.
submission_already_reviewed409NoThe submission has already been accepted or rejected.

idempotency_error (409)

idempotency_error error codes
CodeHTTPRetryableWhat it means
idempotency_key_reused_with_different_body409NoThe Idempotency-Key was already used with a different request body.

rate_limit_error (429)

rate_limit_error error codes
CodeHTTPRetryableWhat it means
account_queue_full429YesThe 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_limited429YesThe 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_waiting429YesThis address already has 3 runs without an account waiting for the solver; wait for one to finish (`Retry-After`), or sign up.
rate_limit_exceeded429YesThe per-credential request bucket is empty; wait for `Retry-After` seconds.
too_many_streams429YesThis account has too many open live streams; close some before opening another.

insufficient_credits_error (402)

insufficient_credits_error error codes
CodeHTTPRetryableWhat it means
INSUFFICIENT_CREDITS402NoThe account does not hold enough compute units for this run.
credits_insufficient402NoThe 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_required402NoThe 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)

api_error error codes
CodeHTTPRetryableWhat it means
billing_not_configured503YesBilling is not configured on this server.
component_analysis_capacityin the run resourceYesThe component-analysis job exhausted its capacity retries; submit again when a worker slot is available.
component_analysis_failedin the run resourceNoThe component-analysis job failed; inspect its inputs or contact support with the job ID.
engine_fault500NoA fault inside the engine stopped the call; quote the report id in the message when you report it.
evaluation_failedin the run resourceNoOne candidate or operating point failed during component analysis; inspect its inputs and diagnostics.
invalid_operating_pointin the run resourceNoThe part test could not give a reading at this point: the engine refused it, or it is outside the part's limits.
public_run_expiredin the run resourceYesAn anonymous run waited more than 15 minutes for the solver and was not started; run it again.
public_simulate_busy503YesEvery free anonymous-solver slot is in use; the response carries a Retry-After and the identical request succeeds once one frees.
public_solver_failure500YesAn anonymous run failed for a reason that is not the request's; try again.
read_only_maintenance503YesNew runs are paused for maintenance; reads and drafts still work.
run_interruptedin the run resourceYesAn anonymous run was still running after 30 minutes because a server restart cut it off; run it again.
solver_failurein the run resourceNoThe run failed for a reason with no more specific code; the details stay in the server logs.
sweep_points_persist_failedin the run resourceNoThe sweep solved but its point rows could not be stored, so the results are incomplete.