Connect your app to real data and services.Import API definitions from Postman, cURL, Swagger, or OpenAPI specs. Rocket generates all the connection code, error handling, and data mapping - you just pick the endpoint and the UI element.You need an existing Rocket project. Do not have one yet? Create one to get started.
API imports are only available on the web browser. They are not supported in the Rocket mobile app.
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 - any service with a REST API.
Your own APIs
Internal microservices, staging environments, or any custom backend you have built.
What you need
Before importing, make sure you have:- An API source in one of these formats:
- Postman workspace and an API key
- A working cURL command
- A Postman collection export file (
postman.json) - A Swagger or OpenAPI spec (JSON or YAML)
- Any environment variables your API definitions reference (e.g.
inventory_api_base_url,accessToken)
If your imported request includes placeholders like
{{base_url}} or {{accessToken}}, the integration step may require you to map them to real values or stored variables.Learn how to manage secret keys in your environment file.
Import APIs into your project
Open the Add APIs dialog
- Open the APIs section.
- Open the Select an API dropdown.
- If no APIs exist yet, click Add APIs.


Success check: The Add APIs dialog opens with import method options.
Choose an import method
Pick one method. You only need to do this once per set of APIs.Postman key (workspace import)
Postman key (workspace import)
Use this when your APIs already live in a Postman workspace.Get your Postman API key:Import into Rocket:

Visit Postman’s documentation to learn how to generate your API key.
- Click your avatar in the Postman header, then click Settings.
- In the account settings page, click API keys.
- If you do not have a key, click Generate API Key.
- Enter a name for your key and click Generate API Key.
- Copy your 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.
- In Add APIs, choose the Postman tab.
- Paste your Postman Key.
- Select the workspace.
- Click Submit.
- Select the collections or folders you want to add.
- Click Add APIs.


Success check: Your Postman collections appear in the API picker.
cURL (single request import)
cURL (single request import)
Use this when you have a working request you can paste.

Make sure the cURL includes the correct URL, headers, and auth format. If it uses environment variables, convert them to your project’s variable format after import.
- In Add APIs, choose the cURL tab.
- Paste the full cURL command.
- Click Add API.


Success check: The API endpoint appears in your API picker.
Upload JSON (Postman export file)
Upload JSON (Postman export file)
Use this when you have a Postman export file.

Same benefit as Postman key import, without requiring workspace access.
- In Add APIs, choose Upload JSON.
- Upload your
postman.json. - Click Submit.


Success check: Your Postman collection endpoints appear in the API picker.
Swagger (OpenAPI import)
Swagger (OpenAPI import)
Use this when your backend provides an OpenAPI spec.

If your spec defines multiple servers, confirm the base URL matches your environment. Confirm auth is described in the spec if you want it preconfigured.
- In Add APIs, choose Swagger.
- Upload the Swagger or OpenAPI JSON or YAML.
- Click Submit.


Success check: All endpoints from your OpenAPI spec appear in the API picker.
Verify the API is available
After import:- Open the Select an API dropdown again.
- Search for the endpoint you want.
- Confirm the method and path look correct.


- The HTTP method matches what you expect (GET vs POST).
- The URL points to the correct base, often a variable like
{{...base_url...}}. - Any required headers and auth placeholders are present.
Success check: Your imported API appears in the dropdown and is searchable.
Integrate an API into a UI element
This connects an endpoint to your screen so Rocket can generate code tied to a real component.Start integration
- Pick the route where this should run (e.g.
/). - Select the API from the API picker.
- Click Integrate API.


Attach to an element
- When prompted, click Ok.
- Click the UI element where you want to integrate the API.
Attach to a stable container element that is always present on the screen. Avoid attaching to conditional elements that might not exist on initial render.


Success check: The element is selected and the integration modal opens.
Configure the integration
After selecting the element, you will see the configuration screen with route, element, API details, and trigger options.

- When the API should run (trigger)
- What happens before the API call (pre-call instructions)
- What happens after the API call (post-call instructions)
- Any required placeholders that need to be resolved
Resolve required placeholders
If your imported API includes placeholders for required fields, you may see a “Missing Attributes” prompt. This means the request depends on a value likeaccessToken and Rocket needs to know where it comes from. Set the placeholder to reference your stored token value, and verify the request uses the correct auth scheme (commonly Authorization: Bearer <token>).


Configure when the API runs
Set the trigger
Choose when the API should run (e.g. on page load).

- On page load for initial data hydration
- On pull to refresh for manual refresh
- On button click for user-initiated actions like “Track”, “Untrack”, “Save”, “Checkout”
Pre-call instructions
Use this to ensure the call will succeed before it runs:- Validate required variables exist (base URLs, IDs, query params)
- Validate auth state (token exists, not expired)
- If token can be refreshed, refresh it here
Clear pre-call instructions help Rocket generate robust error handling code.
Post-call instructions
Define what happens after the call:- 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)
Detailed post-call instructions ensure your UI updates correctly and handles edge cases.
Code generation
After you complete the configuration, Rocket automatically generates the implementation. What it typically produces:- API call wired to the chosen trigger
- Variable resolution (base URL, auth variables)
- State updates (storing response data for UI rendering)
- Optional caching for resilience during temporary failures
- User feedback (notifications on success or failure)
- Navigation flows (e.g. redirect to Login on auth failure)


Success check: The API integration appears under the route and element you intended, and code is generated.
Validation checklist
After integration and code generation, confirm:- The API appears under the correct route and element
- Trigger fires when expected (page load, click, or refresh)
- Required variables resolve correctly (base URL, IDs, headers)
- Auth is applied correctly, especially token prefix rules like
Bearer - Response is stored to a named state variable your UI binds to
- Error handling matches your UX (notification, fallback state, navigation)
Troubleshooting
The API picker is empty
The API picker is empty
Import did not complete, or you imported into a different project. Reopen Add APIs and verify your source.
Fix: Re-import your APIs and confirm they appear in the dropdown.
Integration asks for attributes you did not expect
Integration asks for attributes you did not expect
The imported definition includes placeholders. Map them to known state variables or environment variables.
Fix: Review your API definition and ensure all placeholders are mapped to actual values.
Calls run but UI does not update
Calls run but UI does not update
Most often, response data is not stored to the variable your UI is bound to. Update the Post API call instructions to store the response, then bind your UI list or widget to that stored variable.
Fix: Check your Post API call instructions and ensure response data is stored to a state variable your UI references.
You get 401 Unauthorized
You get 401 Unauthorized
What’s next?
Chat interface
Build and iterate on your app through natural conversation.
Inject custom code
Add scripts, embeds, and UI components from external sources.
Integrations
Some services have dedicated integrations that are simpler than raw API imports.
Code view
Browse files and manage environment variables for your API keys.

