Collections & Organization

Collections are the primary way to organize APIs in Maeris. A collection groups related API endpoints together, supports nested sub-collections for domain-level organization, and can be exported or imported in Postman-compatible JSON format for easy migration.

Collection Commands

The following commands manage collections via the CLI:

# List all collections maeris collection list # Create a new collection maeris collection create "My API Collection" # Get details of a specific collection maeris collection get "My API Collection" # Clone a collection maeris collection clone "My API Collection" "My API Collection (Copy)" # Rename a collection maeris collection rename "Old Name" "New Name" # Delete a collection maeris collection delete "My API Collection" # Get statistics (API count, coverage, last modified) maeris collection stats "My API Collection" # Export to Postman JSON format maeris collection export "My API Collection" --output collection.json # Import from Postman JSON maeris collection import collection.json

Sub-Collections

Sub-collections allow you to group APIs by domain, service, or feature within a parent collection. This mirrors the folder structure in Postman.

# List sub-collections within a collection maeris collection subcollections "My API Collection" # Create a sub-collection maeris collection create "Authentication" --parent "My API Collection"

Organizing by Domain

A well-organized collection mirrors your backend service structure. For example: one collection per microservice, with sub-collections for resource types (Users, Orders, Products). This makes it easy for team members to find and run specific endpoint groups.

Postman Import & Export

Maeris uses the Postman Collection v2.1 JSON format for import and export. To migrate an existing Postman collection to Maeris:

# Export from Postman (using Postman app), then import: maeris collection import postman_collection.json # Export a Maeris collection back to Postman format: maeris collection export "My API Collection" --format postman --output exported.json

API Commands

APIs within a collection can be managed individually using the maeris api commands:

# List all APIs in a collection
maeris api list --collection "My API Collection"

# Create a new API
maeris api create --collection "My API Collection" \
  --name "Get User" \
  --method GET \
  --url "{{base_url}}/api/users/{{user_id}}"

# Update an existing API
maeris api update "Get User" --url "{{base_url}}/api/v2/users/{{user_id}}"

# Delete an API
maeris api delete "Get User"

# Move an API to a different collection
maeris api move "Get User" --to "Users Service"

# Clone an API
maeris api clone "Get User" --name "Get User (v2)"

# Search APIs by name or URL pattern
maeris api search "users"

Bulk API Creation

To add multiple APIs at once from a JSON file:

maeris api bulk --collection "My API Collection" --file apis.json

The bulk file format is an array of API objects:

[
  { "name": "List Users", "method": "GET", "url": "{{base_url}}/api/users" },
  { "name": "Create User", "method": "POST", "url": "{{base_url}}/api/users" },
  { "name": "Delete User", "method": "DELETE", "url": "{{base_url}}/api/users/{{id}}" }
]

Next Steps

Once your collection is organized, set up environments to manage base URLs and credentials across staging and production. See the Environments & Variables guide.