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

# Creating Mock API with API Creator

> You can easily and quickly create REST APIs without requiring technical knowledge or software development with Mock API. You can upload Blank and Spec files, create endpoints, manage conditional responses, and create Swagger and OpenAPI documentation

<CardGroup cols={2}>
  <Card title="Quick API Creation" icon="rocket">
    An API can be instantly created through API Documentation or containing default CRUD operations, and instantly opened to users' access as an API Proxy.
  </Card>

  <Card title="Conditional Responses" icon="code">
    Apinizer enables **obtaining different responses according to conditions** based on request header, body, or parameter values thanks to conditions added to the response.
  </Card>

  <Card title="API Documentation" icon="file-code">
    API definition documents of Swagger and OpenAPI types for created Mock APIs can be accessed on the fly in JSON and YAML formats.
  </Card>
</CardGroup>

## Creating New Mock API

<Steps>
  <Step title="Go to Mock API Page from Menu">
    **Development → API Creator → Mock API** item is selected in the main menu.
  </Step>

  <Step title="Create New API">
    The **+Create** button at the top right of the opened interface is clicked.

    <img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock1.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=6e0105fd85e24fcc5337c595bfb97e01" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock1.png" />
  </Step>

  <Step title="Fill API Information">
    Required fields for the new *API* to be created are filled and the **→Save and Next** button at the top right is clicked, starting the *API* creation process.
  </Step>
</Steps>

<AccordionGroup>
  <Accordion title="Creating Mock API of Blank Type">
    Creating an API of this type means that API endpoints will be designed by the user.

    <Info>
      If the **Generate CRUD Operations** option is enabled, GET, POST, PUT, DELETE endpoints are automatically added to the API.
    </Info>

    <img src="https://mintcdn.com/apinizer/xcpaeYP822whFSPn/images/develop/api-proxy-olusturma/mpck-api-create-ekran%C4%B1.png?fit=max&auto=format&n=xcpaeYP822whFSPn&q=85&s=9bfcb846858ebd278300b29286a68329" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mpck-api-create-ekranı.png" />
  </Accordion>

  <Accordion title="Creating Mock API from Open API or Swagger">
    Creating an API of this type means that the API will be created from its definition document.

    The type of API document to be imported or whose link will be given must be Swagger or Open API.

    <img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock3.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=1554a5aca677c9f8bfc7087269f76e76" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock3.png" />
  </Accordion>
</AccordionGroup>

### Mock API Definition Fields

Fields used for Mock API definition are shown in the table below.

| Field                        | Description                                                                                                    |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **Type**                     | Mock API Creation type. Done by Blank and uploading Spec file.                                                 |
| **Name**                     | The name given to the API by the user. This name appears in interfaces.                                        |
| **Description**              | Definition information of the API.                                                                             |
| **Generate CRUD Operations** | Selected if ready method/endpoints of GET, POST, PUT, and DELETE types are desired to be created for Mock API. |
| **API Spec Type**            | Type information of the Spec file to be uploaded. Supported types: OpenAPI 3.0.x, Swagger 2.x                  |
| **Import Type**              | Type information of the Spec file to be uploaded. Supported types: URL, Upload File                            |
| **URL**                      | Address of the Spec file to be uploaded.                                                                       |

## Endpoint Creation

<Info>
  If the *Generate CRUD Operations* option is selected, method/endpoints of GET, POST, PUT, DELETE types will come ready by default.
</Info>

<Steps>
  <Step title="Add Endpoint">
    A new method/endpoint is added by clicking the **Add** button.

    <img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock4.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=7e1bb66b72c277ff69be41b577cf621d" alt="Image 2024 9 9 15 35 35 Pn" width="400" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock4.png" />
  </Step>

  <Step title="Fill Endpoint Information">
    Method/endpoint is added to the API by clicking the **Add** button on the screen that appears. Fields in the *Method/Endpoint* definition screen are filled and the **Save** button is clicked.

    <img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock5.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=811fb2f6e9c49e715233387d2337d246" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock5.png" />
  </Step>
</Steps>

### Adding or Editing Response

Responses belonging to method/endpoint are managed from the Response Information section.

<Info>
  Response definitions are created grouped according to Status Code information. Multiple example responses based on conditions can be created within each response definition.
</Info>

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock6.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=4dd1c59554466d1b6701ba45353ee517" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock6.png" />

Fields used for response add/edit configuration are shown in the table below.

| Field                 | Description                                |
| --------------------- | ------------------------------------------ |
| **Status Code**       | HTTP status code information.              |
| **Description**       | Definition information of Method/Endpoint. |
| **Headers**           | HTTP Headers information is entered.       |
| **Response Examples** | Response examples to be sent to the user.  |

### Adding or Editing Response Examples

Examples can be added by creating multiple body and condition definitions for a response definition. Thus, when a request comes to the same method, different responses can be sent to the client under different conditions.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock7.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=74da1c9c73cc91551a8fdae0e57e0f09" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock7.png" />

Fields used for Example Response add/edit configuration are shown in the table below.

| Field             | Description                                                                         |
| ----------------- | ----------------------------------------------------------------------------------- |
| **Content Type**  | Content type of the body that will be returned as a response.                       |
| **Condition**     | Used to define under which condition the defined example response will be returned. |
| **Response Body** | The body of the response to be returned to the user is written.                     |

## Creating API Proxy from Mock API

When there is at least one method/endpoint, an API Proxy is created for Mock API by clicking the **Create API Proxy** button.

<Info>
  At least one method/endpoint must exist to create an API Proxy from Mock API.
</Info>

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock8.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=c6670acc03eaff89297437574fcad304" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock8.png" />

The API Proxy is created by entering the required fields for the API Proxy on the screen that appears and clicking the **Save** button.

After this step, what can be done is exactly the same as the API Proxy document. You can refer to the [API Proxy Creation](/en/develop/api-proxy-creation/api-proxy-creation) page for details.

## Deploy/Redeploy

The window opened by clicking the **Manage API Proxies** link is used to view and manage deployment statuses of API Proxies in Mock API.

In the opened window, Deploy/Undeploy and Redeploy operations for API Proxies created with Mock API are performed in this section. You can refer to the [Deployment, Redeployment, Undeployment, Deployment History and Rollback](/en/develop/deployment-and-version-management) page for details.

To deploy the API Proxy, the following steps are followed.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock9.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=5e5915f13db9ce3d4f2d7522126af283" alt="Image 2024 9 9 15 35 35 Pn" width="600" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock9.png" />

After the above operation, confirmation is required. Information about the deployment operation is created and the **(Deploy) Deploy** button is clicked.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock10.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=8f9544243aae3a078f47bd7dc393b19b" alt="Image 2024 9 9 15 35 35 Pn" width="600" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock10.png" />

<Warning>
  When a new endpoint is added to Mock API or changes are made within an endpoint, all API Proxies created from this API must be redeployed for the changes to take effect.
</Warning>

When you add a new Method/Endpoint or update an existing Method/Endpoint, a notification like the following will appear.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock11.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=24ddba17ea455068e82e113a1af1050c" alt="Image 2024 9 9 15 35 35 Pn" width="600" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock11.png" />

By saying **Redeploy**, changes are applied to API Proxies.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock12.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=f07d8960b1c084a526f3a5b1493a3a5c" alt="Image 2024 9 9 15 35 35 Pn" width="600" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock12.png" />

After the above operation, confirmation is required. Information about the redeployment operation is created and the **(Redeploy) Redeploy** button is clicked.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock13.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=6db2b2343a939609fd97051a7437455a" alt="Image 2024 9 9 15 35 35 Pn" width="600" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock13.png" />

From the Mock API page, go to the API Proxy by clicking the API Proxy's name.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock14.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=ac12e68c368f895a7b63e1b119ec4b39" alt="Image 2024 9 9 15 35 35 Pn" width="600" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock14.png" />

Similarly, to go to the Mock API page from the API Proxy page, go by clicking the Mock API name in the API Proxy as shown below.

<img src="https://mintcdn.com/apinizer/ZcdqzXb0ZF1OeNQr/images/develop/api-proxy-olusturma/mock15.png?fit=max&auto=format&n=ZcdqzXb0ZF1OeNQr&q=85&s=5323c4d3e26099cebca1d4dc55323b1a" alt="Image 2024 9 9 15 35 35 Pn" width="600" className="mr-auto" data-path="images/develop/api-proxy-olusturma/mock15.png" />

## Mock API Deletion

When a Mock API is deleted, all API Proxies connected to it are first removed (undeploy) and then deleted.
