API errors and limits
A script has to know what to do when a request is refused. Every error has the same shape, and a code that is stable to branch on:
{ "error": { "code": "invalid_request", "message": "The request has a field that is missing, unknown, or of the wrong type or size.", "details": { "fields": ["wait"] } }}codeis snake_case and does not change. Branch on it.messageis a plain sentence for a person. Do not parse it.detailsis there only for some errors. Those that have it are named below.
A successful answer is the object itself, not wrapped. A 4xx answer means the request was refused and what it asked for was not done, unless the table says otherwise.
Every code
Section titled “Every code”400: the request is wrong
Section titled “400: the request is wrong”| Code | When |
|---|---|
invalid_request | The body is not JSON, or a field is missing, unknown, or of the wrong type or size. details.fields names the fields at fault, never what was sent in them. Starting a crawl with both publicPagesOnly and signIn true also gives this. |
invalid_field | A ticket or comment field is outside its limits; the message names it. |
invalid_address | The crawl address is not one InsightJet can crawl: it needs http:// or https:// and a host name. |
address_has_login | An address you sent contains a login (the user:password@ part): a crawl’s url, a test run’s targetUrl, a discovery’s targetUrl or the app-knowledge url. InsightJet never takes an application login in an address, or anywhere else in this API. Nothing was started. |
nothing_to_update | An edit named none of title, description, labels, priority or ownerId. |
owner_not_a_member | ownerId is not a current member of the key’s team. A personal key can only clear the owner. |
unknown_status | The team has no status with that name. details.statuses lists the names it has. |
too_many_mentions | A comment mentions more people than allowed. |
mentions_owner | A comment mentions the key’s owner, who is its author. |
not_a_member | A mentioned id is not a current member of the team. A personal key cannot mention anyone. |
ticket_refused | A ticket cannot be checked as it stands; the message says why. |
invalid_suggestions | The suggestions to make tickets from are refused whole; nothing was created. |
401: the key
Section titled “401: the key”missing_key, unknown_key, expired_key, revoked_key and mcp_key. See Authentication.
402: needs a plan change
Section titled “402: needs a plan change”| Code | When |
|---|---|
out_of_hours | The key’s owner has no agent-hours left. details has offer, backOn (when the hours come back, or null) and planLink (the plan page, or null). |
application_limit | Starting a crawl would go over the number of applications the plan includes. details has plan, used, limit and planLink. |
403: not allowed
Section titled “403: not allowed”| Code | When |
|---|---|
key_not_usable | The key’s owner has left the team the key was made for. |
owner_sign_in_needed | InsightJet could not confirm the owner’s sign-in, so the crawler would refuse the work. Nothing was started. Open insightjet.ai once while signed in, then try again. |
not_allowed | A ticket can be changed only by the person who created it or who currently owns it. |
no_owner_name | A comment says who it was written for, and InsightJet has no name on record for the key’s owner in this workspace (a personal key has none). |
team_blocked | The team cannot start new work right now. Contact InsightJet support. |
404: not found
Section titled “404: not found”not_found: the address does not exist, or the crawl, ticket, ticket run, test case, application, suite run or discovery does not exist or is not one the key may see. Both are answered the same way. For app knowledge it also means no application of yours matches the address.
409: the state does not allow it
Section titled “409: the state does not allow it”| Code | When |
|---|---|
needs_sign_in | A crawl was not started because the application needs its person to sign in first. See Crawls. details has why, signInLink and expiresAt. |
crawl_running | A crawl of this application is already running (or being started). details.crawlId is its id, or null. |
sign_in_unavailable | Signing in to an application from a script is not available. A crawl of the public pages only (publicPagesOnly) still works. |
run_still_running | That ticket run is still running. Wait for it to finish. |
run_not_running | You tried to stop a run that is not running. It keeps its result. |
status_gone | The status was removed a moment ago. Read the ticket again and retry. |
no_executable_code | The test case has no Playwright code, so it cannot be run. |
not_runnable_pom_spec | The test case is not a runnable page-object spec. Generate it as a page-object test case first. |
needs_app_credentials | The application has no saved login. Save it once in InsightJet’s Settings; a login is never accepted by the API. details.missing names only which values are missing. |
no_application_address | The application address of the test case could not be read. Nothing was started. |
no_runnable_specs | The application has no runnable page-object specs, so there is nothing to run or reconcile. |
no_page_objects | The page-object suite has none yet, so there is nothing to publish. |
discovery_not_completed | Test generation needs a completed discovery. details.status is its status. |
413 and 415: the body
Section titled “413 and 415: the body”payload_too_large (the body is over 1 MB) and unsupported_media_type (an encoding or character set that cannot be read).
429: slow down
Section titled “429: slow down”| Code | When |
|---|---|
too_many_requests | More than 120 reads or 30 changes a minute by the key’s owner. The Retry-After header gives the seconds to wait. |
all_agents_working | The owner already has as many agents working as the plan allows. details has busy and limit. There is no Retry-After: when one finishes is not known. Start again when one has. |
suggestions_rate | More than 10 asks for ticket suggestions in the last minute. Retry-After is set. |
The code daily_run_limit exists for assistant keys. An API key has no daily run limit and does not get it.
5xx: on InsightJet’s side
Section titled “5xx: on InsightJet’s side”| Status | Code | When |
|---|---|---|
| 500 | internal | Something went wrong on InsightJet’s side. Try again. |
| 502 | crawl_start_unconfirmed | The crawler did not confirm a crawl’s start. It may be running: GET /crawls/{id} shows its state. details.crawlId is its id. |
| 502 | run_failed | The crawler could not run the test case. Nothing is known about its result. Try again. |
| 502 | generation_failed | Test generation from a discovery failed. Try again in a minute. |
| 502 | github_failed | GitHub could not take the publish. Check the connection and the repository in InsightJet’s Settings. |
| 502 | bundle_failed | A runnable bundle could not be built for publishing. Nothing was published. Try again in a minute. |
| 502 | app_knowledge_unavailable | What is known about the application could not be read just now. Try again in a minute. |
| 503 | team_unchecked, hours_unchecked, agents_unchecked | Something could not be checked just now. Nothing was started. Try again in a minute. |
| 503 | unavailable | The test cases could not be listed just now. Try again in a minute. |
| 503 | application_unresolved | The application of a crawl could not be resolved just now, so a reconcile changed nothing. Try again in a minute. |
| 503 | not_started | InsightJet could not record the crawl. Nothing was started. |
| 503 | crawler_unavailable | The crawler could not take the crawl. No agent-hours were used. Try again in a few minutes. |
| 503 | server_busy | InsightJet is busy. Retry-After is 60. |
| 503 | sign_in_check_unavailable | InsightJet could not ask the crawler about a kept sign-in. Nothing was started. |
| 503 | cancelled | You closed the request before a wait ended. |
| 503 | suggestions_unavailable | InsightJet could not come up with suggestions. Try again. |
What to do
Section titled “What to do”- On
429withRetry-After, wait that many seconds and send the same request again. - On
503, wait a minute and try again. On502 crawl_start_unconfirmed, read the crawl first instead of starting another. - On
402, the key’s owner has to change something in InsightJet (hours or plan). Retrying will not help. - On any other
4xx, the request has to change. Do not retry it unchanged.