> For the complete documentation index, see [llms.txt](https://developer.sahamati.org.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.sahamati.org.in/no-longer-relevent/technical-specifications/router-api-specs/integration-using-simulator/custom-responses-usage.md).

# Custom Responses Usage

This page explains the integration of custom entities and custom responses configured with router APIs.

## Overview:

Using mock entities, developers can simulate the behavior of real entities within a controlled environment. Likewise, mock responses enable developers to define and manipulate the expected outcomes of API calls, replicating various scenarios that may arise in the workflow.

The sample workflow diagrams below illustrates the usage of the Mock Entities and Responses by including entity id and scenario id under headers.

<figure><img src="/files/cDlNdofqtzhtLBXFyhtT" alt=""><figcaption><p>Sample workflow of mocking success scenario</p></figcaption></figure>

<figure><img src="/files/YDRcit6bKgRcTjqNeBLP" alt=""><figcaption><p>Sample workflow of mocking error scenario</p></figcaption></figure>

The following two details are required in the request to use the APIs with custom entity and respective configured response:

* **x-request-meta:** This header specifies the router that will route the request to the respective custom entity created using [Create API](/no-longer-relevent/technical-specifications/router-api-specs/integration-using-simulator/customisation-of-mock-entity-and-responses.md#entity-mock-register).
* **x-scenario-id:** This header should contain the scenario id for the specific response configured for respective entity using [Add response API](/no-longer-relevent/technical-specifications/router-api-specs/integration-using-simulator/customisation-of-mock-entity-and-responses.md#response-add)

#### Sample Request Headers:

<pre class="language-javascript"><code class="lang-javascript">x-request-meta: [Base64 of {"recipient-id": "&#x3C;custom-aa-id>"}]
<strong>x-scenario-id: custom-aa-id-500-error
</strong></code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developer.sahamati.org.in/no-longer-relevent/technical-specifications/router-api-specs/integration-using-simulator/custom-responses-usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
