# 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: 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://developer.sahamati.org.in/no-longer-relevent/technical-specifications/router-api-specs/integration-using-simulator/custom-responses-usage.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.
