Import and Export
Import and Export
Bring in APIs from OpenAPI, Postman and cURL, and turn requests into code.
Overview
You don't need to build requests by hand when an API is already described somewhere. Relay imports OpenAPI 3.0 and 3.1 specs, Postman collections and environments, OpenCollections and cURL commands, and turns them into collections, environments and drafts. It can also copy a collection or a whole workspace from a Relay workspace folder.
Going the other way, Relay turns any request into code for curl, HTTPie, JavaScript, Python, Swift, Go and other languages. If the built-in generators don't fit, you can write your own in JavaScript.
Topics
Importing
- Importing cURL commands: Turn a cURL command into a draft request.
- Importing OpenAPI specs: Create a collection of requests from an OpenAPI 3.0 or 3.1 spec.
- Importing Postman collections and environments: Bring Postman collections, with their folders, auth and scripts, and Postman environments into Relay.
- Importing Relay collections and workspaces: Copy a collection or a whole workspace from a Relay workspace folder.
Exporting
- Generating code from requests: Turn a request into code for curl, Python, JavaScript, Swift and other languages.
- Creating a custom code generator: Write a JavaScript generator that turns requests into code in the form you need.
See Also
- Code Generator API: The manifest, request model and helpers for writing code generators.
- Supported formats: The import formats, body types, auth types and limits Relay supports.