# Query message notification server IP addresses (/en/api-reference/api-ref/cloud-recording/get-ncs-ip)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Queries the IP address or IP address list of the message notification server.

- OpenAPI: /openapi/cloud-recording/cloud-recording.en.yaml
- Operation ID: get-ncs-ip
- Method: GET
- Path: /v1/ncs/ip
- Endpoint: https://api.sd-rtn.com/v1/ncs/ip

## Servers

- https://api.sd-rtn.com

The Agora message notification service notifies your server of Cloud Recording events through HTTPS requests. Agora dynamically adjusts the IP addresses of the message notification server. Call this endpoint regularly and update your firewall configuration whenever the addresses change.


:::info[Note]
Query the IP addresses at least once every 24 hours and update your firewall whitelist automatically to avoid interruptions in notification delivery.
:::

## Authorization

This endpoint requires authentication.

- `basicAuth`

## Parameters

No parameters.

### Request

- This endpoint has no path parameters or request body.


## Request body

No request body.

## Request examples

### curl

```bash
curl --request GET \
    --url https://api.sd-rtn.com/v1/ncs/ip \
    --header 'Authorization: Basic <credentials>'
```

### Python

```python
import requests

  url = "https://api.sd-rtn.com/v1/ncs/ip"
  headers = {
      "Authorization": "Basic <credentials>"
  }

  response = requests.get(url, headers=headers)

  print(response.status_code)
  print(response.json())
```

### Node.js

```javascript
const axios = require('axios');

  const url = 'https://api.sd-rtn.com/v1/ncs/ip';
  const headers = {
    'Authorization': 'Basic <credentials>'
  };

  axios.get(url, { headers })
    .then(response => {
      console.log('Status:', response.status);
      console.log('Data:', response.data);
    })
    .catch(error => {
      console.error('Error:', error.response ? error.response.data : error.message);
    });
```


### Response

- If the returned status code is `200`, the request was successful. Only the `primaryIP` field in the response body is relevant; the response header and all other fields can be ignored.

- If the returned status code is not `200`, the request failed. See [Response status codes](/en/realtime-media/cloud-recording/reference/common-errors#status-codes) for troubleshooting.


## Responses

### 200

The request succeeded. You only need to use the `primaryIP` field in the response body.

- `data` (object)
  - `data.service` (object)
    - `data.service.hosts` (array)
      - `data.service.hosts.items` (object)
        - `data.service.hosts.items.primaryIP` (string) - IP address of the Agora message notification server.

## Response examples

### 200

```json
{
  "data": {
    "service": {
      "hosts": [
        {
          "primaryIP": "xxx.xxx.xxx.xxx"
        },
        {
          "primaryIP": "xxx.xxx.xxx.xxx"
        }
      ]
    }
  }
}
```
