Introduction
This guide will walk you through creating your first API collection and making your first request with Bruno. You’ll learn the basics of Bruno’s interface and workflow.Creating Your First Collection
Launch Bruno
bruno in your terminal.Create a new collection
- Click “Create Collection” on the welcome screen
- Choose a name for your collection (e.g., “My API Tests”)
- Select a location on your filesystem to store the collection
- Click “Create”
Verify collection creation
collection.bru file.Making Your First Request
Let’s make a simple GET request to test Bruno.Create a new request
- Right-click on your collection name in the sidebar
- Select “New Request”
- Name it “Get Users”
- Click “Create”
Configure the request
- Select GET as the HTTP method (default)
- Enter the URL:
https://jsonplaceholder.typicode.com/users - Click the “Send” button
View the response
- Status: 200 OK
- Response Time: ~100-500ms
- Body: JSON array of user objects
Understanding the Request File
Bruno saved your request as a.bru file. Let’s look at what it contains:
- Version control with Git
- Review changes in pull requests
- Share with team members
- Edit directly in your code editor
Making a POST Request
Let’s create a more complex request with headers and a JSON body.Create a POST request
- Right-click your collection
- Select “New Request”
- Name it “Create User”
- Click “Create”
Set the method and URL
- Change the method to POST
- Enter URL:
https://jsonplaceholder.typicode.com/users
Add request headers
Add request body
- Click on the “Body” tab
- Select “JSON” from the dropdown
- Enter the following JSON:
Send the request
.bru file now looks like this:
Using Environment Variables
Environment variables let you reuse values across requests and switch between environments (development, staging, production).Create an environment
- Right-click on your collection
- Select “Environments” > “Configure”
- Click “Create Environment”
- Name it “Development”
Add variables
Use variables in requests
Select the environment
environments/Development.bru:
Adding Tests and Assertions
Bruno supports assertions and JavaScript tests to validate API responses.Add simple assertions
Add JavaScript tests
Run and verify
.bru file now includes tests:
Running Collections with CLI
Bruno CLI allows you to run your entire collection from the command line.Navigate to your collection
Run all requests
Run specific requests
Use with environments
Save results
Organizing Requests with Folders
As your collection grows, organize requests into folders:Create a folder
- Right-click on your collection
- Select “New Folder”
- Name it “Users”
Move requests
Add folder-level scripts
Git Integration
One of Bruno’s biggest advantages is seamless Git integration.Initialize Git (if not already)
Create .gitignore
.gitignore file to exclude sensitive data:Commit your collection
Collaborate with your team