# Managing Mock Apis

Once you have successfully created a collection, now its time to add mock APIs.(You can also import Open API Specifications to create mock APIs, we will discuss that approach in next chapter).

Mock Apis are the basic building blocks of Mocklets. A mock API is a combination of a URL endpoint, headers, HTTP method, and a predefined response body. You can set the API state (Running/Stopped) from the dashboard.

<div align="center"><img src="https://351620034-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LMqeOljOOOW0lUJX3Gm%2F-Ldongd-DRDIuKXRdaVf%2F-LdoniRLITc22ljaMpdS%2FScreenshot%202019-05-02%20at%2012.41.00%20AM.png?alt=media&#x26;token=91db56f0-2d2c-46dd-af29-35279044a52e" alt="Sample api listing"></div>

### **Creating a Mock Api**

There are 2 ways to add mock APIs to your Mocklets Collection, either adding mock APIs manually or through importing Open API Specifications. We will learn how to import Open API Specifications later.

![Api create form](https://351620034-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LMqeOljOOOW0lUJX3Gm%2F-Ldto8o0HG-OM5LZSvUW%2F-LdtqIltQSVGI0rwuD5a%2FScreenshot%202019-05-03%20at%2012.10.23%20AM.png?alt=media\&token=e66b6d1b-e707-440f-b003-cd6d7f4140c8)

Let's walk through the steps of creating your first mock API.

Firstly, set a label, URL endpoint and HTTP method for your mock API. This concludes the request part of your API.

Now, its time to set the response for your API. Set appropriate HTTP status, headers(Content-Type, Content-Encoding), response delay(*optional*) and a response body. You can choose a data type for response body from Content-Type select.

You are all set, now click on **Create Api** button and your API is ready to be used.

Once the API is created, you can make modifications to it. Some of the features that our mock APIs offer is listed below.

{% content-ref url="managing-mock-apis/dynamic-responses" %}
[dynamic-responses](https://docs.mocklets.com/managing-mock-apis/dynamic-responses)
{% endcontent-ref %}

{% content-ref url="managing-mock-apis/url-matching-rules" %}
[url-matching-rules](https://docs.mocklets.com/managing-mock-apis/url-matching-rules)
{% endcontent-ref %}

{% content-ref url="managing-mock-apis/use-api-as-proxy" %}
[use-api-as-proxy](https://docs.mocklets.com/managing-mock-apis/use-api-as-proxy)
{% endcontent-ref %}

{% content-ref url="managing-mock-apis/randomized-responses" %}
[randomized-responses](https://docs.mocklets.com/managing-mock-apis/randomized-responses)
{% endcontent-ref %}

{% content-ref url="managing-mock-apis/response-delay" %}
[response-delay](https://docs.mocklets.com/managing-mock-apis/response-delay)
{% endcontent-ref %}

{% content-ref url="managing-mock-apis/using-query-params" %}
[using-query-params](https://docs.mocklets.com/managing-mock-apis/using-query-params)
{% endcontent-ref %}

{% content-ref url="managing-mock-apis/api-comments" %}
[api-comments](https://docs.mocklets.com/managing-mock-apis/api-comments)
{% endcontent-ref %}

These steps contain detailed feature descriptions and their functionality.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mocklets.com/managing-mock-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
