<commit_before>---
title: 'Using the API Builder'
order: 81
page_id: 'the_api_workflow'
warning: false
contextual_links:
  - type: section
    name: "Prerequisites"
  - type: link
    name: "Grouping requests in Collections"
    url: "/docs/sending-requests/intro-to-collections/"
  - type: section
    name: "Additional Resources"
  - type: subtitle
    name: "Related Blog Posts"
  - type: link
    name: "Create APIs directly within the Postman app"
    url: "https://blog.postman.com/2019/05/17/postman-7-1-create-apis-directly-within-the-postman-app/"
  - type: section
    name: "Next Steps"
  - type: link
    name: "Managing APIs"
    url: "/docs/designing-and-developing-your-api/managing-apis/"
---

You can design your API directly in Postman using the API Builder. By defining your schema in __APIs__ on the left of Postman, your specification can act as the single source of truth for your API project. The API Builder supports API-first development by allowing you to generate collections from your schema and build your development and testing from there.

[![API Builder](https://assets.postman.com/postman-docs/api-builder-overview.jpg)](https://assets.postman.com/postman-docs/api-builder-overview.jpg)

You can connect various components of your API development and testing process to your schema, such as collections, documentation, tests, mocks, and monitors. You can also version your APIs in Postman and connect elements to specific versions.

* [Creating an API](#creating-an-api)
* [Defining an API](#defining-an-api)
    * [Editing your schema](#editing-your-schema)
    * [Generating a collection](#generating-a-collection)
* [Developing an API](#developing-an-api)
    * [Adding a mock server](#adding-a-mock-server)
    * [Adding documentation](#adding-documentation)
    * [Adding an environment](#adding-an-environment)
* [Testing an API](#testing-an-api)
* [Observing an API](#observing-an-api)

## Creating an API

To access the API Builder, open __APIs__ from the left sidebar in Postman. You can open and edit any existing APIs from here—Postman will automatically open the most recent version of an API by default.

> If it is your first time using the API Builder, you can take a tour of its features by clicking **Start** from the **API** tab or from the **Create new API** modal.

<img alt="Create API" src="https://assets.postman.com/postman-docs/create-new-api-v7.png" width="250px"/>

Click __Create an API__ or __+ New API__—_you will need to be signed into your Postman account_.

![New API](https://assets.postman.com/postman-docs/untitled-api-created-v7.jpg)

Enter a name and a version, then select a schema type and format for your API. You can optionally import an API specification directly at this stage—if you don't, Postman will populate your API with a sample specification you can edit at any time.

<img alt="New API" src="https://assets.postman.com/postman-docs/api-next-steps.jpg" width="300px"/>

> Postman currently supports OpenAPI (versions 1.0, 2.0, and 3.0), RAML (0.8 and 1.0), and GraphQL. Your schema can be defined in JSON, YAML, XML, or GraphQL SDL. Multi-file variants of schemas are currently not supported.

You can rename, delete, or remove the API from the workspace using the __View more actions__ (__...__) menu in the left sidebar.

> When you delete an API or remove it from a workspace, the collections, monitors, mocks, and environments linked to it will not be deleted / removed.

<img alt="Edit API" src="https://assets.postman.com/postman-docs/api-builder-edit-api.jpg" width="250px"/>

> You can create APIs from your workspaces dashboard in the web browser by navigating to __APIs__ and clicking __Create an API__.

You can also [version your APIs](/docs/collaborating-in-postman/versioning-an-api/).

## Defining an API

You can define the structure of your API using its specification. You can also generate a collection from a spec.

* [Editing your schema](#editing-your-schema)
* [Generating a collection](#generating-a-collection)

> You can also [sync an API spec from a GitHub repository](/docs/integrations/available-integrations/github/#syncing-your-api-schemas-on-github).

### Editing your schema

The __Define__ tab in your API will include a specification (either one you imported or a sample Postman added when you created the API).

![Imported Schema](https://assets.postman.com/postman-docs/sample-api-spec.jpg)

The default schema format is Open API 3.0, with JSON as the default language. To use a different schema type or language, choose it from the dropdown list.

The schema editor provides options to beautify the content, wrap text, copy, and search. When you finish editing your schema, click **Save**.

![Save Schema](https://assets.postman.com/postman-docs/beautify-schema.jpg)

> Postman will indicate [validation errors](/docs/designing-and-developing-your-api/validating-elements-against-schema/) as you work on your schema.

### Generating a collection

The Postman API Builder supports API-first development by providing the option to create a Postman collection directly from a schema. Once you have a saved schema, you will see the **Generate Collection** option:

![Schema Editor Options](https://assets.postman.com/postman-docs/api-builder-generate-collection.jpg)

To create a collection based on your schema, click **Generate Collection**. You can add the collection as documentation, a test suite, an integration test, a monitor, a mock server, or a contract test. The collection will appear in __Collections__ in the left sidebar.

![Generate Collection](https://assets.postman.com/postman-docs/api-builder-generate-collection-modal.jpg)

You can also configure how the collection should be generated by clicking **Show advanced settings**.

## Developing an API

Once you have a schema in the Postman API Builder, you can develop your API using version tagging, and link it to mock servers, documentation, and environments.

> When you add documentation, test suites, mocks, monitors, and environments, only the elements in the current workspace will be visible. If an element is already linked to an API, it will not be visible.

* [Adding a mock server](#adding-a-mock-server)
    * [Creating a new mock server](#creating-a-new-mock-server)<commit_msg>schema autocomplete<commit_after>---
title: 'Using the API Builder'
order: 81
page_id: 'the_api_workflow'
warning: false
contextual_links:
  - type: section
    name: "Prerequisites"
  - type: link
    name: "Grouping requests in Collections"
    url: "/docs/sending-requests/intro-to-collections/"
  - type: section
    name: "Additional Resources"
  - type: subtitle
    name: "Related Blog Posts"
  - type: link
    name: "Create APIs directly within the Postman app"
    url: "https://blog.postman.com/2019/05/17/postman-7-1-create-apis-directly-within-the-postman-app/"
  - type: section
    name: "Next Steps"
  - type: link
    name: "Managing APIs"
    url: "/docs/designing-and-developing-your-api/managing-apis/"
---

You can design your API directly in Postman using the API Builder. By defining your schema in __APIs__ on the left of Postman, your specification can act as the single source of truth for your API project. The API Builder supports API-first development by allowing you to generate collections from your schema and build your development and testing from there.

[![API Builder](https://assets.postman.com/postman-docs/api-builder-overview.jpg)](https://assets.postman.com/postman-docs/api-builder-overview.jpg)

You can connect various components of your API development and testing process to your schema, such as collections, documentation, tests, mocks, and monitors. You can also version your APIs in Postman and connect elements to specific versions.

* [Creating an API](#creating-an-api)
* [Defining an API](#defining-an-api)
    * [Editing your schema](#editing-your-schema)
    * [Generating a collection](#generating-a-collection)
* [Developing an API](#developing-an-api)
    * [Adding a mock server](#adding-a-mock-server)
    * [Adding documentation](#adding-documentation)
    * [Adding an environment](#adding-an-environment)
* [Testing an API](#testing-an-api)
* [Observing an API](#observing-an-api)

## Creating an API

To access the API Builder, open __APIs__ from the left sidebar in Postman. You can open and edit any existing APIs from here—Postman will automatically open the most recent version of an API by default.

> If it is your first time using the API Builder, you can take a tour of its features by clicking **Start** from the **API** tab or from the **Create new API** modal.

<img alt="Create API" src="https://assets.postman.com/postman-docs/create-new-api-v7.png" width="250px"/>

Click __Create an API__ or __+ New API__—_you will need to be signed into your Postman account_.

![New API](https://assets.postman.com/postman-docs/untitled-api-created-v7.jpg)

Enter a name and a version, then select a schema type and format for your API. You can optionally import an API specification directly at this stage—if you don't, Postman will populate your API with a sample specification you can edit at any time.

<img alt="New API" src="https://assets.postman.com/postman-docs/api-next-steps.jpg" width="300px"/>

> Postman currently supports OpenAPI (versions 1.0, 2.0, and 3.0), RAML (0.8 and 1.0), and GraphQL. Your schema can be defined in JSON, YAML, XML, or GraphQL SDL. Multi-file variants of schemas are currently not supported.

You can rename, delete, or remove the API from the workspace using the __View more actions__ (__...__) menu in the left sidebar.

> When you delete an API or remove it from a workspace, the collections, monitors, mocks, and environments linked to it will not be deleted / removed.

<img alt="Edit API" src="https://assets.postman.com/postman-docs/api-builder-edit-api.jpg" width="250px"/>

> You can create APIs from your workspaces dashboard in the web browser by navigating to __APIs__ and clicking __Create an API__.

You can also [version your APIs](/docs/collaborating-in-postman/versioning-an-api/).

## Defining an API

You can define the structure of your API using its specification. You can also generate a collection from a spec.

* [Editing your schema](#editing-your-schema)
* [Generating a collection](#generating-a-collection)

> You can also [sync an API spec from a GitHub repository](/docs/integrations/available-integrations/github/#syncing-your-api-schemas-on-github).

### Editing your schema

The __Define__ tab in your API will include a specification (either one you imported or a sample Postman added when you created the API).

![Imported Schema](https://assets.postman.com/postman-docs/sample-api-spec.jpg)

The default schema format is OpenAPI 3.0, with JSON as the default language. To use a different schema type or language, choose it from the dropdown list.

If you're authoring an OpenAPI 3.0 spec you will see autocomplete suggestions as you type.

[![Schema autocomplete](https://assets.postman.com/postman-docs/mock-auto.gif)](https://assets.postman.com/postman-docs/mock-auto.gif)

The schema editor provides options to beautify the content, wrap text, copy, and search. When you finish editing your schema, click **Save**.

![Save Schema](https://assets.postman.com/postman-docs/beautify-schema.jpg)

> Postman will indicate [validation errors](/docs/designing-and-developing-your-api/validating-elements-against-schema/) as you work on your schema.

### Generating a collection

The Postman API Builder supports API-first development by providing the option to create a Postman collection directly from a schema. Once you have a saved schema, you will see the **Generate Collection** option:

![Schema Editor Options](https://assets.postman.com/postman-docs/api-builder-generate-collection.jpg)

To create a collection based on your schema, click **Generate Collection**. You can add the collection as documentation, a test suite, an integration test, a monitor, a mock server, or a contract test. The collection will appear in __Collections__ in the left sidebar.

![Generate Collection](https://assets.postman.com/postman-docs/api-builder-generate-collection-modal.jpg)

You can also configure how the collection should be generated by clicking **Show advanced settings**.

## Developing an API

Once you have a schema in the Postman API Builder, you can develop your API using version tagging, and link it to mock servers, documentation, and environments.

> When you add documentation, test suites, mocks, monitors, and environments, only the elements in the current workspace will be visible. If an element is already linked to an API, it will not be visible.

* [Adding a mock server](#adding-a-mock-server)
    * [Creating a new mock server](#creating-a-new-mock-server)
{'fraction_non_alphanumeric': 0.09550605705353654, 'fraction_numerical': 0.005627198124267292, 'mean_word_length': 4.3946037099494095, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 24, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '376056', 'n_tokens_mistral': 3677, 'n_tokens_neox': 3497, 'n_words': 1514}