> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/apis/assertion/response-body-equals.md).

# Response body equals

This is a pre-built action available under the **@Assertion** element type. The action validates whether the complete API response body matches the expected response body. The actual response body value stores the actual response body, and keyword status stores the validation result as **True** or **False**.

{% hint style="info" %}
**Note**: An API request must be added and executed successfully before configuring or evaluating API Assertions.
{% endhint %}

## Syntax

**Input Value**: `<Expected response body>`

| Argument                                         | Description                                                                                       |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| <p>\<Expected response body> <br>(Required) </p> | Provide the expected response body value which you want to compare with actual API response body. |

**Output Value**: `<Actual response body>(optional);<Keyword status>(optional)`

| Argument                                       | Description                                                                          |
| ---------------------------------------------- | ------------------------------------------------------------------------------------ |
| <p>\<Actual response body> <br>(optional) </p> | The actual response body stores the actual response body received from the API call. |
| <p>\<Keyword status> <br>(optional) </p>       | The action status stores the execution result as **True** or **False**.              |

### **Example: Validating an Exact API Response Body**

In this example, we explain how to validate that the response body received from an API call exactly matches the expected response body.

* **Action:** Response body equals
* **Input Value:** { "first\_name": "John", "last\_name": "Doe", "phone": "8765678987", "email": "<johndoe@gmail.com.com>", "id": 205 }
  * The value **{ "first\_name": "John", "last\_name": "Doe", "phone": "8765678987", "email": "<johndoe@gmail.com.com>", "id": 205 }**, specifies the expected response body that the actual API response must match exactly.
* **Output Value:** {ActualResponseBody};{Status}
  * The first output variable **{ActualResponseBody}** stores the actual response body received from the API.
  * The second output variable **{Status}** stores the execution result:
    * **True:** If the actual response body exactly matches the expected response body.
    * **False:** If the actual response body does not match the expected response body.
* **Logical Explanation:** The **Response body equals** action fetches the expected response body from the **Input Value** column and compares it against the actual response body received from the API call. If the **{ActualResponseBody}** variable is defined, it stores the actual response body received. If the expected and actual response body match exactly, the **{Status}** variable stores **True**, otherwise **False**.

![](https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FMPN28w8S3UfR0yNotPCD%2Funknown.png?alt=media\&token=70d9397e-d47f-4311-bd1d-4801cb127665)


---

# 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://docs.avoautomation.com/avo-assure/actions/apis/assertion/response-body-equals.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.
