---
title: "Troubleshooting"
section: "API Requests"
description: "Fixes for SmartestQA API Requests: the tree, Postman, Swagger and curl imports, Save, Send errors such as timeout or connection refused, and API steps in runs."
url: https://docs.smartestqa.ai/en/api-requests-troubleshooting.html
audience: [customer, admin]
updated: 2026-11-08
keywords: "api request error send timeout host not found connection refused url must start with http postman invalid swagger ui page curl 401 unsupported http method step"
---
# API Requests: Troubleshooting

Find the message or symptom you see. Each entry says why it happens, what to check and how to fix it.

## In short

**On this page you can**

- Look up an API Requests message and see why it appears.
- Fix Send errors: timeout, unknown host, refused connection.
- Fix imports from Postman, Swagger / OpenAPI and curl.
- Fix API steps that behave differently in a run.

**How to use it**

1. Copy the first words of the message you see.
2. Find the entry with the same words below.
3. Work through Check , then apply Fix .
4. Still stuck: send the message and the run link to info@smartestqa.ai.

## The API tree

### Problem: “API requests could not be loaded.” _(Tree)_

- **Why:** The tree could not be read: session expired, network problem, or no project selected (“Please select a project”).
- **Fix:** Click **Retry**. If it stays, select the project again or log in again.

### Problem: “Request could not be created.” / “Folder could not be created.” / “Collection could not be created.” _(Tree)_

- **Fix:** Refresh the page and try again. Select an existing collection or folder first; a parent deleted in another tab cannot take new items.

### Problem: “Error during update.” _(Tree)_

- **Why:** A rename or a drag-and-drop move was rejected.
- **Fix:** Refresh and try again. Collections and the top folder cannot be moved, and a folder cannot go into its own sub folder. See [Move](https://docs.smartestqa.ai/en/api-requests-library.html#move).

### Problem: “Folder … could not be deleted.” / “Collection … could not be deleted.” / “Request … could not be deleted.” _(Tree)_

- **Why:** A folder or collection that still has content can only be deleted by an [Admin](https://docs.smartestqa.ai/en/company-settings-roles.html). For a request, or “Server error during deletion.”, the server rejected the delete.
- **Fix:** Ask an Admin, or empty the folder first. Steps made from the requests keep working. See [Delete](https://docs.smartestqa.ai/en/api-requests-library.html#delete).

## Imports

### Problem: “Invalid Postman collection format” / “Please select a valid JSON file” _(Postman)_

- **Why:** The file is not JSON, or it is not a collection export (it lacks `info` and `item`). Postman environment files and data dumps look similar but are not collections.
- **Fix:** In Postman, export the collection itself and import that file. “Please select a file” means none was chosen. See [Import a Postman collection](https://docs.smartestqa.ai/en/api-requests-library.html#import-postman).

### Problem: “Import error: …” _(Postman)_

- **Why:** The server could not import the collection; the text after the colon is its reason.
- **Fix:** Correct what the reason names, or import a smaller collection. When *n*/*total* shows fewer requests than expected, compare the collection and the tree and add the missing ones by hand.

### Problem: “This looks like a Swagger UI page, not the JSON spec…” / “URL returned HTML, not JSON…” _(Swagger)_

- **Why:** The address is the documentation page, not the specification.
- **Fix:** Use the JSON endpoint, usually `/v3/api-docs`, `/v2/api-docs`, `/swagger.json` or `/openapi.json`. In Swagger UI it is the link under the API title.

### Problem: “Failed to fetch Swagger spec: HTTP …” / “Swagger URL returned an empty body.” _(Swagger)_

- **Why:** The SmartestQA server downloaded the address and got an error status (for example 401 or 404) or nothing.
- **Check:** The URL opens without a login, and it is reachable from the internet.
- **Fix:** Download the spec yourself and use **File Upload** (JSON or YAML).

### Problem: “URL is required. Please enter a request URL.” / “Invalid URL. Please enter the address starting with http:// or https://.” / “Please provide a file or URL.” _(Swagger)_

- **Fix:** Enter a full address beginning with `http://` or `https://` on the **URL** tab, or choose a file on **File Upload**.

### Problem: “No URL found in the curl command.” / “Empty curl command.” / “Failed to parse the curl command.” _(curl)_

- **Why:** The text is empty, has no address, or has unbalanced quotes.
- **Fix:** Copy the command again (“Copy as cURL (bash)” in the browser) and paste it whole. In [Automate](https://docs.smartestqa.ai/en/automate.html), “Failed to create the API request.” means the parsed request could not be saved; try again.

## Editing and Save

### Problem: “URL is required. Please enter a request URL.” _(Save)_

- **Fix:** Enter a URL. It may be relative or contain references; see [Save](https://docs.smartestqa.ai/en/api-requests-editor.html#save).

### Problem: “Invalid URL. Please enter the address starting with http:// or https://.” when saving _(Save)_

- **Why:** The URL uses a Data Source key whose value is not a full address.
- **Fix:** Open the key in [Variables](https://docs.smartestqa.ai/en/data-source-variables.html) and give it a value that starts with `http://` or `https://`, for example `https://test.shop.example.com/api`.

### Problem: “An error occurred while saving. Please try again later.” _(Save)_

- **Fix:** Refresh, then save again. A Basic Auth password longer than 128 characters or a URL longer than 2,048 characters cannot be stored.

### Problem: “Authorization could not be saved. Please try again.” / “No folder or collection selected.” _(Authorization)_

- **Fix:** Select the collection or folder in the tree, set the authorization and click [**Save Auth**](https://docs.smartestqa.ai/en/api-requests-editor.html#inherit-auth) again. See [Inherited authorization](https://docs.smartestqa.ai/en/api-requests-editor.html#inherit-auth).

### Problem: “No authorization set on parent collection/folder. Set it there first.” _(Authorization)_

- **Fix:** Set Bearer or Basic on the collection or a folder above the request and click [**Save Auth**](https://docs.smartestqa.ai/en/api-requests-editor.html#inherit-auth). For requests you will use in tests, set [**Bearer Token**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization) on the request instead; see [Authorization in runs](https://docs.smartestqa.ai/en/api-requests-in-tests.html#auth-in-runs).

### Problem: A header or parameter row disappeared after saving _(Editing)_

- **Why:** Rows switched off with **Enable row** are not saved.
- **Fix:** Switch the row on before saving, or keep a variant of the request with [Duplicate](https://docs.smartestqa.ai/en/api-requests-library.html#duplicate).

## Send

### Problem: “You can save this address and use it in a test case; global parameters are resolved during the run. But to send it directly from here, the URL must start with http:// or https://.” _(Send)_

- **Why:** After [Data Source keys](https://docs.smartestqa.ai/en/data-source-variables.html) are filled in, the URL is still not a full address: it is relative (`/api/orders`) or starts with a run-time reference such as `{{tc:baseUrl}}`.
- **Fix:** Start the URL with a Data Source key that holds a full address, `{{ds:apiBase}}/orders`, or try it with the step’s Send in [Automate](https://docs.smartestqa.ai/en/automate.html), which asks for test values. See [What Send sends](https://docs.smartestqa.ai/en/api-requests-editor.html#what-send-sends).

### Problem: “The request timed out (30s). The target did not respond.” _(Send)_

- **Why:** No answer within 30 seconds. Often a firewall that silently drops traffic from the SmartestQA server, or a slow endpoint.
- **Fix:** Check that the API is reachable from the internet, then click **Retry**. For internal APIs, test with a [Dry Run](https://docs.smartestqa.ai/en/automate-dry-run.html) on [an agent](https://docs.smartestqa.ai/en/agent-pool-agents.html).

### Problem: “Host not found. Please check the URL.” _(Send)_

- **Why:** The host name does not resolve from the SmartestQA server: a typo, or an internal name such as `api.intranet` or `localhost`.
- **Fix:** Correct the host. Internal hosts can only be reached by a run on [an agent](https://docs.smartestqa.ai/en/agent-pool-agents.html) inside your network ([Do you need an agent?](https://docs.smartestqa.ai/en/quick-start-connect.html#agent)).

### Problem: “Connection refused. The target is not reachable.” _(Send)_

- **Why:** The host exists but nothing accepts connections on that port, or a firewall rejects SmartestQA.
- **Fix:** Check the port and protocol (`http` vs `https`) and the firewall. Then **Retry**.

### Problem: “The request could not be completed. Please try again.” / “An error occurred while sending the request. Please try again later.” _(Send)_

- **Why:** Another network or protocol error, for example a TLS certificate the server does not trust, or an address that is not a valid URL.
- **Fix:** Check the URL, open it in a browser, and click **Retry**. For self-signed certificates, use a test endpoint with a valid certificate.

### Problem: PATCH, HEAD or OPTIONS behaves like GET on this page _(Send)_

- **Why:** **Send** on the API Requests page sends only POST, PUT and DELETE as such; every other method goes out as GET.
- **Fix:** Test PATCH with a [Dry Run](https://docs.smartestqa.ai/en/automate-dry-run.html) of an [API step](https://docs.smartestqa.ai/en/automate-steps-api.html): runs send PATCH. HEAD and OPTIONS are not supported in runs either.

### Problem: My Params rows are not in the request _(Send)_

- **Why:** **Send** uses only the query string in the URL. Test runs add the **Params** rows.
- **Fix:** To try them here, write them into the URL: `?page=1&size=20`.

### Problem: The API receives `{{tc:…}}` or `{{ds:apiToken}}` as text _(Send)_

- **Why:** Send on this page fills only [Data Source keys](https://docs.smartestqa.ai/en/data-source-variables.html) in the URL. Headers, body and token are sent as typed.
- **Fix:** Use the step’s Send in Automate with [**Test values**](https://docs.smartestqa.ai/en/automate-steps-api.html#send), or a [Dry Run](https://docs.smartestqa.ai/en/automate-dry-run.html). [Encrypted keys](https://docs.smartestqa.ai/en/data-source-secrets.html#encrypt) are only ever filled in a run.

## API steps in runs

### Problem: Works with Send, but the run gets 401 Unauthorized _(Runs)_

- **Why:** The step uses [**Basic Auth**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization) or [**Inherit from parent**](https://docs.smartestqa.ai/en/api-requests-editor.html#inherit-auth). A run applies only [**Bearer Token**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization). A pasted curl with `-u` or `Authorization: Basic` becomes Basic Auth too.
- **Fix:** Set **Bearer Token** on the step’s request, or add an `Authorization` header with `Basic {{ds:apiBasicAuth}}`. See [Authorization in runs](https://docs.smartestqa.ai/en/api-requests-in-tests.html#auth-in-runs).

### Problem: “Unsupported HTTP method” _(Runs)_

- **Why:** HEAD and OPTIONS can be saved but a run supports only GET, POST, PUT, PATCH and DELETE.
- **Fix:** Change the method of the step’s request, for example to GET, and check the headers you need with an extractor.

### Problem: I changed the request in API Requests, but the test still sends the old one _(Runs)_

- **Why:** Each step keeps its own copy of the request.
- **Fix:** Edit the request inside the step, or remove the step and add the request again. Keep changing parts in [Data Source keys](https://docs.smartestqa.ai/en/data-source-variables.html). See [Each step keeps its own copy](https://docs.smartestqa.ai/en/api-requests-in-tests.html#copy).

### Problem: “Failed to load API request; step not added.” / “No API requests available” _(Automate)_

- **Why:** The request could not be read, for example because it was just deleted in another tab. “No API requests available” means the library of this project is empty; “No results found” means the search matched nothing.
- **Fix:** Close the dialog, refresh the test case and try again, or create the request first in [API Requests](https://docs.smartestqa.ai/en/api-requests-library.html#create-request) or with [**Create from curl**](https://docs.smartestqa.ai/en/automate-steps-api.html#add-api-step).

### Problem: The run cannot reach the API, but Send can (or the other way round) _(Runs)_

- **Why:** Send goes out from the SmartestQA server; a run goes out from the machine that runs the test. See [Where connections are opened from](https://docs.smartestqa.ai/en/data-source-in-tests.html#where-it-connects).
- **Fix:** Run the test where the API is reachable, typically [an agent](https://docs.smartestqa.ai/en/agent-pool-agents.html) inside your network, or open the firewall for the runner.

### Problem: The API step fails with an SSL or certificate error in the run _(Runs)_

- **Why:** [API steps](https://docs.smartestqa.ai/en/automate-steps-api.html) always verify the server’s certificate. Self-signed or expired certificates fail. The test case continues with the next step.
- **Fix:** Use a test endpoint with a valid certificate from a public certificate authority.

### Problem: The API rejects the body in a run (XML or plain text) _(Runs)_

- **Why:** A run sends the body as JSON. A body that is not JSON is sent as a JSON text in quotes, and form-data rows are not sent.
- **Fix:** Use a JSON body where the API allows it, and check the request in the [Dry Run](https://docs.smartestqa.ai/en/automate-dry-run.html) log. See [Bodies in runs](https://docs.smartestqa.ai/en/api-requests-in-tests.html#body-in-runs).

### Problem: The API returned 500, but the step passed _(Runs)_

- **Why:** Any HTTP status counts as a completed call.
- **Fix:** Extract `@status` in the step and add an [assertion](https://docs.smartestqa.ai/en/automate-steps-assertions.html) such as “equals 201” after it. That part is described in **Automate**.
