> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dncscrub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RND Basic (POST)

> Batch query the FCC Reassigned Number Database

Batch query the FCC Reassigned Number Database (RND) to check if multiple phone numbers have been reassigned after given dates.

<Warning>
  The FCC Reassigned Number Database only has complete data after **January 27, 2021**. Numbers with consent dates prior to this date will typically return a blank `IsReassigned` value.
</Warning>

## Request

### Headers

<ParamField header="loginId" type="string" required>
  Your API Key (LoginId from your DNCScrub account)
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Request Body

<ParamField body="data" type="array" required>
  Array of phone number objects to check (maximum 1,000 per request)

  <Expandable title="data object properties">
    <ParamField body="phoneNumber" type="string" required>
      10-digit North American phone number (without leading 1 or +)
    </ParamField>

    <ParamField body="date" type="string" required>
      Consent date in format `YYYYMMDD`, `MM/DD/YYYY`, `YYYY-MM-DD`, or `MM/DD/YY`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="useSandbox" type="boolean">
  (Optional) Set to `true` to use sandbox mode for testing
</ParamField>

<ParamField body="ProjId" type="string">
  Project identifier for tracking purposes
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request POST \
    'https://dataapi.dncscrub.com/v1.5/Data/RNDBasic' \
    --header 'loginId: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "Data": [
        { "phoneNumber": "5039367187", "date": "20211014" },
        { "phoneNumber": "7075276405", "date": "20211122" }
      ]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://dataapi.dncscrub.com/v1.5/Data/RNDBasic',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'loginId': 'YOUR_API_KEY'
      },
      body: JSON.stringify({
        Data: [
          { phoneNumber: '5039367187', date: '20211014' },
          { phoneNumber: '7075276405', date: '20211122' }
        ]
      })
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```csharp C# theme={null}
  using (var client = new HttpClient())
  {
      client.DefaultRequestHeaders.Add("loginId", "YOUR_API_KEY");

      var requestData = new
      {
          Data = new[]
          {
              new { phoneNumber = "5039367187", date = "20211014" },
              new { phoneNumber = "7075276405", date = "20211122" }
          }
      };

      var content = new StringContent(
          JsonSerializer.Serialize(requestData),
          Encoding.UTF8,
          "application/json"
      );

      var response = await client.PostAsync(
          "https://dataapi.dncscrub.com/v1.5/Data/RNDBasic",
          content
      );

      var result = await response.Content.ReadAsStringAsync();
      Console.WriteLine(result);
  }
  ```
</CodeGroup>

<ResponseExample>
  ```json Response theme={null}
  [
    {
      "PhoneNumber": "5039367187",
      "IsReassigned": false,
      "HasSafeHarbor": true,
      "IsSandBox": false
    },
    {
      "PhoneNumber": "7075276405",
      "IsReassigned": false,
      "HasSafeHarbor": true,
      "IsSandBox": false
    }
  ]
  ```
</ResponseExample>

## Response Fields

Each object in the response array contains:

<ResponseField name="PhoneNumber" type="string">
  The phone number that was checked
</ResponseField>

<ResponseField name="IsReassigned" type="boolean | null">
  Indicates if the phone was reassigned after the consent date:

  * `true` - Reassigned. **Do not call.**
  * `false` - Not reassigned.
  * `null` - Insufficient FCC data.
</ResponseField>

<ResponseField name="HasSafeHarbor" type="boolean">
  `true` if an FCC safe harbor exemption may be available
</ResponseField>

<ResponseField name="IsSandBox" type="boolean">
  `true` if the response was generated in sandbox mode (test data), `false` for production data.
</ResponseField>

## Error Responses

| Status Code      | Description                                                                                                 |
| ---------------- | ----------------------------------------------------------------------------------------------------------- |
| 400 Bad Request  | The `data` property is missing or empty, more than 1,000 phone numbers, or invalid phone number/date format |
| 401 Unauthorized | Invalid or missing API key                                                                                  |

## Batch Processing Example

```javascript theme={null}
async function checkRNDBasic(phoneRecords) {
  const response = await fetch(
    'https://dataapi.dncscrub.com/v1.5/Data/RNDBasic',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'loginId': 'YOUR_API_KEY'
      },
      body: JSON.stringify({ data: phoneRecords })
    }
  );

  const results = await response.json();

  // Categorize results
  const safeToCall = results.filter(r => r.IsReassigned === false);
  const doNotCall = results.filter(r => r.IsReassigned === true);
  const unknown = results.filter(r => r.IsReassigned === null);

  console.log(`Safe: ${safeToCall.length}`);
  console.log(`Do Not Call: ${doNotCall.length}`);
  console.log(`Unknown (insufficient FCC data): ${unknown.length}`);

  return { safeToCall, doNotCall, unknown };
}

// Usage
const records = [
  { phoneNumber: '5039367187', date: '20211014' },
  { phoneNumber: '7075276405', date: '20211122' }
];

await checkRNDBasic(records);
```
