A collection is a named group of HTTP requests organized into nested folders. Collections are saved as JSON files on disk. One file holds one collection with all its folders, subfolders, and requests.
A collection contains:
Hook has two tree editors that both operate on the same underlying file:
Both editors expose the same four buttons on the selected tree node:
| Button | Folder selected | Request selected |
|---|---|---|
| + Folder | add a new top-level folder | add a new top-level folder |
| + Subfolder | add a sub-folder under the folder | (disabled – status message: “Select a folder in the tree first”) |
| Rename | rename the folder (collision-checked, case-insensitive) | (status message: redirect to main editor URL/method edit) |
| Delete | delete folder + everything inside (confirmed with descendant counts) | delete the request (confirmed with folder name) |
Requests don’t have a separate name field; the tree label is
METHOD URL, edited through the normal request editor (click
the request, change URL/method, Send or Save).
Use the + Folder, + Subfolder, Rename and Delete buttons under the tree to build and reshape the structure. To move an item to a different parent, delete it and re-add it in the new location, or use the Save in Collection dialog (for requests) which lets you pick any folder as the destination. Drag-and-drop reorder is currently disabled.
The collection file is written to the collections/
directory (or its existing location). If the saved-to collection is
currently active, the sidebar tree refreshes automatically.
Every destructive operation surfaces a Yes / No dialog that names the specific target:
Delete folder 'X' and its N request(s) / M subfolder(s)? This cannot be undone.Delete request 'METHOD URL' from folder 'Y'?Replace request 'METHOD URL' in folder 'Y' with the current editor contents?Delete collection 'X'? The file will be removed from disk.Overwrite 'name.json'?Rename collisions (including case-only changes like foo
-> Foo) are refused silently with a statusbar message –
no dialog, just “Name ‘X’ already used in this folder”.
Select a collection from the toolbar combobox. The collection loads into the sidebar tree. Click a request leaf in either the sidebar or the Collection editor tree to populate the main request editor with all its saved settings.
A collection file has this structure (nested folders via
folders on each folder object):
{
"name": "My API",
"base_url": "https://api.example.com",
"folders": [
{
"name": "Users",
"folders": [
{
"name": "Admin",
"requests": [
{ "method": "GET", "url": "/admin/users", "body_type": 0 }
]
}
],
"requests": [
{
"method": "GET",
"url": "{{base_url}}/users",
"headers": [
{ "name": "Accept", "value": "application/json", "enabled": 1 }
],
"params": [],
"body_type": 0,
"body": "",
"tls_verify": 1,
"timeout_ms": 0
}
]
}
]
}
Body type values: 0 = none, 1 = raw, 2 = JSON, 3 = form, 4 = multipart, 5 = GraphQL.
Since Hook now has full tree-based editing, you rarely need to edit collection JSON by hand, but the format is stable and round-trip safe if you do.
The collection base_url field is available as
{{base_url}} in request URLs. When clicking a collection
request, templates are expanded using both the collection’s
base_url and the active environment variables.
If the same variable (e.g. base_url) is defined in both
the collection and the active environment, the environment value
takes precedence. This allows environments to override the
collection default:
base_url:
https://api.example.combase_url:
https://api.dev.example.comhttps://api.dev.example.com/usersRequest fields tls_custom_ca_file,
proxy_override, and use_curl_backend are
optional and omitted when not set. GraphQL requests include
graphql_query, graphql_variables, and
graphql_operation fields. Auth settings are stored
per-request when the auth type is not “none”.
Hook can import Postman Collection v2.1 JSON files.
In the GUI, click “Import Datas” in the toolbar, then click “Import Postman Collection (.json)” and select the JSON file.
From the CLI:
hook import postman myapi.postman_collection.json -o myapi.json
The imported collection preserves folder structure (including nested folders), request methods, URLs, headers, body, and basic/bearer auth where present.
Hook can import Bruno .bru files. A single .bru file produces a one-request collection. A directory of .bru files (recursive) produces a collection with one folder per subdirectory.
In the GUI, use Import Datas > Bruno and select the file or directory.
From the CLI:
hook import bruno get_users.bru -o myapi.json
hook import bruno ./bruno_collection/ -o myapi.json
To bulk-import an entire directory of Hook collection JSON files:
Each valid collection file is copied into the
collections/ data directory. The toolbar combobox refreshes
automatically.
The collection runner executes all requests in a collection, recursing into subfolders. Requests run in parallel. Each request produces a result with:
In the GUI, open the Runner panel from the sidebar. Select a collection, optionally select an environment, and click Run.
From the CLI, use hook run -f collection.json to execute
the first request. Full collection runs are GUI-only.