Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JonathanHerSa/xolo-api-hub/llms.txt

Use this file to discover all available pages before exploring further.

Xolo lets you migrate an existing Postman workflow without starting from scratch. When you import a Postman Collection v2.1 JSON file, Xolo reconstructs the entire folder hierarchy, recreates every saved request with its method, URL, headers, query parameters, and body, and automatically converts a supported subset of Postman test scripts into native Xolo assertion rules — so your validation logic travels with the collection.

Supported Format

Xolo reads Postman Collection v2 JSON (exported from Postman as “Collection v2.1”). The root JSON object must contain:
  • info.name — used as the collection name in Xolo (falls back to "Imported Postman Collection" if absent)
  • item — the top-level array of requests and folders
{
  "info": {
    "_postman_id": "abc-123",
    "name": "My API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [...]
}
The ImportManager.detectFormat() method identifies a Postman file automatically by checking for info._postman_id or a top-level item key, so you can also leave the format picker on Auto-detect.

Import Steps

1

Export from Postman

In Postman, open the collection, click the menu, choose Export, and select Collection v2.1 (recommended). Save the .json file to your device.
2

Open the Import dialog in Xolo

Tap the sidebar menu → ImportCollection. The ImportCollectionDialog opens with source tabs for URL and File, and a format dropdown defaulting to Auto-detect.
3

Select the JSON file

Switch the source toggle to File and tap Select file. The system file picker opens filtered to .json files. Choose the Postman export you saved in step 1.
4

Choose a destination

Leave the destination blank to import into the root workspace, or pass targetCollectionId to nest the collection inside an existing parent. The dialog forwards this value directly to PostmanService.importFromJson().
5

Confirm the import

Tap Import Now. Xolo parses the file, creates the folder hierarchy and requests, and shows a success snackbar. The new collection appears immediately in the sidebar.

What Gets Imported

PostmanService._parseItems() walks the item array recursively. Each element is treated as either a folder (has a nested item array) or a request (has a request object):
FieldPostman sourceNotes
Collection nameinfo.nameTop-level root collection
Folder nameitem[].name with item[].itemNested sub-collections
Request nameitem[].name
Methodrequest.methodUpper-cased; defaults to GET
URLrequest.url.raw or reconstructed from host+path
Query parametersrequest.url.query[]Imported as active key-value pairs
Headersrequest.header[]Imported as active key-value pairs
Body (raw)request.body.mode == "raw"Imported verbatim
Body (urlencoded)request.body.mode == "urlencoded"Converted to pretty-printed JSON map
Descriptionitem[].descriptionStored on collection folders
If a collection or request with the same name already exists under the same parent, Xolo upserts it — updating the existing record rather than creating a duplicate.

Assertion Mapping

PostmanAssertionMapper.fromPostmanEvents() scans every event block where listen == "test" and converts the script lines it recognises into AssertionRuleEntity values stored in the request’s assertionsJson column.
Postman test scriptXolo assertion rule
pm.response.to.have.status(200)statusCode equals 200
pm.expect(json.token).to.existjsonPathExists $.token
Other pm.* testsSkipped (unmapped)
The mapper handles both the pm.expect(json.<field>).to.exist and pm.expect(<obj>.<field>).to.exist regex variants. Mapped rules are encoded as JSON and saved to the request automatically during import.
// PostmanAssertionMapper.fromPostmanEvents() — called inside PostmanService._parseRequest()
final assertionRules = PostmanAssertionMapper.fromPostmanEvents(
  item['event'] as List<dynamic>?,
);
final assertionsJson = PostmanAssertionMapper.encodeRules(assertionRules);
Postman test scripts beyond the mapped subset — including complex JavaScript assertions, pm.test() callbacks with custom logic, response schema validation, and cookie/header assertions — are not imported. A badge on the collection shows the count of lines that were skipped. Review unmapped tests and recreate them manually as Xolo assertion rules.

PostmanService.importFromJson() Reference

Future<void> importFromJson(
  Map<String, dynamic> json,  // Parsed Postman v2 JSON object
  int? parentId,              // ID of the parent collection, or null for root
  AppDatabase db, {
  int? targetCollectionId,    // Import directly into this existing collection ID
}) async
ParameterTypeDescription
jsonMap<String, dynamic>The full parsed Postman collection object
parentIdint?Parent collection ID. Pass null to create at the workspace root
dbAppDatabaseThe active Drift database instance
targetCollectionIdint? (named, optional)Skip root creation and import items directly into this collection
When targetCollectionId is provided, the info.name from the Postman file is ignored for the root-level collection — all items are imported as children of the specified collection.

cURL Import

For one-off requests, Xolo also supports importing a single curl command without creating a new collection.
1

Open the cURL dialog

Tap ImportcURL from the top toolbar (or within any open request tab). The ImportCurlDialog opens with a monospace text area.
2

Paste the curl command

Paste a complete curl command. The command must start with curl; otherwise the parser returns null and displays a validation error.
3

Confirm

Tap Import. CurlParser.parse() extracts the method (-X/--request), URL, headers (-H/--header), and body (-d/--data/--data-raw), then applies them directly to the currently active request tab.
// CurlParser.parse() return type
class ParsedCurl {
  final String method;           // e.g. "POST"
  final String url;              // e.g. "https://api.example.com/users"
  final Map<String, String> headers;
  final String? body;
}
If the curl command contains a body (-d) but no explicit -X flag, CurlParser automatically infers POST as the method.
Postman environment variables (e.g. {{base_url}}, {{token}}) are not imported — Postman environment JSON files are a separate export artifact and are not part of the collection file. After import, recreate your variables in Xolo’s Environments screen and reference them with the same {{variable}} syntax.

Build docs developers (and LLMs) love