---
title: "The API library"
section: "API Requests"
description: "Organize SmartestQA API requests: New Request, collections, folders, duplicate and drag and drop, and imports from Postman collections, Swagger / OpenAPI specs and curl commands."
url: https://docs.smartestqa.ai/en/api-requests-library.html
audience: [customer, admin]
updated: 2026-11-08
keywords: "api tree new request add collection add folder rename duplicate delete drag drop import postman collection swagger openapi yaml json curl paste"
---
# API Requests: The API library: collections, folders and imports

The tree on the left of API Requests is the project’s API library. This page covers creating and organizing requests and bringing in existing ones from Postman, Swagger / OpenAPI or curl.

## In short

**On this page you can**

- Create requests, collections and folders in the API tree.
- Rename, duplicate, move by drag and drop, and delete items.
- Import a Postman collection JSON file.
- Import a Swagger / OpenAPI spec from a file or a URL.
- Turn a curl command into a filled request by pasting it.

**How to use it**

1. Click More › Add Collection and name the collection.
2. Select it and click New Request , or use the item menu › Add Request .
3. Or import: More › Import Postman or Import Swagger / OpenAPI .
4. Paste a curl command into Request URL to fill a request.
5. Drag requests into folders; use the item menu to rename or duplicate.

## Create a request

1. **Pick where it goes**

   Select a collection or folder in the tree. With nothing selected, the request goes to the top of the tree.
2. **Click New Request**

   Click **New Request** above the tree, or **Add Request** in a collection’s or folder’s menu. The request is created as “New Request” (“New Request 1”, “New Request 2”… when the name is taken there) and opens in the middle.
3. **Name it**

   The new name is ready to type in the tree. Later, click the name at the top of the request to change it, for example to “Create order”. `Enter` or leaving the field saves the name at once (“Name updated successfully”); `Esc` cancels. An empty name is not accepted.
4. **Fill and save**

   Choose the method, enter the URL and body, then click **Save**. See [Edit and send a request](https://docs.smartestqa.ai/en/api-requests-editor.html).

   “API data saved”. The tree shows the request with its method chip.

## Collections and folders

- **Collection:** **More** › **Add Collection**. Collections stay in the order they were created.
- **Folder:** **More** › **Add Folder**, or **Add Folder** in a collection’s or folder’s menu. Folders and requests are sorted by name.
- **Item menu:** hover an item and click its menu (“Drag to move • Click for options”): **Add Folder**, **Add Request**, **Rename**, **Duplicate** (requests only), **Delete**.
- **Search:** the filter icon searches request, folder and collection names (“No match found for search”).
- **Collection or folder selected:** the middle shows “Collection selected” or “Folder selected”, the number of items (**Content**: *n* **items**), and a hint to set its authorization; see [Inherited authorization](https://docs.smartestqa.ai/en/api-requests-editor.html#inherit-auth).

![The More menu and an item menu.](https://docs.smartestqa.ai/media/shots/API-SHOT-02.png)

### Duplicate

**Duplicate** on a request creates “*name* Copy” next to it with the same method, URL, headers, parameters, body and authorization. Collections and folders cannot be duplicated.

### Move

Drag a request or folder onto a collection or folder to move it inside. Drop it on a request to move it next to that request. Collections and the top folder cannot be moved; a folder cannot be dropped into its own sub folder. A failed move shows “Error during update.”

### Delete

- Item menu › **Delete**: “Delete "*name*"?” and “This action cannot be undone.”
- Deleting a folder or collection deletes everything inside it. If it is not empty, only an [Admin](https://docs.smartestqa.ai/en/company-settings-roles.html) can delete it; others see “Folder *name* could not be deleted.” or “Collection *name* could not be deleted.”
- [API steps](https://docs.smartestqa.ai/en/automate-steps-api.html) that were made from a deleted request keep working: each step has its own copy. See [Each step keeps its own copy](https://docs.smartestqa.ai/en/api-requests-in-tests.html#copy).

## Import a Postman collection

1. **Export from Postman**

   In Postman, export the collection as a JSON file. The file must contain the collection’s `info` and `item` parts.
2. **Open the import**

   **More** › **Import Postman**. The dialog **Postman Collection Import** opens: “Select your Postman collection JSON file”.
3. **Pick the file and import**

   Click **Select File** (only `.json`), then **Import**.

   “*n*/*total* requests imported successfully!” A new collection with the Postman collection’s name appears.

| From Postman | Becomes |
| --- | --- |
| Collection | A new collection (“Imported Collection” when it has no name) |
| Folder | A folder |
| Request | A request with method, URL, query parameters and headers |
| Body: raw, form-data, x-www-form-urlencoded | The body or form-data rows |
| Auth: Basic, Bearer | [**Basic Auth**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization), [**Bearer Token**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization); anything else **None** |
| Variables such as `{{baseUrl}}` | Kept as text |

Postman variables are not imported. A run reads a name without prefix from Data Source only when the reference is the whole value, so `{{baseUrl}}/users` is not filled ([resolution order](https://docs.smartestqa.ai/en/automate-test-data.html#resolution)). Create a key `baseUrl` in [Variables](https://docs.smartestqa.ai/en/data-source-variables.html#create-key) and replace `{{baseUrl}}` with `{{ds:baseUrl}}`. **Send** on this page does not fill `{{baseUrl}}`; see [What Send sends](https://docs.smartestqa.ai/en/api-requests-editor.html#what-send-sends).

## Import a Swagger / OpenAPI spec

1. **Open the import**

   **More** › **Import Swagger / OpenAPI**. The dialog **Import from Swagger / OpenAPI** has two tabs.
2. **Give the spec**

   - **URL**: the **Swagger JSON URL**, for example `https://api.example.com/v3/api-docs`. “Use the JSON endpoint, not the Swagger UI page”. The spec is downloaded by the SmartestQA server, so CORS is usually not a problem.
   - **File Upload**: a JSON or YAML file (`.json`, `.yaml`, `.yml`), processed on the server.
3. **Import**

   “Imported *n*/*total* endpoints successfully!” A collection with the API’s title appears, with one folder per tag.

| From the spec | Becomes |
| --- | --- |
| API title | The collection name |
| First tag of an operation | The folder it goes into (none: the collection itself) |
| Summary, else operationId, else “METHOD path” | The request name |
| Server URL + path | The URL |
| Path parameters | Their default value in the URL, or the placeholder `{id}` when there is none |
| Query and header parameters | **Params** and **Header** rows with their default values |
| Request body schema or example | An example JSON body and `Content-Type: application/json` |

Security schemes are not imported: set the authorization on the collection afterwards. Replace placeholders such as `{id}` with a value or a reference like `{{tc:orderId}}` before you send.

## Paste a curl command

Paste a curl command into [**Request URL**](https://docs.smartestqa.ai/en/api-requests-editor.html#request-line) (placeholder “Enter URL or paste text”). SmartestQA recognizes it and fills the request: “Curl imported.”

Example · copied from the browser’s developer tools

```bash
curl -X POST 'https://test.shop.example.com/api/orders?source=web' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer eyJhbGciOi…' \
  --data-raw '{"productId": 42, "quantity": 1}'
```

| curl | Becomes |
| --- | --- |
| `-X` / `--request` | The method. Without it: POST when there is data, else GET (`-G` forces GET). |
| The URL | The URL, query string kept; the query is also listed under **Params** |
| `-H` | **Header** rows |
| `-d`, `--data`, `--data-raw`, `--data-binary`, `--data-urlencode` | The raw body (several are joined with `&`) |
| `-F` / `--form` | form-data rows |
| `-u user:pass` or `Authorization: Basic …` | [**Basic Auth**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization) |
| `Authorization: Bearer …` | [**Bearer Token**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization) |
| `-s`, `-L`, `-k`, `-i`, `-v`, `--compressed` and similar | Ignored |

> **Warning: Replace pasted tokens**
>
> A curl copied from the browser carries a real token. After pasting, replace it with `{{ds:apiToken}}` from an [encrypted key](https://docs.smartestqa.ai/en/data-source-secrets.html#encrypt). A Basic login becomes [**Basic Auth**](https://docs.smartestqa.ai/en/api-requests-editor.html#authorization), which a test run does not apply; see [Authorization in runs](https://docs.smartestqa.ai/en/api-requests-in-tests.html#auth-in-runs).

In Automate you can also create a request and its step in one go with [**Create from curl**](https://docs.smartestqa.ai/en/automate-steps-api.html#add-api-step); see [From a curl command](https://docs.smartestqa.ai/en/api-requests-in-tests.html#from-curl).

## If something goes wrong

- [“Invalid Postman collection format”](https://docs.smartestqa.ai/en/api-requests-troubleshooting.html#fix-postman-invalid)
- [“This looks like a Swagger UI page, not the JSON spec…”](https://docs.smartestqa.ai/en/api-requests-troubleshooting.html#fix-swagger-ui-page)
- [“No URL found in the curl command.”](https://docs.smartestqa.ai/en/api-requests-troubleshooting.html#fix-curl)
- [“Folder … could not be deleted.”](https://docs.smartestqa.ai/en/api-requests-troubleshooting.html#fix-delete-folder)
