Getting StartedSolveBuildIntelligenceLearnHelpWhat's New
EDITOR

APIs

Import endpoints from Postman collections, cURL commands, or Swagger specs into Rocket.new and bind responses to UI components automatically.

Import API definitions from Postman, cURL, Swagger, or OpenAPI specs. Rocket generates all the connection code, error handling, and data mapping. You pick the endpoint and the UI element.

API imports are only available on the web browser. They are not supported in the Rocket mobile app.

What you can connect

Payment processors

Stripe, PayPal, or any payment API with checkout flows, subscriptions, and invoicing.

Databases and backends

Supabase, Firebase, your own REST API, or any backend that exposes endpoints.

Third-party services

Weather APIs, maps, social media, shipping, SMS, email, and any service with a REST API.

Your own APIs

Internal microservices, staging environments, or any custom backend you have built.


Before you start

You need one of the following:

  • A Postman API key and workspace
  • A working cURL command
  • A Postman collection export file (postman.json)
  • A Swagger or OpenAPI spec (JSON or YAML)

You also need any environment variables your API definitions reference, such as base_url or accessToken.

Learn how to manage secret keys as environment variables.


Open the APIs panel

Click the ... button in the preview toolbar and select APIs.

Toolbar dropdown with APIs option highlighted.Toolbar dropdown with APIs option highlighted.
Opening the APIs panel from the toolbar

Import APIs

In the APIs panel, open the Select an API dropdown and click Add APIs to open the import dialog. Pick one of four import methods.

Use this when your APIs already live in a Postman workspace.

Get your Postman API key:

Visit Postman's documentation to learn how to generate your API key.
  1. Click your avatar in the Postman header, then click Settings.
  2. Go to API keys and click Generate API Key.
  3. Enter a name and copy the key.

Your Postman API key provides access to any Postman data you have permissions for. Keep it private and rotate it if you believe it has been exposed.

Import into Rocket:

  1. In Add APIs, select the Postman tab.
  2. Paste your Postman Key.
  3. Select the workspace.
  4. Click Submit, then select the collections or folders you want to add.
  5. Click Add APIs.
Postman import tab showing key input and workspace selection.Postman import tab showing key input and workspace selection.
Postman key and workspace selection


Integrate an API into a UI element

This connects an endpoint to a screen element so Rocket generates code tied to a real component.

Select a route and API

In the APIs panel, choose the route (the screen or page path, for example /dashboard or /settings) where the API should run, and select the API from the Select an API dropdown. Then click Integrate API.

Route selection and API dropdown with Integrate API button.Route selection and API dropdown with Integrate API button.
Route picker, API dropdown, and Integrate API button

Click a UI element

After clicking Integrate API, element selection activates. A tag bar appears at the top of the preview showing the available elements. Click the UI element where you want to attach the API.

Element tag bar showing div and span options for API attachment.Element tag bar showing div and span options for API attachment.
Element selection bar in API integration mode
Full screen view of element selection with API dropdown and preview visible.Full screen view of element selection with API dropdown and preview visible.
Clicking an element in the preview to attach the API

Attach to a stable container element that is always present on the screen. Avoid conditional elements that may not exist on initial render.

Configure the trigger

After selecting the element, the When to call this API? dialog opens. Fill in:

  • When should this API run (the trigger, e.g. "On page load", "On click of Submit button")
  • Pre API call Instructions (validation, auth checks, token refresh)
  • Post API call Instructions (store response, handle errors, navigate on failure)
When to call this API dialog with trigger, pre-call, and post-call instruction fields.When to call this API dialog with trigger, pre-call, and post-call instruction fields.
When to call this API configuration dialog

Click Submit and Rocket generates the integration code.

Pre-call tips:

  • Validate required variables exist (base URLs, IDs, query params)
  • Check auth state (token exists, not expired)
  • Refresh token here if possible

Post-call tips:

  • Store response data into a named state variable your UI can bind to
  • Cache successful responses to improve performance
  • Handle error states with clear user feedback
  • Navigate when needed (e.g. redirect to login on 401)

Clear pre and post-call instructions help Rocket generate robust error handling code.


Edit an API response

To update a mock or expected response for an API, open the Add/Edit API Response dialog for that endpoint and paste the updated JSON, then click Update.

Add/Edit API Response dialog showing JSON response content.Add/Edit API Response dialog showing JSON response content.
Add/Edit API Response dialog

Troubleshooting


What's next?

On this page