# Health Status

The Health Messaging Status feature enables you to monitor the status of the WhatsApp Business Account (WABA) and phone number within the Cloud API messaging system.&#x20;

By making the request to the `/health_status` endpoint, you can receive immediate feedback the operational condition of the messaging service, identifying any potential issues or limitations that might be affecting message delivery or system performance.

{% hint style="info" %}
Only WABA and phone number statuses are available today. We are working to make Template Messages statuses available in the near future as well.
{% endhint %}

## API Reference

When you request the `health_status` field, the Messaging API automatically returns the status of both the phone number and WABA account in the same response. Currently, the API does not return the health status of message templates.

## Health Status&#x20;

<mark style="color:blue;">`GET`</mark> `https://waba-v2.360dialog.io/health_status`

**Request Example:**

```
curl --location 'https://waba-v2.360dialog.io/health_status' --header 'D360-API-KEY: {{API_Key}}' --header 'Content-Type: application/json'
```

{% tabs %}
{% tab title="Headers" %}

| Name                                           | Type   |
| ---------------------------------------------- | ------ |
| D360-API-KEY<mark style="color:red;">\*</mark> | string |
| {% endtab %}                                   |        |
| {% endtabs %}                                  |        |

**Expected Outcomes**

{% tabs %}
{% tab title="200: OK " %}

```json
 {
   "health_status": {
    "can_send_message": "<OVERALL_MESSAGING_STATUS>",
    "entities": [
      {
        "entity_type": "PHONE_NUMBER",
        "id": "<BUSINESS_PHONE_NUMBER_ID>",
        "can_send_message": "<BUSINESS_PHONE_NUMBER_MESSAGING_STATUS>"
      },
      {
        "entity_type": "WABA",
        "id": "<WABA_ID>",
        "can_send_message": "<WABA_MESSAGING_STATUS>"
      },
      {
        "entity_type": "BUSINESS",
        "id": "<BUSINESS_ID>",
        "can_send_message": "<BUSINESS_MESSAGING_STATUS>"
      },
      {
        "entity_type": "APP",
        "id": "<APP_ID>",
        "can_send_message": "<APP_MESSAGING_STATUS>"
      }
    ]
  },
  "id": "<NODE_ID>"
}
```

{% endtab %}
{% endtabs %}

## Messaging Health Status Details <a href="#messaging-health-status-2" id="messaging-health-status-2"></a>

When you attempt to send a message, it involves several parts (nodes or entities), such as a WhatsApp Business Account (WABA), a business phone number, and sometimes a message template. Each node has a "health status" assigned to the `can_send_message` property to show if it can send messages:

* `AVAILABLE`: Indicates that the node meets all messaging requirements.
* `LIMITED`: Indicates that the node meets messaging requirements, but has some limitations. If a given node has this value,[ additional info](#additional-info-property) will be included.
* `BLOCKED`: Indicates that the node does not meet one or more messaging requirements. If a given node has this value, the [errors property ](#errors-property)will be included which describes the error and a possible solution.

### Overall Status <a href="#overall-status" id="overall-status"></a>

The overall health status property `can_send_message` will be set as follows:

* If one or more nodes are blocked, it will be set to `BLOCKED`.
* If no nodes are blocked, but one or more nodes are limited, it will be set to `LIMITED`.
* If all nodes are available, it will be set to `AVAILABLE`.

**Example Response:**

```json
{
  "health_status": {
    "can_send_message": "AVAILABLE",
    "entities": [
      {
        "entity_type": "PHONE_NUMBER",
        "id": "106540352242922",
        "can_send_message": "AVAILABLE"
      },
      {
        "entity_type": "WABA",
        "id": "102290129340398",
        "can_send_message": "AVAILABLE"
      },
      {
        "entity_type": "BUSINESS",
        "id": "506914307656634",
        "can_send_message": "AVAILABLE"
      },
      {
        "entity_type": "APP",
        "id": "634974688087057",
        "can_send_message": "AVAILABLE"
      }
    ]
  },
  "id": "106540352242922" 
}
```

### Additional Info Property <a href="#additional-info-property" id="additional-info-property"></a>

If a given node's `can_send_message` property is set to `LIMITED`, the `additional_info` property will be included, which provides additional context for the limitation.

**Example Limited Response**

This is an example response to a request on a business phone number that can be used to send messages, but has a limit on the number it can send because its display name has not been approved.

```json
{
  "health_status": {
    "can_send_message": "LIMITED",
    "entities": [
      {
        "entity_type": "PHONE_NUMBER",
        "id": "106540352242922",
        "can_send_message": "LIMITED",
        "additional_info": [
          "Your display name has not been approved yet. Your message limit will increase after the display name is approved."
        ]
      },
      {
        "entity_type": "WABA",
        "id": "102290129340398",
        "can_send_message": "AVAILABLE"
      },
      {
        "entity_type": "BUSINESS",
        "id": "506914307656634",
        "can_send_message": "AVAILABLE"
      },
      {
        "entity_type": "APP",
        "id": "634974688087057",
        "can_send_message": "AVAILABLE"
      }
    ]
  },
  "id": "105154286024403"
}
```

### Errors Property <a href="#errors-property" id="errors-property"></a>

If a given node's `can_send_message` property is set to `BLOCKED`, the `errors` property will be included, which describes the reason for the status and a possible solution.

#### Example Blocked Response <a href="#example-blocked-response" id="example-blocked-response"></a>

This is an example response to a request on a template that can't be sent in a template message because it is still in a pending state.

{% hint style="info" %}
We plan to introduce the ability to fetch the health status of message templates soon. More information will be provided as it becomes available.
{% endhint %}

```json
{
  "health_status": {
    "can_send_message": "BLOCKED",
    "entities": [
      {
        "entity_type": "MESSAGE_TEMPLATE",
        "id": "2632273056924580",
        "can_send_message": "BLOCKED",
        "errors": [
          {
            "error_code": 141002,
            "error_description": "Message templates can only be sent out if they are approved.",
            "possible_solution": "Edit or appeal the message template review decision."
          }
        ]
      },
      {
        "entity_type": "WABA",
        "id": "102290129340398",
        "can_send_message": "AVAILABLE"
      },
      {
        "entity_type": "BUSINESS",
        "id": "506914307656634",
        "can_send_message": "AVAILABLE"
      },
      {
        "entity_type": "APP",
        "id": "634974688087057",
        "can_send_message": "AVAILABLE"
      }
    ]
  },
  "id": "2632273056924580"
}
```


---

# 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.360dialog.com/docs/messaging/health-status.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.
