# Create an Endpoint

To create an endpoint, navigate to the Endpoints section by simply click on the *Endpoints* link on the side menu of your dashboard.

On the Endpoints page, you will see a list of existing endpoints if any, then click on the [*Create Endpoint*](https://mockapi.com/Endpoints/Create) button at the top of the table list.

<figure><img src="/files/yy1g40aV5mA5DULHxX6f" alt=""><figcaption><p>Create an Endpoint</p></figcaption></figure>

On the endpoint creation page, start by entering the endpoint you want to create, then for any request type you want to setup for that endpoint, click on the plus (+) button beside it to expand it, then click on the plus (+) button below the Responses to add a new response for that request type.

When associating a response to a request type, select the response code (200 OK, 404, Not Found, etc), and then select a model from the range of existing models in the project.

<figure><img src="/files/kIsi2Ssh2bcfkmfULdUO" alt=""><figcaption><p>Endpoint creation page</p></figcaption></figure>

#### Advanced Configuration

<figure><img src="/files/gYeYcZFDaHBaTBwinTZb" alt=""><figcaption></figcaption></figure>

Each request type can be configured to conditionally return different response codes and models when an API call is made to that endpoint with that request type. This can be helpful when you want to mimic unexpected response like it may happen in a real world scenario to see how your application handles it.

For eg: Let's say an expected response will be to return a 200 response code with a User model as response data, other responses can be added for a 404 Not-Found response, 401 Unauthorized or 500 Internal Server Error, so that any of this responses will return randomly when an API call is made for this endpoint and request type.

The probability of each response returning can be configured by clicking on the *Settings* button beside the model selection input. Clicking on the *Settings* button will open an *Advanced Configuration* dialog box where the Return rate for that response can be set. The higher the response rate, the higher chance of that response returning for each API call.

The response can be returned as an array or list of the selected model along with the size of list to return. This can also be set from the *Advanced Configuration* dialog box.


---

# 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.mockapi.com/endpoints/create-an-endpoint.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.
