> ## Documentation Index
> Fetch the complete documentation index at: https://bazable.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# bazable export

> Export the Bazable contract as an OpenAPI 3.0 spec or a Postman Collection v2.1.

Exports the contract as an **OpenAPI 3.0** specification (default) or a **Postman Collection v2.1**.

## Usage

```bash theme={null}
bazable export [options]
```

## Options

<ParamField query="-o, --output" default="./openapi.json" type="string">
  Output file path.
</ParamField>

<ParamField query="--format" default="openapi" type="string">
  Output format. One of `openapi` or `postman`.
</ParamField>

<ParamField query="--postman" type="boolean">
  Shorthand for `--format postman`.
</ParamField>

## Postman collection contents

When exporting as Postman, the generated collection includes:

* One request per contract endpoint.
* Pre-generated example request bodies with realistic values (via Faker).
* Test scripts that assert:
  * Response status code is in the 2xx range.
  * If a response schema is defined, each field exists and has the expected type.

## Examples

<CodeGroup>
  ```bash OpenAPI (default) theme={null}
  bazable export -o ./api-spec.json
  ```

  ```bash Postman (shorthand) theme={null}
  bazable export --postman -o postman.json
  ```

  ```bash Postman (explicit) theme={null}
  bazable export --format postman -o postman.json
  ```
</CodeGroup>

<Tip>
  Pair with [`bazable import`](/commands/import) to round-trip contracts to and from OpenAPI, or feed the Postman collection into [`bazable test --newman`](/commands/test) and [Postman Integration](/guides/postman).
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.