---
title: Import requests from curl, HAR and OpenAPI
project: TotalAPI
version: Latest
section: guides
language: en
license: 
url: https://totaljs.es/docs/totalapi/latest/guides/import/
updated: 2026-12-02T15:40:16.062Z
---

# Import requests from curl, HAR and OpenAPI

> Bring requests that you already have: a command that you copied, the traffic that you saved, or the document of an API.

All three are among the commands: press ⇧⌘P on the Mac, or Ctrl+Shift+P on Windows and Linux, and type a word of the name. The last two make a new collection, and ask you where to save it. If you cancel, nothing is imported. For a Total.js app, see [Import a Total.js app](/totalapi/latest/guides/total-js-apps/).

## A curl command

1. Open the collection where you want it. Without one open, a new collection is made, and you choose where to save it.
2. Choose **Add from a curl command…**
3. Paste the command and press **Add**.

The request is added at the end of the list, without checks. TotalAPI reads the address, the method, the headers, the data, the user and password, the cookie and the user agent: the options `-X`, `-H`, `-d` and its longer forms, `--json`, `-u`, `-b`, `-A` and `--url`. It leaves out the other options, such as files and forms with `-F`.

## A HAR file

Choose **A HAR file (from TotalTraffic or a browser)…** It makes a new collection, with a folder for each host and a request for each one of the file, with its address, headers and body.

[TotalTraffic](https://totaljs.es/en/totaldesktop/totaltraffic/) saves the traffic of your apps in this format, and so do the tools of the browsers.

> A HAR file has the cookies and tokens that were sent, and they go to the new collection as they are. Remove them from **Headers** before you share its file.

## An OpenAPI document

Choose **An OpenAPI document…** It must be in JSON: YAML is not read. OpenAPI and Swagger 2 documents work.

It makes a new collection, with a folder for each tag:

- The first server of the document becomes the variable `base`. If the document gives only a path, write the whole address in [the environment](/totalapi/latest/guides/variables/).
- A part of an address such as `{id}` becomes the variable `{{id}}`. Add it to the environment.
- The body has the example of the document, if it has one, and `{}` if not.

The query, the headers and the auth of the document are not imported: add them where you need them.
